blob: fd6cdec7e016537bc2b45818a16b17fee40eff60 [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);
1393
1394 /*------------------------------------------------------------------------
1395 Fill in Event data and post to the Main FSM
1396 ------------------------------------------------------------------------*/
1397 wdiEventData.wdiRequest = WDI_STOP_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001398 wdiEventData.pEventData = pwdiStopParams;
1399 wdiEventData.uEventDataSize = sizeof(*pwdiStopParams);
1400 wdiEventData.pCBfnc = wdiStopRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001401 wdiEventData.pUserData = pUserData;
1402
1403 return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData);
1404
1405}/*WDI_Stop*/
1406
1407
1408
1409/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001410 @brief WDI_Close will be called when the upper MAC no longer
Jeff Johnson295189b2012-06-20 16:38:30 -07001411 needs to interact with DAL. DAL will free its control
1412 block.
Jeff Johnsone7245742012-09-05 17:12:55 -07001413
1414 It is only accepted in state STOPPED.
Jeff Johnson295189b2012-06-20 16:38:30 -07001415
1416 WDI_Stop must have been called.
1417
1418 @param none
Jeff Johnsone7245742012-09-05 17:12:55 -07001419
Jeff Johnson295189b2012-06-20 16:38:30 -07001420 @see WDI_Stop
1421 @return Result of the function call
1422*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001423WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001424WDI_Close
1425(
1426 void
1427)
1428{
1429 wpt_uint8 i;
1430 WDI_EventInfoType wdiEventData;
1431 wpt_status wptStatus;
1432 wpt_status eventStatus;
1433 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1434
1435 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001436 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001437 ------------------------------------------------------------------------*/
1438 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1439 {
1440 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1441 "WDI API call before module is initialized - Fail request");
1442
Jeff Johnsone7245742012-09-05 17:12:55 -07001443 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001444 }
1445
1446 /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ
1447 (the control transport will be closed by the FSM and we'll want
1448 to wait until that completes)*/
1449 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001450 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001451 {
1452 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1453 "%s: Failed to reset WCTS action event", __FUNCTION__);
1454 /* fall through and try to finish closing via the FSM */
1455 }
1456
1457 /*------------------------------------------------------------------------
1458 Fill in Event data and post to the Main FSM
1459 ------------------------------------------------------------------------*/
1460 wdiEventData.wdiRequest = WDI_CLOSE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001461 wdiEventData.pEventData = NULL;
1462 wdiEventData.uEventDataSize = 0;
1463 wdiEventData.pCBfnc = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001464 wdiEventData.pUserData = NULL;
1465
1466 gWDIInitialized = eWLAN_PAL_FALSE;
1467
1468 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData);
1469
1470 /*Wait for WCTS to close the control transport
1471 (but only if we were able to reset the event flag*/
1472 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1473 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001474 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
Jeff Johnson295189b2012-06-20 16:38:30 -07001475 WDI_WCTS_ACTION_TIMEOUT);
1476 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1477 {
1478 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1479 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1480 }
1481 }
1482
1483 /* Destroy the WCTS action event */
1484 wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent);
1485 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1486 {
1487 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1488 "WDI Close failed to destroy an event");
Jeff Johnsone7245742012-09-05 17:12:55 -07001489 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001490 }
1491
1492 /* Destroy the Set Power State event */
1493 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1494 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1495 {
1496 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1497 "WDI Close failed to destroy an event");
1498
Jeff Johnsone7245742012-09-05 17:12:55 -07001499 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001500 }
1501
1502 /*------------------------------------------------------------------------
1503 Closes the Data Path Utility Module
1504 ------------------------------------------------------------------------*/
1505 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1506 {
1507 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1508 "WDI Init failed to close the DP Util Module");
1509
Jeff Johnsone7245742012-09-05 17:12:55 -07001510 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001511 }
1512
1513 /*destroy the BSS sessions pending Queue */
1514 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1515 {
1516 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1517 }
1518
1519 /* destroy the WDI Pending Assoc Id Request Queue*/
1520 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1521
1522 /* destroy the WDI Pending Request Queue*/
1523 wpal_list_destroy(&(gWDICb.wptPendingQueue));
Jeff Johnsone7245742012-09-05 17:12:55 -07001524
Jeff Johnson295189b2012-06-20 16:38:30 -07001525 /*destroy the response timer */
1526 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1527
1528 /*invalidate the main synchro mutex */
1529 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1530 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1531 {
1532 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1533 "Failed to delete mutex %d", wptStatus);
1534 WDI_ASSERT(0);
1535 }
1536
1537 /*Clear control block. note that this will clear the "magic"
1538 which will inhibit all asynchronous callbacks*/
1539 WDI_CleanCB(&gWDICb);
1540
1541 return wptStatus;
1542
1543}/*WDI_Close*/
1544
1545/**
1546 @brief WDI_Shutdown will be called during 'SSR shutdown' operation.
1547 This will do most of the WDI stop & close
1548 operations without doing any handshake with Riva
1549
1550 This will also make sure that the control transport
1551 will NOT be closed.
1552
1553 This request will not be queued.
1554
1555
1556 WDI_Start must have been called.
1557
1558 @param closeTransport: Close control channel if this is set
1559
1560 @return Result of the function call
1561*/
1562WDI_Status
1563WDI_Shutdown
1564(
1565 wpt_boolean closeTransport
1566)
1567{
1568 WDI_EventInfoType wdiEventData;
1569 wpt_status wptStatus;
1570 int i = 0;
1571 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1572
1573 /*------------------------------------------------------------------------
1574 Sanity Check
1575 ------------------------------------------------------------------------*/
1576 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1577 {
1578 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1579 "WDI API call before module is initialized - Fail request");
1580
1581 return WDI_STATUS_E_NOT_ALLOWED;
1582 }
1583
1584 /*------------------------------------------------------------------------
1585 Fill in Event data and post to the Main FSM
1586 ------------------------------------------------------------------------*/
1587 wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ;
1588 wdiEventData.pEventData = NULL;
1589 wdiEventData.uEventDataSize = 0;
1590
1591 /* Shutdown will not be queued, if the state is busy timer will be
1592 * stopped & this message will be processed.*/
1593 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData);
1594 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1595 {
1596 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1597 "%s: Failed to process shutdown event", __FUNCTION__);
1598 }
1599 /* Destroy the Set Power State event */
1600 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1601 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1602 {
1603 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1604 "WDI Close failed to destroy an event");
1605
1606 WDI_ASSERT(0);
1607 }
1608 /*------------------------------------------------------------------------
1609 Closes the Data Path Utility Module
1610 ------------------------------------------------------------------------*/
1611 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1612 {
1613 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1614 "WDI Init failed to close the DP Util Module");
1615
1616 WDI_ASSERT(0);
1617 }
1618 if ( closeTransport )
1619 {
1620 /* Close control transport, called from module unload */
1621 WCTS_CloseTransport(gWDICb.wctsHandle);
1622 }
1623
1624 /*destroy the BSS sessions pending Queue */
1625 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1626 {
1627 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1628 }
1629
1630 /* destroy the WDI Pending Assoc Id Request Queue*/
1631 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1632 /* destroy the WDI Pending Request Queue*/
1633 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1634 /*destroy the response timer */
1635 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1636
1637 /*invalidate the main synchro mutex */
1638 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1639 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1640 {
1641 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1642 "%s: Failed to delete mutex %d", __FUNCTION__, wptStatus);
1643 WDI_ASSERT(0);
1644 }
Madan Mohan Koyyalamudi3513bf52012-09-18 17:35:53 -07001645 /* Free the global variables */
1646 wpalMemoryFree(gpHostWlanFeatCaps);
1647 wpalMemoryFree(gpFwWlanFeatCaps);
Jeff Johnson295189b2012-06-20 16:38:30 -07001648 /*Clear control block. note that this will clear the "magic"
1649 which will inhibit all asynchronous callbacks*/
1650 WDI_CleanCB(&gWDICb);
1651 return wptStatus;
1652
1653}/*WDI_Shutdown*/
1654
1655
Jeff Johnsone7245742012-09-05 17:12:55 -07001656/*========================================================================
1657
Jeff Johnson295189b2012-06-20 16:38:30 -07001658 SCAN APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07001659
Jeff Johnson295189b2012-06-20 16:38:30 -07001660==========================================================================*/
1661
1662/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001663 @brief WDI_InitScanReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07001664 the WLAN Device to get ready for a scan procedure. Upon
1665 the call of this API the WLAN DAL will pack and send a
1666 HAL Init Scan request message to the lower RIVA
1667 sub-system if DAL is in state STARTED.
1668
1669 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001670 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001671
1672 WDI_Start must have been called.
1673
1674 @param wdiInitScanParams: the init scan parameters as specified
1675 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001676
Jeff Johnson295189b2012-06-20 16:38:30 -07001677 wdiInitScanRspCb: callback for passing back the response
1678 of the init scan operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001679
Jeff Johnson295189b2012-06-20 16:38:30 -07001680 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001681 callback
1682
Jeff Johnson295189b2012-06-20 16:38:30 -07001683 @see WDI_Start
1684 @return Result of the function call
1685*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001686WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001687WDI_InitScanReq
1688(
1689 WDI_InitScanReqParamsType* pwdiInitScanParams,
1690 WDI_InitScanRspCb wdiInitScanRspCb,
1691 void* pUserData
1692)
1693{
1694 WDI_EventInfoType wdiEventData;
1695 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1696
1697 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001698 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001699 ------------------------------------------------------------------------*/
1700 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1701 {
1702 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1703 "WDI API call before module is initialized - Fail request");
1704
Jeff Johnsone7245742012-09-05 17:12:55 -07001705 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001706 }
1707
1708 /*------------------------------------------------------------------------
1709 Fill in Event data and post to the Main FSM
1710 ------------------------------------------------------------------------*/
1711 wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001712 wdiEventData.pEventData = pwdiInitScanParams;
1713 wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams);
1714 wdiEventData.pCBfnc = wdiInitScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001715 wdiEventData.pUserData = pUserData;
1716
1717 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1718
1719}/*WDI_InitScanReq*/
1720
1721/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001722 @brief WDI_StartScanReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07001723 wishes to change the Scan channel on the WLAN Device.
1724 Upon the call of this API the WLAN DAL will pack and
1725 send a HAL Start Scan request message to the lower RIVA
1726 sub-system if DAL is in state STARTED.
1727
1728 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001729 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001730
1731 WDI_InitScanReq must have been called.
1732
Jeff Johnsone7245742012-09-05 17:12:55 -07001733 @param wdiStartScanParams: the start scan parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001734 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001735
Jeff Johnson295189b2012-06-20 16:38:30 -07001736 wdiStartScanRspCb: callback for passing back the
1737 response of the start scan operation received from the
1738 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001739
Jeff Johnson295189b2012-06-20 16:38:30 -07001740 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001741 callback
1742
Jeff Johnson295189b2012-06-20 16:38:30 -07001743 @see WDI_InitScanReq
1744 @return Result of the function call
1745*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001746WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001747WDI_StartScanReq
1748(
1749 WDI_StartScanReqParamsType* pwdiStartScanParams,
1750 WDI_StartScanRspCb wdiStartScanRspCb,
1751 void* pUserData
1752)
1753{
1754 WDI_EventInfoType wdiEventData;
1755 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1756
1757 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001758 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001759 ------------------------------------------------------------------------*/
1760 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1761 {
1762 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1763 "WDI API call before module is initialized - Fail request");
1764
Jeff Johnsone7245742012-09-05 17:12:55 -07001765 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001766 }
1767
1768 /*------------------------------------------------------------------------
1769 Fill in Event data and post to the Main FSM
1770 ------------------------------------------------------------------------*/
1771 wdiEventData.wdiRequest = WDI_START_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001772 wdiEventData.pEventData = pwdiStartScanParams;
1773 wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams);
1774 wdiEventData.pCBfnc = wdiStartScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001775 wdiEventData.pUserData = pUserData;
1776
1777 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1778
1779}/*WDI_StartScanReq*/
1780
1781
1782/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001783 @brief WDI_EndScanReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07001784 wants to end scanning for a particular channel that it
1785 had set before by calling Scan Start on the WLAN Device.
1786 Upon the call of this API the WLAN DAL will pack and
1787 send a HAL End Scan request message to the lower RIVA
1788 sub-system if DAL is in state STARTED.
1789
1790 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001791 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001792
1793 WDI_StartScanReq must have been called.
1794
Jeff Johnsone7245742012-09-05 17:12:55 -07001795 @param wdiEndScanParams: the end scan parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07001796 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001797
Jeff Johnson295189b2012-06-20 16:38:30 -07001798 wdiEndScanRspCb: callback for passing back the response
1799 of the end scan operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001800
Jeff Johnson295189b2012-06-20 16:38:30 -07001801 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001802 callback
1803
Jeff Johnson295189b2012-06-20 16:38:30 -07001804 @see WDI_StartScanReq
1805 @return Result of the function call
1806*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001807WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001808WDI_EndScanReq
1809(
1810 WDI_EndScanReqParamsType* pwdiEndScanParams,
1811 WDI_EndScanRspCb wdiEndScanRspCb,
1812 void* pUserData
1813)
1814{
1815 WDI_EventInfoType wdiEventData;
1816 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1817
1818 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001819 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001820 ------------------------------------------------------------------------*/
1821 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1822 {
1823 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1824 "WDI API call before module is initialized - Fail request");
1825
Jeff Johnsone7245742012-09-05 17:12:55 -07001826 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001827 }
1828
1829 /*------------------------------------------------------------------------
1830 Fill in Event data and post to the Main FSM
1831 ------------------------------------------------------------------------*/
1832 wdiEventData.wdiRequest = WDI_END_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001833 wdiEventData.pEventData = pwdiEndScanParams;
1834 wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams);
1835 wdiEventData.pCBfnc = wdiEndScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001836 wdiEventData.pUserData = pUserData;
1837
1838 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1839
1840}/*WDI_EndScanReq*/
1841
1842
1843/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001844 @brief WDI_FinishScanReq will be called when the upper MAC has
Jeff Johnson295189b2012-06-20 16:38:30 -07001845 completed the scan process on the WLAN Device. Upon the
1846 call of this API the WLAN DAL will pack and send a HAL
1847 Finish Scan Request request message to the lower RIVA
1848 sub-system if DAL is in state STARTED.
1849
1850 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001851 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001852
1853 WDI_InitScanReq must have been called.
1854
Jeff Johnsone7245742012-09-05 17:12:55 -07001855 @param wdiFinishScanParams: the finish scan parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001856 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001857
Jeff Johnson295189b2012-06-20 16:38:30 -07001858 wdiFinishScanRspCb: callback for passing back the
1859 response of the finish scan operation received from the
1860 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001861
Jeff Johnson295189b2012-06-20 16:38:30 -07001862 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001863 callback
1864
Jeff Johnson295189b2012-06-20 16:38:30 -07001865 @see WDI_InitScanReq
1866 @return Result of the function call
1867*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001868WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001869WDI_FinishScanReq
1870(
1871 WDI_FinishScanReqParamsType* pwdiFinishScanParams,
1872 WDI_FinishScanRspCb wdiFinishScanRspCb,
1873 void* pUserData
1874)
1875{
1876 WDI_EventInfoType wdiEventData;
1877 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1878
1879 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001880 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001881 ------------------------------------------------------------------------*/
1882 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1883 {
1884 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1885 "WDI API call before module is initialized - Fail request");
1886
Jeff Johnsone7245742012-09-05 17:12:55 -07001887 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001888 }
1889
1890 /*------------------------------------------------------------------------
1891 Fill in Event data and post to the Main FSM
1892 ------------------------------------------------------------------------*/
1893 wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001894 wdiEventData.pEventData = pwdiFinishScanParams;
1895 wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams);
1896 wdiEventData.pCBfnc = wdiFinishScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001897 wdiEventData.pUserData = pUserData;
1898
1899 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1900
1901}/*WDI_FinishScanReq*/
1902
Jeff Johnsone7245742012-09-05 17:12:55 -07001903/*========================================================================
1904
Jeff Johnson295189b2012-06-20 16:38:30 -07001905 ASSOCIATION APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07001906
Jeff Johnson295189b2012-06-20 16:38:30 -07001907==========================================================================*/
1908
1909/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001910 @brief WDI_JoinReq will be called when the upper MAC is ready
Jeff Johnson295189b2012-06-20 16:38:30 -07001911 to start an association procedure to a BSS. Upon the
1912 call of this API the WLAN DAL will pack and send a HAL
1913 Join request message to the lower RIVA sub-system if
1914 DAL is in state STARTED.
1915
1916 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001917 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001918
1919 WDI_Start must have been called.
1920
Jeff Johnsone7245742012-09-05 17:12:55 -07001921 @param wdiJoinParams: the join parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001922 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001923
Jeff Johnson295189b2012-06-20 16:38:30 -07001924 wdiJoinRspCb: callback for passing back the response of
1925 the join operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001926
Jeff Johnson295189b2012-06-20 16:38:30 -07001927 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001928 callback
1929
Jeff Johnson295189b2012-06-20 16:38:30 -07001930 @see WDI_Start
1931 @return Result of the function call
1932*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001933WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001934WDI_JoinReq
1935(
1936 WDI_JoinReqParamsType* pwdiJoinParams,
1937 WDI_JoinRspCb wdiJoinRspCb,
1938 void* pUserData
1939)
1940{
1941 WDI_EventInfoType wdiEventData;
1942 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1943
1944 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001945 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001946 ------------------------------------------------------------------------*/
1947 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1948 {
1949 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1950 "WDI API call before module is initialized - Fail request");
1951
Jeff Johnsone7245742012-09-05 17:12:55 -07001952 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001953 }
1954
1955 /*------------------------------------------------------------------------
1956 Fill in Event data and post to the Main FSM
1957 ------------------------------------------------------------------------*/
1958 wdiEventData.wdiRequest = WDI_JOIN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001959 wdiEventData.pEventData = pwdiJoinParams;
1960 wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams);
1961 wdiEventData.pCBfnc = wdiJoinRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001962 wdiEventData.pUserData = pUserData;
1963
1964 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1965
1966}/*WDI_JoinReq*/
1967
1968/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001969 @brief WDI_ConfigBSSReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07001970 wishes to configure the newly acquired or in process of
1971 being acquired BSS to the HW . Upon the call of this API
1972 the WLAN DAL will pack and send a HAL Config BSS request
1973 message to the lower RIVA sub-system if DAL is in state
1974 STARTED.
1975
1976 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001977 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001978
1979 WDI_JoinReq must have been called.
1980
Jeff Johnsone7245742012-09-05 17:12:55 -07001981 @param wdiConfigBSSParams: the config BSS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001982 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001983
Jeff Johnson295189b2012-06-20 16:38:30 -07001984 wdiConfigBSSRspCb: callback for passing back the
1985 response of the config BSS operation received from the
1986 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001987
Jeff Johnson295189b2012-06-20 16:38:30 -07001988 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001989 callback
1990
Jeff Johnson295189b2012-06-20 16:38:30 -07001991 @see WDI_JoinReq
1992 @return Result of the function call
1993*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001994WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001995WDI_ConfigBSSReq
1996(
1997 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams,
1998 WDI_ConfigBSSRspCb wdiConfigBSSRspCb,
1999 void* pUserData
2000)
2001{
2002 WDI_EventInfoType wdiEventData;
2003 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2004
2005 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002006 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002007 ------------------------------------------------------------------------*/
2008 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2009 {
2010 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2011 "WDI API call before module is initialized - Fail request");
2012
Jeff Johnsone7245742012-09-05 17:12:55 -07002013 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002014 }
2015
2016 /*------------------------------------------------------------------------
2017 Fill in Event data and post to the Main FSM
2018 ------------------------------------------------------------------------*/
2019 wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002020 wdiEventData.pEventData = pwdiConfigBSSParams;
2021 wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams);
2022 wdiEventData.pCBfnc = wdiConfigBSSRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002023 wdiEventData.pUserData = pUserData;
2024
2025 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2026
2027}/*WDI_ConfigBSSReq*/
2028
2029/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002030 @brief WDI_DelBSSReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07002031 disassociating from the BSS and wishes to notify HW.
2032 Upon the call of this API the WLAN DAL will pack and
2033 send a HAL Del BSS request message to the lower RIVA
2034 sub-system if DAL is in state STARTED.
2035
2036 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002037 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002038
2039 WDI_ConfigBSSReq or WDI_PostAssocReq must have been called.
2040
Jeff Johnsone7245742012-09-05 17:12:55 -07002041 @param wdiDelBSSParams: the del BSS parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07002042 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002043
Jeff Johnson295189b2012-06-20 16:38:30 -07002044 wdiDelBSSRspCb: callback for passing back the response
2045 of the del bss operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002046
Jeff Johnson295189b2012-06-20 16:38:30 -07002047 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002048 callback
2049
2050 @see WDI_ConfigBSSReq, WDI_PostAssocReq
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 @return Result of the function call
2052*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002053WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002054WDI_DelBSSReq
2055(
2056 WDI_DelBSSReqParamsType* pwdiDelBSSParams,
2057 WDI_DelBSSRspCb wdiDelBSSRspCb,
2058 void* pUserData
2059)
2060{
2061 WDI_EventInfoType wdiEventData;
2062 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2063
2064 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002065 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002066 ------------------------------------------------------------------------*/
2067 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2068 {
2069 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2070 "WDI API call before module is initialized - Fail request");
2071
Jeff Johnsone7245742012-09-05 17:12:55 -07002072 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002073 }
2074
2075 /*------------------------------------------------------------------------
2076 Fill in Event data and post to the Main FSM
2077 ------------------------------------------------------------------------*/
2078 wdiEventData.wdiRequest = WDI_DEL_BSS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002079 wdiEventData.pEventData = pwdiDelBSSParams;
2080 wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams);
2081 wdiEventData.pCBfnc = wdiDelBSSRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002082 wdiEventData.pUserData = pUserData;
2083
2084 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2085
2086}/*WDI_DelBSSReq*/
2087
2088/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002089 @brief WDI_PostAssocReq will be called when the upper MAC has
Jeff Johnson295189b2012-06-20 16:38:30 -07002090 associated to a BSS and wishes to configure HW for
2091 associated state. Upon the call of this API the WLAN DAL
2092 will pack and send a HAL Post Assoc request message to
2093 the lower RIVA sub-system if DAL is in state STARTED.
2094
2095 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002096 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002097
2098 WDI_JoinReq must have been called.
2099
2100 @param wdiPostAssocReqParams: the assoc parameters as specified
2101 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002102
Jeff Johnson295189b2012-06-20 16:38:30 -07002103 wdiPostAssocRspCb: callback for passing back the
2104 response of the post assoc operation received from the
2105 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002106
Jeff Johnson295189b2012-06-20 16:38:30 -07002107 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002108 callback
2109
Jeff Johnson295189b2012-06-20 16:38:30 -07002110 @see WDI_JoinReq
2111 @return Result of the function call
2112*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002113WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002114WDI_PostAssocReq
2115(
2116 WDI_PostAssocReqParamsType* pwdiPostAssocReqParams,
2117 WDI_PostAssocRspCb wdiPostAssocRspCb,
2118 void* pUserData
2119)
2120{
2121 WDI_EventInfoType wdiEventData;
2122 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2123
2124 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002125 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002126 ------------------------------------------------------------------------*/
2127 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2128 {
2129 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2130 "WDI API call before module is initialized - Fail request");
2131
Jeff Johnsone7245742012-09-05 17:12:55 -07002132 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002133 }
2134
2135 /*------------------------------------------------------------------------
2136 Fill in Event data and post to the Main FSM
2137 ------------------------------------------------------------------------*/
2138 wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002139 wdiEventData.pEventData = pwdiPostAssocReqParams;
2140 wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams);
2141 wdiEventData.pCBfnc = wdiPostAssocRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002142 wdiEventData.pUserData = pUserData;
2143
2144 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2145
2146}/*WDI_PostAssocReq*/
2147
2148/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002149 @brief WDI_DelSTAReq will be called when the upper MAC when an
Jeff Johnson295189b2012-06-20 16:38:30 -07002150 association with another STA has ended and the station
2151 must be deleted from HW. Upon the call of this API the
2152 WLAN DAL will pack and send a HAL Del STA request
2153 message to the lower RIVA sub-system if DAL is in state
2154 STARTED.
2155
2156 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002157 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002158
2159 WDI_PostAssocReq must have been called.
2160
Jeff Johnsone7245742012-09-05 17:12:55 -07002161 @param wdiDelSTAParams: the Del STA parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07002162 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002163
Jeff Johnson295189b2012-06-20 16:38:30 -07002164 wdiDelSTARspCb: callback for passing back the response
2165 of the del STA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002166
Jeff Johnson295189b2012-06-20 16:38:30 -07002167 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002168 callback
2169
Jeff Johnson295189b2012-06-20 16:38:30 -07002170 @see WDI_PostAssocReq
2171 @return Result of the function call
2172*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002173WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002174WDI_DelSTAReq
2175(
2176 WDI_DelSTAReqParamsType* pwdiDelSTAParams,
2177 WDI_DelSTARspCb wdiDelSTARspCb,
2178 void* pUserData
2179)
2180{
2181 WDI_EventInfoType wdiEventData;
2182 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2183
2184 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002185 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002186 ------------------------------------------------------------------------*/
2187 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2188 {
2189 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2190 "WDI API call before module is initialized - Fail request");
2191
Jeff Johnsone7245742012-09-05 17:12:55 -07002192 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002193 }
2194
2195 /*------------------------------------------------------------------------
2196 Fill in Event data and post to the Main FSM
2197 ------------------------------------------------------------------------*/
2198 wdiEventData.wdiRequest = WDI_DEL_STA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002199 wdiEventData.pEventData = pwdiDelSTAParams;
2200 wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams);
2201 wdiEventData.pCBfnc = wdiDelSTARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002202 wdiEventData.pUserData = pUserData;
2203
2204 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2205
2206}/*WDI_DelSTAReq*/
2207
Jeff Johnsone7245742012-09-05 17:12:55 -07002208/*========================================================================
2209
Jeff Johnson295189b2012-06-20 16:38:30 -07002210 SECURITY APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002211
Jeff Johnson295189b2012-06-20 16:38:30 -07002212==========================================================================*/
2213
2214/**
2215 @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to
2216 install a BSS encryption key on the HW. Upon the call of this
2217 API the WLAN DAL will pack and send a Set BSS Key request
2218 message to the lower RIVA sub-system if DAL is in state
2219 STARTED.
2220
2221 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002222 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002223
2224 WDI_PostAssocReq must have been called.
2225
Jeff Johnsone7245742012-09-05 17:12:55 -07002226 @param wdiSetBSSKeyParams: the BSS Key set parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002227 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002228
Jeff Johnson295189b2012-06-20 16:38:30 -07002229 wdiSetBSSKeyRspCb: callback for passing back the
2230 response of the set BSS Key operation received from the
2231 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002232
Jeff Johnson295189b2012-06-20 16:38:30 -07002233 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002234 callback
2235
Jeff Johnson295189b2012-06-20 16:38:30 -07002236 @see WDI_PostAssocReq
2237 @return Result of the function call
2238*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002239WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002240WDI_SetBSSKeyReq
2241(
2242 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams,
2243 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb,
2244 void* pUserData
2245)
2246{
2247 WDI_EventInfoType wdiEventData;
2248 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2249
2250 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002251 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002252 ------------------------------------------------------------------------*/
2253 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2254 {
2255 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2256 "WDI API call before module is initialized - Fail request");
2257
Jeff Johnsone7245742012-09-05 17:12:55 -07002258 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002259 }
2260
2261 /*------------------------------------------------------------------------
2262 Fill in Event data and post to the Main FSM
2263 ------------------------------------------------------------------------*/
2264 wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002265 wdiEventData.pEventData = pwdiSetBSSKeyParams;
2266 wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams);
2267 wdiEventData.pCBfnc = wdiSetBSSKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002268 wdiEventData.pUserData = pUserData;
2269
2270 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2271
2272}/*WDI_SetBSSKeyReq*/
2273
2274/**
2275 @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to
2276 uninstall a BSS key from HW. Upon the call of this API the
2277 WLAN DAL will pack and send a HAL Remove BSS Key request
2278 message to the lower RIVA sub-system if DAL is in state
2279 STARTED.
2280
2281 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002282 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002283
2284 WDI_SetBSSKeyReq must have been called.
2285
Jeff Johnsone7245742012-09-05 17:12:55 -07002286 @param wdiRemoveBSSKeyParams: the remove BSS key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002287 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002288
Jeff Johnson295189b2012-06-20 16:38:30 -07002289 wdiRemoveBSSKeyRspCb: callback for passing back the
2290 response of the remove BSS key operation received from
2291 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002292
Jeff Johnson295189b2012-06-20 16:38:30 -07002293 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002294 callback
2295
Jeff Johnson295189b2012-06-20 16:38:30 -07002296 @see WDI_SetBSSKeyReq
2297 @return Result of the function call
2298*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002299WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002300WDI_RemoveBSSKeyReq
2301(
2302 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams,
2303 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb,
2304 void* pUserData
2305)
2306{
2307 WDI_EventInfoType wdiEventData;
2308 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2309
2310 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002311 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002312 ------------------------------------------------------------------------*/
2313 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2314 {
2315 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2316 "WDI API call before module is initialized - Fail request");
2317
Jeff Johnsone7245742012-09-05 17:12:55 -07002318 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002319 }
2320
2321 /*------------------------------------------------------------------------
2322 Fill in Event data and post to the Main FSM
2323 ------------------------------------------------------------------------*/
2324 wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002325 wdiEventData.pEventData = pwdiRemoveBSSKeyParams;
2326 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams);
2327 wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002328 wdiEventData.pUserData = pUserData;
2329
2330 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2331
2332}/*WDI_RemoveBSSKeyReq*/
2333
2334
2335/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002336 @brief WDI_SetSTAKeyReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07002337 ready to install a STA(ast) encryption key in HW. Upon
2338 the call of this API the WLAN DAL will pack and send a
2339 HAL Set STA Key request message to the lower RIVA
2340 sub-system if DAL is in state STARTED.
2341
2342 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002343 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002344
2345 WDI_PostAssocReq must have been called.
2346
Jeff Johnsone7245742012-09-05 17:12:55 -07002347 @param wdiSetSTAKeyParams: the set STA key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002348 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002349
Jeff Johnson295189b2012-06-20 16:38:30 -07002350 wdiSetSTAKeyRspCb: callback for passing back the
2351 response of the set STA key operation received from the
2352 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002353
Jeff Johnson295189b2012-06-20 16:38:30 -07002354 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002355 callback
2356
Jeff Johnson295189b2012-06-20 16:38:30 -07002357 @see WDI_PostAssocReq
2358 @return Result of the function call
2359*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002360WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002361WDI_SetSTAKeyReq
2362(
2363 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams,
2364 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb,
2365 void* pUserData
2366)
2367{
2368 WDI_EventInfoType wdiEventData;
2369 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2370
2371 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002372 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002373 ------------------------------------------------------------------------*/
2374 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2375 {
2376 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2377 "WDI API call before module is initialized - Fail request");
2378
Jeff Johnsone7245742012-09-05 17:12:55 -07002379 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002380 }
2381
2382 /*------------------------------------------------------------------------
2383 Fill in Event data and post to the Main FSM
2384 ------------------------------------------------------------------------*/
2385 wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002386 wdiEventData.pEventData = pwdiSetSTAKeyParams;
2387 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams);
2388 wdiEventData.pCBfnc = wdiSetSTAKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002389 wdiEventData.pUserData = pUserData;
2390
2391 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2392
2393}/*WDI_SetSTAKeyReq*/
2394
2395
2396/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002397 @brief WDI_RemoveSTAKeyReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002398 wants to uninstall a previously set STA key in HW. Upon
2399 the call of this API the WLAN DAL will pack and send a
2400 HAL Remove STA Key request message to the lower RIVA
2401 sub-system if DAL is in state STARTED.
2402
2403 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002404 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002405
2406 WDI_SetSTAKeyReq must have been called.
2407
Jeff Johnsone7245742012-09-05 17:12:55 -07002408 @param wdiRemoveSTAKeyParams: the remove STA key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002409 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002410
Jeff Johnson295189b2012-06-20 16:38:30 -07002411 wdiRemoveSTAKeyRspCb: callback for passing back the
2412 response of the remove STA key operation received from
2413 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002414
Jeff Johnson295189b2012-06-20 16:38:30 -07002415 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002416 callback
2417
Jeff Johnson295189b2012-06-20 16:38:30 -07002418 @see WDI_SetSTAKeyReq
2419 @return Result of the function call
2420*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002421WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002422WDI_RemoveSTAKeyReq
2423(
2424 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams,
2425 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb,
2426 void* pUserData
2427)
2428{
2429 WDI_EventInfoType wdiEventData;
2430 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2431
2432 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002433 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002434 ------------------------------------------------------------------------*/
2435 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2436 {
2437 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2438 "WDI API call before module is initialized - Fail request");
2439
Jeff Johnsone7245742012-09-05 17:12:55 -07002440 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002441 }
2442
2443 /*------------------------------------------------------------------------
2444 Fill in Event data and post to the Main FSM
2445 ------------------------------------------------------------------------*/
2446 wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002447 wdiEventData.pEventData = pwdiRemoveSTAKeyParams;
2448 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams);
2449 wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002450 wdiEventData.pUserData = pUserData;
2451
2452 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2453
2454}/*WDI_RemoveSTAKeyReq*/
2455
2456
2457/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002458 @brief WDI_SetSTABcastKeyReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002459 wants to install a STA Bcast encryption key on the HW.
2460 Upon the call of this API the WLAN DAL will pack and
2461 send a HAL Start request message to the lower RIVA
2462 sub-system if DAL is in state STARTED.
2463
2464 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002465 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002466
2467 WDI_PostAssocReq must have been called.
2468
Jeff Johnsone7245742012-09-05 17:12:55 -07002469 @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002470 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002471
Jeff Johnson295189b2012-06-20 16:38:30 -07002472 wdiSetSTABcastKeyRspCb: callback for passing back the
2473 response of the set BSS Key operation received from the
2474 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002475
Jeff Johnson295189b2012-06-20 16:38:30 -07002476 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002477 callback
2478
Jeff Johnson295189b2012-06-20 16:38:30 -07002479 @see WDI_PostAssocReq
2480 @return Result of the function call
2481*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002482WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002483WDI_SetSTABcastKeyReq
2484(
2485 WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams,
2486 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb,
2487 void* pUserData
2488)
2489
2490{
2491 WDI_EventInfoType wdiEventData;
2492 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2493
2494 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002495 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002496 ------------------------------------------------------------------------*/
2497 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2498 {
2499 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2500 "WDI API call before module is initialized - Fail request");
2501
Jeff Johnsone7245742012-09-05 17:12:55 -07002502 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002503 }
2504
2505 /*------------------------------------------------------------------------
2506 Fill in Event data and post to the Main FSM
2507 ------------------------------------------------------------------------*/
2508 wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002509 wdiEventData.pEventData = pwdiSetSTABcastKeyParams;
2510 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams);
2511 wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002512 wdiEventData.pUserData = pUserData;
2513
2514 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2515
2516}/*WDI_SetSTABcastKeyReq*/
2517
2518/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002519 @brief WDI_RemoveSTABcastKeyReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07002520 MAC wants to uninstall a STA Bcast key from HW. Upon the
2521 call of this API the WLAN DAL will pack and send a HAL
2522 Remove STA Bcast Key request message to the lower RIVA
2523 sub-system if DAL is in state STARTED.
2524
2525 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002526 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002527
2528 WDI_SetSTABcastKeyReq must have been called.
2529
Jeff Johnsone7245742012-09-05 17:12:55 -07002530 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
Jeff Johnson295189b2012-06-20 16:38:30 -07002531 parameters as specified by the Device
2532 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002533
Jeff Johnson295189b2012-06-20 16:38:30 -07002534 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2535 response of the remove STA Bcast key operation received
2536 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002537
Jeff Johnson295189b2012-06-20 16:38:30 -07002538 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002539 callback
2540
Jeff Johnson295189b2012-06-20 16:38:30 -07002541 @see WDI_SetSTABcastKeyReq
2542 @return Result of the function call
2543*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002544WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002545WDI_RemoveSTABcastKeyReq
2546(
2547 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams,
2548 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb,
2549 void* pUserData
2550)
2551{
2552 WDI_EventInfoType wdiEventData;
2553 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2554
2555 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002556 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002557 ------------------------------------------------------------------------*/
2558 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2559 {
2560 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2561 "WDI API call before module is initialized - Fail request");
2562
Jeff Johnsone7245742012-09-05 17:12:55 -07002563 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002564 }
2565
2566 /*------------------------------------------------------------------------
2567 Fill in Event data and post to the Main FSM
2568 ------------------------------------------------------------------------*/
2569 wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002570 wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams;
2571 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams);
2572 wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002573 wdiEventData.pUserData = pUserData;
2574
2575 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2576
2577}/*WDI_RemoveSTABcastKeyReq*/
2578
2579/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002580 @brief WDI_SetMaxTxPowerReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07002581 MAC wants to set Max Tx Power to HW. Upon the
2582 call of this API the WLAN DAL will pack and send a HAL
2583 Remove STA Bcast Key request message to the lower RIVA
2584 sub-system if DAL is in state STARTED.
2585
2586 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002587 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002588
2589 WDI_SetSTABcastKeyReq must have been called.
2590
Jeff Johnsone7245742012-09-05 17:12:55 -07002591 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
Jeff Johnson295189b2012-06-20 16:38:30 -07002592 parameters as specified by the Device
2593 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002594
Jeff Johnson295189b2012-06-20 16:38:30 -07002595 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2596 response of the remove STA Bcast key operation received
2597 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002598
Jeff Johnson295189b2012-06-20 16:38:30 -07002599 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002600 callback
2601
Jeff Johnson295189b2012-06-20 16:38:30 -07002602 @see WDI_SetMaxTxPowerReq
2603 @return Result of the function call
2604*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002605WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002606WDI_SetMaxTxPowerReq
2607(
2608 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams,
2609 WDA_SetMaxTxPowerRspCb wdiReqStatusCb,
2610 void* pUserData
2611)
2612{
2613 WDI_EventInfoType wdiEventData;
2614 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2615
2616 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002617 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002618 ------------------------------------------------------------------------*/
2619 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2620 {
2621 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2622 "WDI API call before module is initialized - Fail request");
2623
Jeff Johnsone7245742012-09-05 17:12:55 -07002624 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002625 }
2626
2627 /*------------------------------------------------------------------------
2628 Fill in Event data and post to the Main FSM
2629 ------------------------------------------------------------------------*/
2630 wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002631 wdiEventData.pEventData = pwdiSetMaxTxPowerParams;
2632 wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams);
2633 wdiEventData.pCBfnc = wdiReqStatusCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002634 wdiEventData.pUserData = pUserData;
2635
2636 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2637}
2638
2639#ifdef FEATURE_WLAN_CCX
2640WDI_Status
2641WDI_TSMStatsReq
2642(
2643 WDI_TSMStatsReqParamsType* pwdiTsmReqParams,
2644 WDI_TsmRspCb wdiReqStatusCb,
2645 void* pUserData
2646)
2647{
2648 WDI_EventInfoType wdiEventData;
2649 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -07002650 /*------------------------------------------------------------------------
2651 Sanity Check
2652 ------------------------------------------------------------------------*/
2653 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2654 {
2655 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2656 "WDI API call before module is initialized - Fail request");
2657
2658 return WDI_STATUS_E_NOT_ALLOWED;
2659 }
2660
2661 /*------------------------------------------------------------------------
2662 Fill in Event data and post to the Main FSM
2663 ------------------------------------------------------------------------*/
2664 wdiEventData.wdiRequest = WDI_TSM_STATS_REQ;
2665 wdiEventData.pEventData = pwdiTsmReqParams;
2666 wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams);
2667 wdiEventData.pCBfnc = wdiReqStatusCb;
2668 wdiEventData.pUserData = pUserData;
2669
2670 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2671
2672}
2673#endif
2674
2675/*========================================================================
2676
2677 QoS and BA APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002678
Jeff Johnson295189b2012-06-20 16:38:30 -07002679==========================================================================*/
2680
2681/**
2682 @brief WDI_AddTSReq will be called when the upper MAC to inform
2683 the device of a successful add TSpec negotiation. HW
2684 needs to receive the TSpec Info from the UMAC in order
2685 to configure properly the QoS data traffic. Upon the
2686 call of this API the WLAN DAL will pack and send a HAL
2687 Add TS request message to the lower RIVA sub-system if
2688 DAL is in state STARTED.
2689
2690 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002691 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002692
2693 WDI_PostAssocReq must have been called.
2694
2695 @param wdiAddTsReqParams: the add TS parameters as specified by
2696 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002697
Jeff Johnson295189b2012-06-20 16:38:30 -07002698 wdiAddTsRspCb: callback for passing back the response of
2699 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002700
Jeff Johnson295189b2012-06-20 16:38:30 -07002701 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002702 callback
2703
Jeff Johnson295189b2012-06-20 16:38:30 -07002704 @see WDI_PostAssocReq
2705 @return Result of the function call
2706*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002707WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002708WDI_AddTSReq
2709(
2710 WDI_AddTSReqParamsType* pwdiAddTsReqParams,
2711 WDI_AddTsRspCb wdiAddTsRspCb,
2712 void* pUserData
2713)
2714{
2715 WDI_EventInfoType wdiEventData;
2716 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2717
2718 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002719 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002720 ------------------------------------------------------------------------*/
2721 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2722 {
2723 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2724 "WDI API call before module is initialized - Fail request");
2725
Jeff Johnsone7245742012-09-05 17:12:55 -07002726 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002727 }
2728
2729 /*------------------------------------------------------------------------
2730 Fill in Event data and post to the Main FSM
2731 ------------------------------------------------------------------------*/
2732 wdiEventData.wdiRequest = WDI_ADD_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002733 wdiEventData.pEventData = pwdiAddTsReqParams;
2734 wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams);
2735 wdiEventData.pCBfnc = wdiAddTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002736 wdiEventData.pUserData = pUserData;
2737
2738 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2739
2740}/*WDI_AddTSReq*/
2741
2742
2743
2744/**
2745 @brief WDI_DelTSReq will be called when the upper MAC has ended
2746 admission on a specific AC. This is to inform HW that
2747 QoS traffic parameters must be rest. Upon the call of
2748 this API the WLAN DAL will pack and send a HAL Del TS
2749 request message to the lower RIVA sub-system if DAL is
2750 in state STARTED.
2751
2752 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002753 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002754
2755 WDI_AddTSReq must have been called.
2756
2757 @param wdiDelTsReqParams: the del TS parameters as specified by
2758 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002759
Jeff Johnson295189b2012-06-20 16:38:30 -07002760 wdiDelTsRspCb: callback for passing back the response of
2761 the del TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002762
Jeff Johnson295189b2012-06-20 16:38:30 -07002763 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002764 callback
2765
Jeff Johnson295189b2012-06-20 16:38:30 -07002766 @see WDI_AddTSReq
2767 @return Result of the function call
2768*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002769WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002770WDI_DelTSReq
2771(
2772 WDI_DelTSReqParamsType* pwdiDelTsReqParams,
2773 WDI_DelTsRspCb wdiDelTsRspCb,
2774 void* pUserData
2775)
2776{
2777 WDI_EventInfoType wdiEventData;
2778 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2779
2780 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002781 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002782 ------------------------------------------------------------------------*/
2783 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2784 {
2785 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2786 "WDI API call before module is initialized - Fail request");
2787
Jeff Johnsone7245742012-09-05 17:12:55 -07002788 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002789 }
2790
2791 /*------------------------------------------------------------------------
2792 Fill in Event data and post to the Main FSM
2793 ------------------------------------------------------------------------*/
2794 wdiEventData.wdiRequest = WDI_DEL_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002795 wdiEventData.pEventData = pwdiDelTsReqParams;
2796 wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams);
2797 wdiEventData.pCBfnc = wdiDelTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002798 wdiEventData.pUserData = pUserData;
2799
2800 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2801
2802}/*WDI_DelTSReq*/
2803
2804
2805
2806/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002807 @brief WDI_UpdateEDCAParams will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002808 wishes to update the EDCA parameters used by HW for QoS
2809 data traffic. Upon the call of this API the WLAN DAL
2810 will pack and send a HAL Update EDCA Params request
2811 message to the lower RIVA sub-system if DAL is in state
2812 STARTED.
2813
2814 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002815 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002816
2817 WDI_PostAssocReq must have been called.
2818
Jeff Johnsone7245742012-09-05 17:12:55 -07002819 @param wdiUpdateEDCAParams: the start parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07002820 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002821
Jeff Johnson295189b2012-06-20 16:38:30 -07002822 wdiUpdateEDCAParamsRspCb: callback for passing back the
2823 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002824
Jeff Johnson295189b2012-06-20 16:38:30 -07002825 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002826 callback
2827
Jeff Johnson295189b2012-06-20 16:38:30 -07002828 @see WDI_PostAssocReq
2829 @return Result of the function call
2830*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002831WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002832WDI_UpdateEDCAParams
2833(
2834 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams,
2835 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb,
2836 void* pUserData
2837)
2838{
2839 WDI_EventInfoType wdiEventData;
2840 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2841
2842 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002843 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002844 ------------------------------------------------------------------------*/
2845 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2846 {
2847 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2848 "WDI API call before module is initialized - Fail request");
2849
Jeff Johnsone7245742012-09-05 17:12:55 -07002850 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002851 }
2852
2853 /*------------------------------------------------------------------------
2854 Fill in Event data and post to the Main FSM
2855 ------------------------------------------------------------------------*/
2856 wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002857 wdiEventData.pEventData = pwdiUpdateEDCAParams;
2858 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams);
2859 wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002860 wdiEventData.pUserData = pUserData;
2861
2862 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2863
2864}/*WDI_UpdateEDCAParams*/
2865
2866
2867/**
2868 @brief WDI_AddBASessionReq will be called when the upper MAC has setup
2869 successfully a BA session and needs to notify the HW for
2870 the appropriate settings to take place. Upon the call of
2871 this API the WLAN DAL will pack and send a HAL Add BA
2872 request message to the lower RIVA sub-system if DAL is
2873 in state STARTED.
2874
2875 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002876 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002877
2878 WDI_PostAssocReq must have been called.
2879
2880 @param wdiAddBAReqParams: the add BA parameters as specified by
2881 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002882
Jeff Johnson295189b2012-06-20 16:38:30 -07002883 wdiAddBARspCb: callback for passing back the response of
2884 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002885
Jeff Johnson295189b2012-06-20 16:38:30 -07002886 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002887 callback
2888
Jeff Johnson295189b2012-06-20 16:38:30 -07002889 @see WDI_PostAssocReq
2890 @return Result of the function call
2891*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002892WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002893WDI_AddBASessionReq
2894(
2895 WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams,
2896 WDI_AddBASessionRspCb wdiAddBASessionRspCb,
2897 void* pUserData
2898)
2899{
2900 WDI_EventInfoType wdiEventData;
2901 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2902
2903 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002904 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002905 ------------------------------------------------------------------------*/
2906 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2907 {
2908 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2909 "WDI API call before module is initialized - Fail request");
2910
Jeff Johnsone7245742012-09-05 17:12:55 -07002911 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002912 }
2913
2914 /*------------------------------------------------------------------------
2915 Fill in Event data and post to the Main FSM
2916 ------------------------------------------------------------------------*/
2917 wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002918 wdiEventData.pEventData = pwdiAddBASessionReqParams;
2919 wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams);
2920 wdiEventData.pCBfnc = wdiAddBASessionRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002921 wdiEventData.pUserData = pUserData;
2922
2923 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2924
2925}/*WDI_AddBASessionReq*/
2926
2927/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002928 @brief WDI_DelBAReq will be called when the upper MAC wants to
Jeff Johnson295189b2012-06-20 16:38:30 -07002929 inform HW that it has deleted a previously created BA
2930 session. Upon the call of this API the WLAN DAL will
2931 pack and send a HAL Del BA request message to the lower
2932 RIVA sub-system if DAL is in state STARTED.
2933
2934 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002935 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002936
2937 WDI_AddBAReq must have been called.
2938
2939 @param wdiDelBAReqParams: the del BA parameters as specified by
2940 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002941
Jeff Johnson295189b2012-06-20 16:38:30 -07002942 wdiDelBARspCb: callback for passing back the response of
2943 the del BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002944
Jeff Johnson295189b2012-06-20 16:38:30 -07002945 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002946 callback
2947
Jeff Johnson295189b2012-06-20 16:38:30 -07002948 @see WDI_AddBAReq
2949 @return Result of the function call
2950*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002951WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002952WDI_DelBAReq
2953(
2954 WDI_DelBAReqParamsType* pwdiDelBAReqParams,
2955 WDI_DelBARspCb wdiDelBARspCb,
2956 void* pUserData
2957)
2958{
2959 WDI_EventInfoType wdiEventData;
2960 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2961
2962 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002963 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002964 ------------------------------------------------------------------------*/
2965 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2966 {
2967 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2968 "WDI API call before module is initialized - Fail request");
2969
Jeff Johnsone7245742012-09-05 17:12:55 -07002970 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002971 }
2972
2973 /*------------------------------------------------------------------------
2974 Fill in Event data and post to the Main FSM
2975 ------------------------------------------------------------------------*/
2976 wdiEventData.wdiRequest = WDI_DEL_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002977 wdiEventData.pEventData = pwdiDelBAReqParams;
2978 wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams);
2979 wdiEventData.pCBfnc = wdiDelBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002980 wdiEventData.pUserData = pUserData;
2981
2982 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2983
2984}/*WDI_DelBAReq*/
2985
Jeff Johnsone7245742012-09-05 17:12:55 -07002986/*========================================================================
2987
Jeff Johnson295189b2012-06-20 16:38:30 -07002988 Power Save APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002989
Jeff Johnson295189b2012-06-20 16:38:30 -07002990==========================================================================*/
2991
2992/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002993 @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002994 wants to set the power save related configurations of
2995 the WLAN Device. Upon the call of this API the WLAN DAL
2996 will pack and send a HAL Update CFG request message to
2997 the lower RIVA sub-system if DAL is in state STARTED.
2998
2999 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003000 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003001
3002 WDI_Start must have been called.
3003
Jeff Johnsone7245742012-09-05 17:12:55 -07003004 @param pwdiPowerSaveCfg: the power save cfg parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003005 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003006
Jeff Johnson295189b2012-06-20 16:38:30 -07003007 wdiSetPwrSaveCfgCb: callback for passing back the
3008 response of the set power save cfg operation received
3009 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003010
Jeff Johnson295189b2012-06-20 16:38:30 -07003011 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003012 callback
3013
Jeff Johnson295189b2012-06-20 16:38:30 -07003014 @see WDI_Start
Jeff Johnsone7245742012-09-05 17:12:55 -07003015 @return Result of the function call
3016*/
3017WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003018WDI_SetPwrSaveCfgReq
3019(
3020 WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg,
3021 WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb,
3022 void* pUserData
3023)
3024{
3025 WDI_EventInfoType wdiEventData;
3026 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3027
3028 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003029 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003030 ------------------------------------------------------------------------*/
3031 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3032 {
3033 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3034 "WDI API call before module is initialized - Fail request");
3035
Jeff Johnsone7245742012-09-05 17:12:55 -07003036 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003037 }
3038
3039 /*------------------------------------------------------------------------
3040 Fill in Event data and post to the Main FSM
3041 ------------------------------------------------------------------------*/
3042 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003043 wdiEventData.pEventData = pwdiPowerSaveCfg;
3044 wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg);
3045 wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003046 wdiEventData.pUserData = pUserData;
3047
3048 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3049
3050}/*WDI_SetPwrSaveCfgReq*/
3051
3052/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003053 @brief WDI_EnterImpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003054 request the device to get into IMPS power state. Upon
3055 the call of this API the WLAN DAL will send a HAL Enter
3056 IMPS request message to the lower RIVA sub-system if DAL
3057 is in state STARTED.
3058
3059 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003060 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003061
Jeff Johnsone7245742012-09-05 17:12:55 -07003062
3063 @param wdiEnterImpsRspCb: callback for passing back the
Jeff Johnson295189b2012-06-20 16:38:30 -07003064 response of the Enter IMPS operation received from the
3065 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003066
Jeff Johnson295189b2012-06-20 16:38:30 -07003067 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003068 callback
3069
Jeff Johnson295189b2012-06-20 16:38:30 -07003070 @see WDI_Start
3071 @return Result of the function call
3072*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003073WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003074WDI_EnterImpsReq
3075(
3076 WDI_EnterImpsRspCb wdiEnterImpsRspCb,
3077 void* pUserData
3078)
3079{
3080 WDI_EventInfoType wdiEventData;
3081 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3082
3083 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003084 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003085 ------------------------------------------------------------------------*/
3086 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3087 {
3088 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3089 "WDI API call before module is initialized - Fail request");
3090
Jeff Johnsone7245742012-09-05 17:12:55 -07003091 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003092 }
3093
3094 /*------------------------------------------------------------------------
3095 Fill in Event data and post to the Main FSM
3096 ------------------------------------------------------------------------*/
3097 wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003098 wdiEventData.pEventData = NULL;
3099 wdiEventData.uEventDataSize = 0;
3100 wdiEventData.pCBfnc = wdiEnterImpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003101 wdiEventData.pUserData = pUserData;
3102
3103 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3104
3105}/*WDI_EnterImpsReq*/
3106
3107/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003108 @brief WDI_ExitImpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003109 request the device to get out of IMPS power state. Upon
3110 the call of this API the WLAN DAL will send a HAL Exit
3111 IMPS request message to the lower RIVA sub-system if DAL
3112 is in state STARTED.
3113
3114 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003115 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003116
Jeff Johnson295189b2012-06-20 16:38:30 -07003117
Jeff Johnsone7245742012-09-05 17:12:55 -07003118
3119 @param wdiExitImpsRspCb: callback for passing back the response
Jeff Johnson295189b2012-06-20 16:38:30 -07003120 of the Exit IMPS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003121
Jeff Johnson295189b2012-06-20 16:38:30 -07003122 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003123 callback
3124
Jeff Johnson295189b2012-06-20 16:38:30 -07003125 @see WDI_Start
3126 @return Result of the function call
3127*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003128WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003129WDI_ExitImpsReq
3130(
3131 WDI_ExitImpsRspCb wdiExitImpsRspCb,
3132 void* pUserData
3133)
3134{
3135 WDI_EventInfoType wdiEventData;
3136 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3137
3138 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003139 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003140 ------------------------------------------------------------------------*/
3141 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3142 {
3143 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3144 "WDI API call before module is initialized - Fail request");
3145
Jeff Johnsone7245742012-09-05 17:12:55 -07003146 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003147 }
3148
3149 /*------------------------------------------------------------------------
3150 Fill in Event data and post to the Main FSM
3151 ------------------------------------------------------------------------*/
3152 wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003153 wdiEventData.pEventData = NULL;
3154 wdiEventData.uEventDataSize = 0;
3155 wdiEventData.pCBfnc = wdiExitImpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003156 wdiEventData.pUserData = pUserData;
3157
3158 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3159
3160}/*WDI_ExitImpsReq*/
3161
3162/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003163 @brief WDI_EnterBmpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003164 request the device to get into BMPS power state. Upon
3165 the call of this API the WLAN DAL will pack and send a
3166 HAL Enter BMPS request message to the lower RIVA
3167 sub-system if DAL is in state STARTED.
3168
3169 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003170 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003171
3172 WDI_PostAssocReq must have been called.
3173
Jeff Johnsone7245742012-09-05 17:12:55 -07003174 @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003175 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003176
Jeff Johnson295189b2012-06-20 16:38:30 -07003177 wdiEnterBmpsRspCb: callback for passing back the
3178 response of the Enter BMPS operation received from the
3179 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003180
Jeff Johnson295189b2012-06-20 16:38:30 -07003181 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003182 callback
3183
Jeff Johnson295189b2012-06-20 16:38:30 -07003184 @see WDI_PostAssocReq
3185 @return Result of the function call
3186*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003187WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003188WDI_EnterBmpsReq
3189(
3190 WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams,
3191 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb,
3192 void* pUserData
3193)
3194{
3195 WDI_EventInfoType wdiEventData;
3196 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3197
3198 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003199 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003200 ------------------------------------------------------------------------*/
3201 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3202 {
3203 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3204 "WDI API call before module is initialized - Fail request");
3205
Jeff Johnsone7245742012-09-05 17:12:55 -07003206 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003207 }
3208
3209 /*------------------------------------------------------------------------
3210 Fill in Event data and post to the Main FSM
3211 ------------------------------------------------------------------------*/
3212 wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003213 wdiEventData.pEventData = pwdiEnterBmpsReqParams;
3214 wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams);
3215 wdiEventData.pCBfnc = wdiEnterBmpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003216 wdiEventData.pUserData = pUserData;
3217
3218 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3219
3220}/*WDI_EnterBmpsReq*/
3221
3222/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003223 @brief WDI_ExitBmpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003224 request the device to get out of BMPS power state. Upon
3225 the call of this API the WLAN DAL will pack and send a
3226 HAL Exit BMPS request message to the lower RIVA
3227 sub-system if DAL is in state STARTED.
3228
3229 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003230 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003231
3232 WDI_PostAssocReq must have been called.
3233
Jeff Johnsone7245742012-09-05 17:12:55 -07003234 @param pwdiExitBmpsReqParams: the Exit BMPS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003235 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003236
Jeff Johnson295189b2012-06-20 16:38:30 -07003237 wdiExitBmpsRspCb: callback for passing back the response
3238 of the Exit BMPS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003239
Jeff Johnson295189b2012-06-20 16:38:30 -07003240 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003241 callback
3242
Jeff Johnson295189b2012-06-20 16:38:30 -07003243 @see WDI_PostAssocReq
3244 @return Result of the function call
3245*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003246WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003247WDI_ExitBmpsReq
3248(
3249 WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams,
3250 WDI_ExitBmpsRspCb wdiExitBmpsRspCb,
3251 void* pUserData
3252)
3253{
3254 WDI_EventInfoType wdiEventData;
3255 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3256
3257 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003258 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003259 ------------------------------------------------------------------------*/
3260 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3261 {
3262 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3263 "WDI API call before module is initialized - Fail request");
3264
Jeff Johnsone7245742012-09-05 17:12:55 -07003265 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003266 }
3267
3268 /*------------------------------------------------------------------------
3269 Fill in Event data and post to the Main FSM
3270 ------------------------------------------------------------------------*/
3271 wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003272 wdiEventData.pEventData = pwdiExitBmpsReqParams;
3273 wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams);
3274 wdiEventData.pCBfnc = wdiExitBmpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003275 wdiEventData.pUserData = pUserData;
3276
3277 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3278
3279}/*WDI_ExitBmpsReq*/
3280
3281/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003282 @brief WDI_EnterUapsdReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003283 request the device to get into UAPSD power state. Upon
3284 the call of this API the WLAN DAL will pack and send a
3285 HAL Enter UAPSD request message to the lower RIVA
3286 sub-system if DAL is in state STARTED.
3287
3288 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003289 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003290
3291 WDI_PostAssocReq must have been called.
3292 WDI_SetUapsdAcParamsReq must have been called.
Jeff Johnsone7245742012-09-05 17:12:55 -07003293
3294 @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003295 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003296
Jeff Johnson295189b2012-06-20 16:38:30 -07003297 wdiEnterUapsdRspCb: callback for passing back the
3298 response of the Enter UAPSD operation received from the
3299 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003300
Jeff Johnson295189b2012-06-20 16:38:30 -07003301 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003302 callback
3303
Jeff Johnson295189b2012-06-20 16:38:30 -07003304 @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq
3305 @return Result of the function call
3306*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003307WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003308WDI_EnterUapsdReq
3309(
3310 WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams,
3311 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb,
3312 void* pUserData
3313)
3314{
3315 WDI_EventInfoType wdiEventData;
3316 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3317
3318 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003319 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003320 ------------------------------------------------------------------------*/
3321 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3322 {
3323 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3324 "WDI API call before module is initialized - Fail request");
3325
Jeff Johnsone7245742012-09-05 17:12:55 -07003326 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003327 }
3328
3329 /*------------------------------------------------------------------------
3330 Fill in Event data and post to the Main FSM
3331 ------------------------------------------------------------------------*/
3332 wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003333 wdiEventData.pEventData = pwdiEnterUapsdReqParams;
3334 wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams);
3335 wdiEventData.pCBfnc = wdiEnterUapsdRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003336 wdiEventData.pUserData = pUserData;
3337
3338 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3339
3340}/*WDI_EnterUapsdReq*/
3341
3342/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003343 @brief WDI_ExitUapsdReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003344 request the device to get out of UAPSD power state. Upon
3345 the call of this API the WLAN DAL will send a HAL Exit
3346 UAPSD request message to the lower RIVA sub-system if
3347 DAL is in state STARTED.
3348
3349 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003350 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003351
3352 WDI_PostAssocReq must have been called.
3353
Jeff Johnsone7245742012-09-05 17:12:55 -07003354 @param wdiExitUapsdRspCb: callback for passing back the
Jeff Johnson295189b2012-06-20 16:38:30 -07003355 response of the Exit UAPSD operation received from the
3356 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003357
Jeff Johnson295189b2012-06-20 16:38:30 -07003358 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003359 callback
3360
Jeff Johnson295189b2012-06-20 16:38:30 -07003361 @see WDI_PostAssocReq
3362 @return Result of the function call
3363*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003364WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003365WDI_ExitUapsdReq
3366(
3367 WDI_ExitUapsdRspCb wdiExitUapsdRspCb,
3368 void* pUserData
3369)
3370{
3371 WDI_EventInfoType wdiEventData;
3372 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3373
3374 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003375 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003376 ------------------------------------------------------------------------*/
3377 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3378 {
3379 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3380 "WDI API call before module is initialized - Fail request");
3381
Jeff Johnsone7245742012-09-05 17:12:55 -07003382 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003383 }
3384
3385 /*------------------------------------------------------------------------
3386 Fill in Event data and post to the Main FSM
3387 ------------------------------------------------------------------------*/
3388 wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003389 wdiEventData.pEventData = NULL;
3390 wdiEventData.uEventDataSize = 0;
3391 wdiEventData.pCBfnc = wdiExitUapsdRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003392 wdiEventData.pUserData = pUserData;
3393
3394 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3395
3396}/*WDI_ExitUapsdReq*/
3397
3398/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003399 @brief WDI_UpdateUapsdParamsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003400 MAC wants to set the UAPSD related configurations
3401 of an associated STA (while acting as an AP) to the WLAN
3402 Device. Upon the call of this API the WLAN DAL will pack
3403 and send a HAL Update UAPSD params request message to
3404 the lower RIVA sub-system if DAL is in state STARTED.
3405
3406 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003407 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003408
3409 WDI_ConfigBSSReq must have been called.
3410
Jeff Johnsone7245742012-09-05 17:12:55 -07003411 @param pwdiUpdateUapsdReqParams: the UAPSD parameters
Jeff Johnson295189b2012-06-20 16:38:30 -07003412 as specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003413
Jeff Johnson295189b2012-06-20 16:38:30 -07003414 wdiUpdateUapsdParamsCb: callback for passing back the
3415 response of the update UAPSD params operation received
3416 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003417
Jeff Johnson295189b2012-06-20 16:38:30 -07003418 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003419 callback
3420
Jeff Johnson295189b2012-06-20 16:38:30 -07003421 @see WDI_ConfigBSSReq
3422 @return Result of the function call
3423*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003424WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003425WDI_UpdateUapsdParamsReq
3426(
3427 WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams,
3428 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb,
3429 void* pUserData
3430)
3431{
3432 WDI_EventInfoType wdiEventData;
3433 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3434
3435 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003436 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003437 ------------------------------------------------------------------------*/
3438 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3439 {
3440 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3441 "WDI API call before module is initialized - Fail request");
3442
Jeff Johnsone7245742012-09-05 17:12:55 -07003443 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003444 }
3445
3446 /*------------------------------------------------------------------------
3447 Fill in Event data and post to the Main FSM
3448 ------------------------------------------------------------------------*/
3449 wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003450 wdiEventData.pEventData = pwdiUpdateUapsdReqParams;
3451 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams);;
3452 wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003453 wdiEventData.pUserData = pUserData;
3454
3455 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3456
3457}/*WDI_UpdateUapsdParamsReq*/
3458
3459/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003460 @brief WDI_SetUapsdAcParamsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003461 MAC wants to set the UAPSD related configurations before
3462 requesting for enter UAPSD power state to the WLAN
3463 Device. Upon the call of this API the WLAN DAL will pack
3464 and send a HAL Set UAPSD params request message to
3465 the lower RIVA sub-system if DAL is in state STARTED.
3466
3467 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003468 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003469
3470 WDI_PostAssocReq must have been called.
3471
3472 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3473 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003474
Jeff Johnson295189b2012-06-20 16:38:30 -07003475 wdiSetUapsdAcParamsCb: callback for passing back the
3476 response of the set UAPSD params operation received from
3477 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003478
Jeff Johnson295189b2012-06-20 16:38:30 -07003479 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003480 callback
3481
Jeff Johnson295189b2012-06-20 16:38:30 -07003482 @see WDI_PostAssocReq
3483 @return Result of the function call
3484*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003485WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003486WDI_SetUapsdAcParamsReq
3487(
3488 WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo,
3489 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb,
3490 void* pUserData
3491)
3492{
3493 WDI_EventInfoType wdiEventData;
3494 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3495
3496 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003497 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003498 ------------------------------------------------------------------------*/
3499 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3500 {
3501 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3502 "WDI API call before module is initialized - Fail request");
3503
Jeff Johnsone7245742012-09-05 17:12:55 -07003504 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003505 }
3506
3507 /*------------------------------------------------------------------------
3508 Fill in Event data and post to the Main FSM
3509 ------------------------------------------------------------------------*/
3510 wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003511 wdiEventData.pEventData = pwdiUapsdInfo;
3512 wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo);
3513 wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003514 wdiEventData.pUserData = pUserData;
3515
3516 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3517
3518}/*WDI_SetUapsdAcParamsReq*/
3519
3520/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003521 @brief WDI_ConfigureRxpFilterReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003522 MAC wants to set/reset the RXP filters for received pkts
3523 (MC, BC etc.). Upon the call of this API the WLAN DAL will pack
3524 and send a HAL configure RXP filter request message to
3525 the lower RIVA sub-system.
3526
3527 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003528 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003529
Jeff Johnsone7245742012-09-05 17:12:55 -07003530
3531 @param pwdiConfigureRxpFilterReqParams: the RXP
Jeff Johnson295189b2012-06-20 16:38:30 -07003532 filter as specified by the Device
3533 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003534
Jeff Johnson295189b2012-06-20 16:38:30 -07003535 wdiConfigureRxpFilterCb: callback for passing back the
3536 response of the configure RXP filter operation received
3537 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003538
Jeff Johnson295189b2012-06-20 16:38:30 -07003539 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003540 callback
3541
Jeff Johnson295189b2012-06-20 16:38:30 -07003542 @return Result of the function call
3543*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003544WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003545WDI_ConfigureRxpFilterReq
3546(
3547 WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams,
3548 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb,
3549 void* pUserData
3550)
3551{
3552 WDI_EventInfoType wdiEventData;
3553 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3554
3555 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003556 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003557 ------------------------------------------------------------------------*/
3558 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3559 {
3560 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3561 "WDI API call before module is initialized - Fail request");
3562
Jeff Johnsone7245742012-09-05 17:12:55 -07003563 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003564 }
3565
3566 /*------------------------------------------------------------------------
3567 Fill in Event data and post to the Main FSM
3568 ------------------------------------------------------------------------*/
3569 wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003570 wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams;
3571 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams);
3572 wdiEventData.pCBfnc = wdiConfigureRxpFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003573 wdiEventData.pUserData = pUserData;
3574
3575 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3576}/*WDI_ConfigureRxpFilterReq*/
3577
3578/**
3579 @brief WDI_SetBeaconFilterReq will be called when the upper MAC
3580 wants to set the beacon filters while in power save.
3581 Upon the call of this API the WLAN DAL will pack and
3582 send a Beacon filter request message to the
3583 lower RIVA sub-system.
3584
3585 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003586 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003587
Jeff Johnsone7245742012-09-05 17:12:55 -07003588
3589 @param pwdiBeaconFilterReqParams: the beacon
Jeff Johnson295189b2012-06-20 16:38:30 -07003590 filter as specified by the Device
3591 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003592
Jeff Johnson295189b2012-06-20 16:38:30 -07003593 wdiBeaconFilterCb: callback for passing back the
3594 response of the set beacon filter operation received
3595 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003596
Jeff Johnson295189b2012-06-20 16:38:30 -07003597 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003598 callback
3599
Jeff Johnson295189b2012-06-20 16:38:30 -07003600 @return Result of the function call
3601*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003602WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003603WDI_SetBeaconFilterReq
3604(
3605 WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3606 WDI_SetBeaconFilterCb wdiBeaconFilterCb,
3607 void* pUserData
3608)
3609{
3610 WDI_EventInfoType wdiEventData;
3611 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3612
3613 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003614 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003615 ------------------------------------------------------------------------*/
3616 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3617 {
3618 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3619 "WDI API call before module is initialized - Fail request");
3620
Jeff Johnsone7245742012-09-05 17:12:55 -07003621 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003622 }
3623
3624 /*------------------------------------------------------------------------
3625 Fill in Event data and post to the Main FSM
3626 ------------------------------------------------------------------------*/
3627 wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003628 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3629 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3630 wdiEventData.pCBfnc = wdiBeaconFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003631 wdiEventData.pUserData = pUserData;
3632
3633 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3634}/*WDI_SetBeaconFilterReq*/
3635
3636/**
3637 @brief WDI_RemBeaconFilterReq will be called when the upper MAC
3638 wants to remove the beacon filter for particular IE
3639 while in power save. Upon the call of this API the WLAN
3640 DAL will pack and send a remove Beacon filter request
3641 message to the lower RIVA sub-system.
3642
3643 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003644 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003645
Jeff Johnsone7245742012-09-05 17:12:55 -07003646
3647 @param pwdiBeaconFilterReqParams: the beacon
Jeff Johnson295189b2012-06-20 16:38:30 -07003648 filter as specified by the Device
3649 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003650
Jeff Johnson295189b2012-06-20 16:38:30 -07003651 wdiBeaconFilterCb: callback for passing back the
3652 response of the remove beacon filter operation received
3653 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003654
Jeff Johnson295189b2012-06-20 16:38:30 -07003655 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003656 callback
3657
Jeff Johnson295189b2012-06-20 16:38:30 -07003658 @return Result of the function call
3659*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003660WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003661WDI_RemBeaconFilterReq
3662(
3663 WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3664 WDI_RemBeaconFilterCb wdiBeaconFilterCb,
3665 void* pUserData
3666)
3667{
3668 WDI_EventInfoType wdiEventData;
3669 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3670
3671 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003672 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003673 ------------------------------------------------------------------------*/
3674 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3675 {
3676 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3677 "WDI API call before module is initialized - Fail request");
3678
Jeff Johnsone7245742012-09-05 17:12:55 -07003679 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003680 }
3681
3682 /*------------------------------------------------------------------------
3683 Fill in Event data and post to the Main FSM
3684 ------------------------------------------------------------------------*/
3685 wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003686 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3687 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3688 wdiEventData.pCBfnc = wdiBeaconFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003689 wdiEventData.pUserData = pUserData;
3690
3691 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3692}/*WDI_RemBeaconFilterReq*/
3693
3694/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003695 @brief WDI_SetRSSIThresholdsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003696 MAC wants to set the RSSI thresholds related
3697 configurations while in power save. Upon the call of
3698 this API the WLAN DAL will pack and send a HAL Set RSSI
3699 thresholds request message to the lower RIVA
3700 sub-system if DAL is in state STARTED.
3701
3702 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003703 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003704
3705 WDI_PostAssocReq must have been called.
3706
3707 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3708 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003709
Jeff Johnson295189b2012-06-20 16:38:30 -07003710 wdiSetUapsdAcParamsCb: callback for passing back the
3711 response of the set UAPSD params operation received from
3712 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003713
Jeff Johnson295189b2012-06-20 16:38:30 -07003714 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003715 callback
3716
Jeff Johnson295189b2012-06-20 16:38:30 -07003717 @see WDI_PostAssocReq
3718 @return Result of the function call
3719*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003720WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003721WDI_SetRSSIThresholdsReq
3722(
3723 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams,
3724 WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb,
3725 void* pUserData
3726)
3727{
3728 WDI_EventInfoType wdiEventData;
3729 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3730
3731 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003732 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003733 ------------------------------------------------------------------------*/
3734 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3735 {
3736 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3737 "WDI API call before module is initialized - Fail request");
3738
Jeff Johnsone7245742012-09-05 17:12:55 -07003739 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003740 }
3741
3742 /*------------------------------------------------------------------------
3743 Fill in Event data and post to the Main FSM
3744 ------------------------------------------------------------------------*/
3745 wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003746 wdiEventData.pEventData = pwdiRSSIThresholdsParams;
3747 wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams);;
3748 wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003749 wdiEventData.pUserData = pUserData;
3750
3751 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3752}/* WDI_SetRSSIThresholdsReq*/
3753
3754/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003755 @brief WDI_HostOffloadReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003756 wants to set the filter to minimize unnecessary host
3757 wakeup due to broadcast traffic while in power save.
3758 Upon the call of this API the WLAN DAL will pack and
3759 send a HAL host offload request message to the
3760 lower RIVA sub-system if DAL is in state STARTED.
3761
3762 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003763 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003764
3765 WDI_PostAssocReq must have been called.
3766
Jeff Johnsone7245742012-09-05 17:12:55 -07003767 @param pwdiHostOffloadParams: the host offload as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07003768 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003769
Jeff Johnson295189b2012-06-20 16:38:30 -07003770 wdiHostOffloadCb: callback for passing back the response
3771 of the host offload operation received from the
3772 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003773
Jeff Johnson295189b2012-06-20 16:38:30 -07003774 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003775 callback
3776
Jeff Johnson295189b2012-06-20 16:38:30 -07003777 @see WDI_PostAssocReq
3778 @return Result of the function call
3779*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003780WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003781WDI_HostOffloadReq
3782(
3783 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams,
3784 WDI_HostOffloadCb wdiHostOffloadCb,
3785 void* pUserData
3786)
3787{
3788 WDI_EventInfoType wdiEventData;
3789 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3790
3791 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003792 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003793 ------------------------------------------------------------------------*/
3794 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3795 {
3796 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3797 "WDI API call before module is initialized - Fail request");
3798
Jeff Johnsone7245742012-09-05 17:12:55 -07003799 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003800 }
3801
3802 /*------------------------------------------------------------------------
3803 Fill in Event data and post to the Main FSM
3804 ------------------------------------------------------------------------*/
3805 wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003806 wdiEventData.pEventData = pwdiHostOffloadParams;
3807 wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams);;
3808 wdiEventData.pCBfnc = wdiHostOffloadCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003809 wdiEventData.pUserData = pUserData;
3810
3811 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3812}/*WDI_HostOffloadReq*/
3813
3814/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003815 @brief WDI_KeepAliveReq will be called when the upper MAC
3816 wants to set the filter to send NULL or unsolicited ARP responses
Jeff Johnson295189b2012-06-20 16:38:30 -07003817 and minimize unnecessary host wakeups due to while in power save.
3818 Upon the call of this API the WLAN DAL will pack and
3819 send a HAL Keep Alive request message to the
3820 lower RIVA sub-system if DAL is in state STARTED.
3821
3822 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003823 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003824
3825 WDI_PostAssocReq must have been called.
3826
Jeff Johnsone7245742012-09-05 17:12:55 -07003827 @param pwdiKeepAliveParams: the Keep Alive as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07003828 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003829
Jeff Johnson295189b2012-06-20 16:38:30 -07003830 wdiKeepAliveCb: callback for passing back the response
3831 of the Keep Alive operation received from the
3832 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003833
Jeff Johnson295189b2012-06-20 16:38:30 -07003834 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003835 callback
3836
Jeff Johnson295189b2012-06-20 16:38:30 -07003837 @see WDI_PostAssocReq
3838 @return Result of the function call
3839*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003840WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003841WDI_KeepAliveReq
3842(
3843 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams,
3844 WDI_KeepAliveCb wdiKeepAliveCb,
3845 void* pUserData
3846)
3847{
3848 WDI_EventInfoType wdiEventData;
3849 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3850
3851 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003852 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003853 ------------------------------------------------------------------------*/
3854 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3855 {
3856 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3857 "WDI_KeepAliveReq: WDI API call before module "
3858 "is initialized - Fail request");
3859
Jeff Johnsone7245742012-09-05 17:12:55 -07003860 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003861 }
3862
3863 /*------------------------------------------------------------------------
3864 Fill in Event data and post to the Main FSM
3865 ------------------------------------------------------------------------*/
3866 wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003867 wdiEventData.pEventData = pwdiKeepAliveParams;
3868 wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams);
3869 wdiEventData.pCBfnc = wdiKeepAliveCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003870 wdiEventData.pUserData = pUserData;
3871
3872 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3873}/*WDI_KeepAliveReq*/
3874
3875/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003876 @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003877 wants to set the Wowl Bcast ptrn to minimize unnecessary
3878 host wakeup due to broadcast traffic while in power
3879 save. Upon the call of this API the WLAN DAL will pack
3880 and send a HAL Wowl Bcast ptrn request message to the
3881 lower RIVA sub-system if DAL is in state STARTED.
3882
3883 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003884 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003885
3886 WDI_PostAssocReq must have been called.
3887
Jeff Johnsone7245742012-09-05 17:12:55 -07003888 @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as
Jeff Johnson295189b2012-06-20 16:38:30 -07003889 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003890
Jeff Johnson295189b2012-06-20 16:38:30 -07003891 wdiWowlAddBcPtrnCb: callback for passing back the
3892 response of the add Wowl bcast ptrn operation received
3893 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003894
Jeff Johnson295189b2012-06-20 16:38:30 -07003895 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003896 callback
3897
Jeff Johnson295189b2012-06-20 16:38:30 -07003898 @see WDI_PostAssocReq
3899 @return Result of the function call
3900*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003901WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003902WDI_WowlAddBcPtrnReq
3903(
3904 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams,
3905 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb,
3906 void* pUserData
3907)
3908{
3909 WDI_EventInfoType wdiEventData;
3910 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3911
3912 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003913 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003914 ------------------------------------------------------------------------*/
3915 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3916 {
3917 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3918 "WDI API call before module is initialized - Fail request");
3919
Jeff Johnsone7245742012-09-05 17:12:55 -07003920 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003921 }
3922
3923 /*------------------------------------------------------------------------
3924 Fill in Event data and post to the Main FSM
3925 ------------------------------------------------------------------------*/
3926 wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003927 wdiEventData.pEventData = pwdiWowlAddBcPtrnParams;
3928 wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams);;
3929 wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003930 wdiEventData.pUserData = pUserData;
3931
3932 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3933}/*WDI_WowlAddBcPtrnReq*/
3934
3935/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003936 @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003937 wants to clear the Wowl Bcast ptrn. Upon the call of
3938 this API the WLAN DAL will pack and send a HAL delete
3939 Wowl Bcast ptrn request message to the lower RIVA
3940 sub-system if DAL is in state STARTED.
3941
3942 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003943 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003944
3945 WDI_WowlAddBcPtrnReq must have been called.
3946
Jeff Johnsone7245742012-09-05 17:12:55 -07003947 @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as
Jeff Johnson295189b2012-06-20 16:38:30 -07003948 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003949
Jeff Johnson295189b2012-06-20 16:38:30 -07003950 wdiWowlDelBcPtrnCb: callback for passing back the
3951 response of the del Wowl bcast ptrn operation received
3952 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003953
Jeff Johnson295189b2012-06-20 16:38:30 -07003954 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003955 callback
3956
Jeff Johnson295189b2012-06-20 16:38:30 -07003957 @see WDI_WowlAddBcPtrnReq
3958 @return Result of the function call
3959*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003960WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003961WDI_WowlDelBcPtrnReq
3962(
3963 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams,
3964 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb,
3965 void* pUserData
3966)
3967{
3968 WDI_EventInfoType wdiEventData;
3969 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3970
3971 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003972 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003973 ------------------------------------------------------------------------*/
3974 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3975 {
3976 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3977 "WDI API call before module is initialized - Fail request");
3978
Jeff Johnsone7245742012-09-05 17:12:55 -07003979 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003980 }
3981
3982 /*------------------------------------------------------------------------
3983 Fill in Event data and post to the Main FSM
3984 ------------------------------------------------------------------------*/
3985 wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003986 wdiEventData.pEventData = pwdiWowlDelBcPtrnParams;
3987 wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams);;
3988 wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003989 wdiEventData.pUserData = pUserData;
3990
3991 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3992}/*WDI_WowlDelBcPtrnReq*/
3993
3994/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003995 @brief WDI_WowlEnterReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003996 wants to enter the Wowl state to minimize unnecessary
3997 host wakeup while in power save. Upon the call of this
3998 API the WLAN DAL will pack and send a HAL Wowl enter
3999 request message to the lower RIVA sub-system if DAL is
4000 in state STARTED.
4001
4002 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004003 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004004
4005 WDI_PostAssocReq must have been called.
4006
Jeff Johnsone7245742012-09-05 17:12:55 -07004007 @param pwdiWowlEnterReqParams: the Wowl enter info as
Jeff Johnson295189b2012-06-20 16:38:30 -07004008 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004009
Jeff Johnson295189b2012-06-20 16:38:30 -07004010 wdiWowlEnterReqCb: callback for passing back the
4011 response of the enter Wowl operation received from the
4012 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004013
Jeff Johnson295189b2012-06-20 16:38:30 -07004014 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004015 callback
4016
Jeff Johnson295189b2012-06-20 16:38:30 -07004017 @see WDI_PostAssocReq
4018 @return Result of the function call
4019*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004020WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004021WDI_WowlEnterReq
4022(
4023 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams,
4024 WDI_WowlEnterReqCb wdiWowlEnterCb,
4025 void* pUserData
4026)
4027{
4028 WDI_EventInfoType wdiEventData;
4029 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4030
4031 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004032 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004033 ------------------------------------------------------------------------*/
4034 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4035 {
4036 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4037 "WDI API call before module is initialized - Fail request");
4038
Jeff Johnsone7245742012-09-05 17:12:55 -07004039 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004040 }
4041
4042 /*------------------------------------------------------------------------
4043 Fill in Event data and post to the Main FSM
4044 ------------------------------------------------------------------------*/
4045 wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004046 wdiEventData.pEventData = pwdiWowlEnterParams;
4047 wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams);;
4048 wdiEventData.pCBfnc = wdiWowlEnterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004049 wdiEventData.pUserData = pUserData;
4050
4051 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4052}/*WDI_WowlEnterReq*/
4053
4054/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004055 @brief WDI_WowlExitReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004056 wants to exit the Wowl state. Upon the call of this API
4057 the WLAN DAL will pack and send a HAL Wowl exit request
4058 message to the lower RIVA sub-system if DAL is in state
4059 STARTED.
4060
4061 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004062 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004063
4064 WDI_WowlEnterReq must have been called.
4065
Jeff Johnsone7245742012-09-05 17:12:55 -07004066 @param pwdiWowlExitReqParams: the Wowl exit info as
Jeff Johnson295189b2012-06-20 16:38:30 -07004067 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004068
Jeff Johnson295189b2012-06-20 16:38:30 -07004069 wdiWowlExitReqCb: callback for passing back the response
4070 of the exit Wowl operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004071
Jeff Johnson295189b2012-06-20 16:38:30 -07004072 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004073 callback
4074
Jeff Johnson295189b2012-06-20 16:38:30 -07004075 @see WDI_WowlEnterReq
4076 @return Result of the function call
4077*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004078WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004079WDI_WowlExitReq
4080(
4081 WDI_WowlExitReqCb wdiWowlExitCb,
4082 void* pUserData
4083)
4084{
4085 WDI_EventInfoType wdiEventData;
4086 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4087
4088 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004089 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004090 ------------------------------------------------------------------------*/
4091 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4092 {
4093 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4094 "WDI API call before module is initialized - Fail request");
4095
Jeff Johnsone7245742012-09-05 17:12:55 -07004096 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004097 }
4098
4099 /*------------------------------------------------------------------------
4100 Fill in Event data and post to the Main FSM
4101 ------------------------------------------------------------------------*/
4102 wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004103 wdiEventData.pEventData = NULL;
4104 wdiEventData.uEventDataSize = 0;
4105 wdiEventData.pCBfnc = wdiWowlExitCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004106 wdiEventData.pUserData = pUserData;
4107
4108 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4109}/*WDI_WowlExitReq*/
4110
4111/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004112 @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when
Jeff Johnson295189b2012-06-20 16:38:30 -07004113 the upper MAC wants to dynamically adjusts the listen
4114 interval based on the WLAN/MSM activity. Upon the call
4115 of this API the WLAN DAL will pack and send a HAL
4116 configure Apps Cpu Wakeup State request message to the
4117 lower RIVA sub-system.
4118
4119 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004120 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004121
Jeff Johnsone7245742012-09-05 17:12:55 -07004122
4123 @param pwdiConfigureAppsCpuWakeupStateReqParams: the
Jeff Johnson295189b2012-06-20 16:38:30 -07004124 Apps Cpu Wakeup State as specified by the
4125 Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004126
Jeff Johnson295189b2012-06-20 16:38:30 -07004127 wdiConfigureAppsCpuWakeupStateCb: callback for passing
4128 back the response of the configure Apps Cpu Wakeup State
4129 operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004130
Jeff Johnson295189b2012-06-20 16:38:30 -07004131 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004132 callback
4133
Jeff Johnson295189b2012-06-20 16:38:30 -07004134 @return Result of the function call
4135*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004136WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004137WDI_ConfigureAppsCpuWakeupStateReq
4138(
4139 WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams,
4140 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb,
4141 void* pUserData
4142)
4143{
4144 WDI_EventInfoType wdiEventData;
4145 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4146
4147 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004148 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004149 ------------------------------------------------------------------------*/
4150 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4151 {
4152 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4153 "WDI API call before module is initialized - Fail request");
4154
Jeff Johnsone7245742012-09-05 17:12:55 -07004155 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004156 }
4157
4158 /*------------------------------------------------------------------------
4159 Fill in Event data and post to the Main FSM
4160 ------------------------------------------------------------------------*/
4161 wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004162 wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams;
4163 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams);
4164 wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004165 wdiEventData.pUserData = pUserData;
4166
4167 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4168}/*WDI_ConfigureAppsCpuWakeupStateReq*/
4169/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004170 @brief WDI_FlushAcReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004171 to to perform a flush operation on a given AC. Upon the
4172 call of this API the WLAN DAL will pack and send a HAL
4173 Flush AC request message to the lower RIVA sub-system if
4174 DAL is in state STARTED.
4175
4176 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004177 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004178
4179 WDI_AddBAReq must have been called.
4180
Jeff Johnsone7245742012-09-05 17:12:55 -07004181 @param pwdiFlushAcReqParams: the Flush AC parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004182 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004183
Jeff Johnson295189b2012-06-20 16:38:30 -07004184 wdiFlushAcRspCb: callback for passing back the response
4185 of the Flush AC operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004186
Jeff Johnson295189b2012-06-20 16:38:30 -07004187 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004188 callback
4189
Jeff Johnson295189b2012-06-20 16:38:30 -07004190 @see WDI_AddBAReq
4191 @return Result of the function call
4192*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004193WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004194WDI_FlushAcReq
4195(
4196 WDI_FlushAcReqParamsType* pwdiFlushAcReqParams,
4197 WDI_FlushAcRspCb wdiFlushAcRspCb,
4198 void* pUserData
4199)
4200{
4201 WDI_EventInfoType wdiEventData;
4202 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4203
4204 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004205 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004206 ------------------------------------------------------------------------*/
4207 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4208 {
4209 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4210 "WDI API call before module is initialized - Fail request");
4211
Jeff Johnsone7245742012-09-05 17:12:55 -07004212 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004213 }
4214
4215 /*------------------------------------------------------------------------
4216 Fill in Event data and post to the Main FSM
4217 ------------------------------------------------------------------------*/
4218 wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004219 wdiEventData.pEventData = pwdiFlushAcReqParams;
4220 wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams);
4221 wdiEventData.pCBfnc = wdiFlushAcRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004222 wdiEventData.pUserData = pUserData;
4223
4224 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4225
4226}/*WDI_FlushAcReq*/
4227
4228/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004229 @brief WDI_BtAmpEventReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004230 wants to notify the lower mac on a BT AMP event. This is
4231 to inform BTC-SLM that some BT AMP event occurred. Upon
4232 the call of this API the WLAN DAL will pack and send a
4233 HAL BT AMP event request message to the lower RIVA
4234 sub-system if DAL is in state STARTED.
4235
4236 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004237 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004238
Jeff Johnsone7245742012-09-05 17:12:55 -07004239
4240 @param wdiBtAmpEventReqParams: the BT AMP event parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004241 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004242
Jeff Johnson295189b2012-06-20 16:38:30 -07004243 wdiBtAmpEventRspCb: callback for passing back the
4244 response of the BT AMP event operation received from the
4245 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004246
Jeff Johnson295189b2012-06-20 16:38:30 -07004247 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004248 callback
4249
Jeff Johnson295189b2012-06-20 16:38:30 -07004250 @return Result of the function call
4251*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004252WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004253WDI_BtAmpEventReq
4254(
4255 WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams,
4256 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb,
4257 void* pUserData
4258)
4259{
4260 WDI_EventInfoType wdiEventData;
4261 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4262
4263 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004264 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004265 ------------------------------------------------------------------------*/
4266 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4267 {
4268 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4269 "WDI API call before module is initialized - Fail request");
4270
Jeff Johnsone7245742012-09-05 17:12:55 -07004271 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004272 }
4273
4274 /*------------------------------------------------------------------------
4275 Fill in Event data and post to the Main FSM
4276 ------------------------------------------------------------------------*/
4277 wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004278 wdiEventData.pEventData = pwdiBtAmpEventReqParams;
4279 wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams);
4280 wdiEventData.pCBfnc = wdiBtAmpEventRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004281 wdiEventData.pUserData = pUserData;
4282
4283 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4284
4285}/*WDI_BtAmpEventReq*/
4286
Jeff Johnsone7245742012-09-05 17:12:55 -07004287#ifdef FEATURE_OEM_DATA_SUPPORT
4288/**
4289 @brief WDI_Start Oem Data Req will be called when the upper MAC
4290 wants to notify the lower mac on a oem data Req event.Upon
4291 the call of this API the WLAN DAL will pack and send a
4292 HAL OEM Data Req event request message to the lower RIVA
4293 sub-system if DAL is in state STARTED.
4294
4295 In state BUSY this request will be queued. Request won't
4296 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004297
4298
Jeff Johnsone7245742012-09-05 17:12:55 -07004299
4300 @param pwdiOemDataReqParams: the Oem Data Req as
4301 specified by the Device Interface
4302
4303 wdiStartOemDataRspCb: callback for passing back the
4304 response of the Oem Data Req received from the
4305 device
4306
4307 pUserData: user data will be passed back with the
4308 callback
4309
4310 @return Result of the function call
4311*/
4312WDI_Status
4313WDI_StartOemDataReq
4314(
4315 WDI_oemDataReqParamsType* pwdiOemDataReqParams,
4316 WDI_oemDataRspCb wdiOemDataRspCb,
4317 void* pUserData
4318)
4319{
4320 WDI_EventInfoType wdiEventData;
4321 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4322
4323 /*------------------------------------------------------------------------
4324 Sanity Check
4325 ------------------------------------------------------------------------*/
4326 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4327 {
4328 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4329 "WDI API call before module is initialized - Fail request");
4330
4331 return WDI_STATUS_E_NOT_ALLOWED;
4332 }
4333
4334 /*------------------------------------------------------------------------
4335 Fill in Event data and post to the Main FSM
4336 ------------------------------------------------------------------------*/
4337 wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ;
4338 wdiEventData.pEventData = pwdiOemDataReqParams;
4339 wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams);
4340 wdiEventData.pCBfnc = wdiOemDataRspCb;
4341 wdiEventData.pUserData = pUserData;
4342
4343 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4344
4345
4346}
4347
4348#endif
4349
4350
4351/*========================================================================
4352
Jeff Johnson295189b2012-06-20 16:38:30 -07004353 CONTROL APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07004354
Jeff Johnson295189b2012-06-20 16:38:30 -07004355==========================================================================*/
4356/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004357 @brief WDI_SwitchChReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004358 the WLAN HW to change the current channel of operation.
4359 Upon the call of this API the WLAN DAL will pack and
4360 send a HAL Start request message to the lower RIVA
4361 sub-system if DAL is in state STARTED.
4362
4363 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004364 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004365
4366 WDI_Start must have been called.
4367
Jeff Johnsone7245742012-09-05 17:12:55 -07004368 @param wdiSwitchChReqParams: the switch ch parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004369 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004370
Jeff Johnson295189b2012-06-20 16:38:30 -07004371 wdiSwitchChRspCb: callback for passing back the response
4372 of the switch ch operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004373
Jeff Johnson295189b2012-06-20 16:38:30 -07004374 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004375 callback
4376
Jeff Johnson295189b2012-06-20 16:38:30 -07004377 @see WDI_Start
4378 @return Result of the function call
4379*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004380WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004381WDI_SwitchChReq
4382(
4383 WDI_SwitchChReqParamsType* pwdiSwitchChReqParams,
4384 WDI_SwitchChRspCb wdiSwitchChRspCb,
4385 void* pUserData
4386)
4387{
4388 WDI_EventInfoType wdiEventData;
4389 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4390
4391 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004392 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004393 ------------------------------------------------------------------------*/
4394 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4395 {
4396 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4397 "WDI API call before module is initialized - Fail request");
4398
Jeff Johnsone7245742012-09-05 17:12:55 -07004399 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004400 }
4401
4402 /*------------------------------------------------------------------------
4403 Fill in Event data and post to the Main FSM
4404 ------------------------------------------------------------------------*/
4405 wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004406 wdiEventData.pEventData = pwdiSwitchChReqParams;
4407 wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams);
4408 wdiEventData.pCBfnc = wdiSwitchChRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004409 wdiEventData.pUserData = pUserData;
4410
4411 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4412
4413}/*WDI_SwitchChReq*/
4414
4415
4416/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004417 @brief WDI_ConfigSTAReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004418 wishes to add or update a STA in HW. Upon the call of
4419 this API the WLAN DAL will pack and send a HAL Start
4420 message request message to the lower RIVA sub-system if
4421 DAL is in state STARTED.
4422
4423 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004424 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004425
4426 WDI_Start must have been called.
4427
Jeff Johnsone7245742012-09-05 17:12:55 -07004428 @param wdiConfigSTAReqParams: the config STA parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004429 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004430
Jeff Johnson295189b2012-06-20 16:38:30 -07004431 wdiConfigSTARspCb: callback for passing back the
4432 response of the config STA operation received from the
4433 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004434
Jeff Johnson295189b2012-06-20 16:38:30 -07004435 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004436 callback
4437
Jeff Johnson295189b2012-06-20 16:38:30 -07004438 @see WDI_Start
4439 @return Result of the function call
4440*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004441WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004442WDI_ConfigSTAReq
4443(
4444 WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams,
4445 WDI_ConfigSTARspCb wdiConfigSTARspCb,
4446 void* pUserData
4447)
4448{
4449 WDI_EventInfoType wdiEventData;
4450 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4451
4452 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004453 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004454 ------------------------------------------------------------------------*/
4455 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4456 {
4457 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4458 "WDI API call before module is initialized - Fail request");
4459
Jeff Johnsone7245742012-09-05 17:12:55 -07004460 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004461 }
4462
4463 /*------------------------------------------------------------------------
4464 Fill in Event data and post to the Main FSM
4465 ------------------------------------------------------------------------*/
4466 wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004467 wdiEventData.pEventData = pwdiConfigSTAReqParams;
4468 wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams);
4469 wdiEventData.pCBfnc = wdiConfigSTARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004470 wdiEventData.pUserData = pUserData;
4471
4472 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4473
4474}/*WDI_ConfigSTAReq*/
4475
4476/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004477 @brief WDI_SetLinkStateReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004478 wants to change the state of an ongoing link. Upon the
4479 call of this API the WLAN DAL will pack and send a HAL
4480 Start message request message to the lower RIVA
4481 sub-system if DAL is in state STARTED.
4482
4483 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004484 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004485
4486 WDI_JoinStartReq must have been called.
4487
Jeff Johnsone7245742012-09-05 17:12:55 -07004488 @param wdiSetLinkStateReqParams: the set link state parameters
Jeff Johnson295189b2012-06-20 16:38:30 -07004489 as specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004490
Jeff Johnson295189b2012-06-20 16:38:30 -07004491 wdiSetLinkStateRspCb: callback for passing back the
4492 response of the set link state operation received from
4493 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004494
Jeff Johnson295189b2012-06-20 16:38:30 -07004495 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004496 callback
4497
Jeff Johnson295189b2012-06-20 16:38:30 -07004498 @see WDI_JoinStartReq
4499 @return Result of the function call
4500*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004501WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004502WDI_SetLinkStateReq
4503(
4504 WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams,
4505 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb,
4506 void* pUserData
4507)
4508{
4509 WDI_EventInfoType wdiEventData;
4510 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4511
4512 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004513 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004514 ------------------------------------------------------------------------*/
4515 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4516 {
4517 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4518 "WDI API call before module is initialized - Fail request");
4519
Jeff Johnsone7245742012-09-05 17:12:55 -07004520 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004521 }
4522
4523 /*------------------------------------------------------------------------
4524 Fill in Event data and post to the Main FSM
4525 ------------------------------------------------------------------------*/
4526 wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004527 wdiEventData.pEventData = pwdiSetLinkStateReqParams;
4528 wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams);
4529 wdiEventData.pCBfnc = wdiSetLinkStateRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004530 wdiEventData.pUserData = pUserData;
4531
4532 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4533
4534}/*WDI_SetLinkStateReq*/
4535
4536
4537/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004538 @brief WDI_GetStatsReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004539 to get statistics (MIB counters) from the device. Upon
4540 the call of this API the WLAN DAL will pack and send a
4541 HAL Start request message to the lower RIVA sub-system
4542 if DAL is in state STARTED.
4543
4544 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004545 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004546
4547 WDI_Start must have been called.
4548
Jeff Johnsone7245742012-09-05 17:12:55 -07004549 @param wdiGetStatsReqParams: the stats parameters to get as
Jeff Johnson295189b2012-06-20 16:38:30 -07004550 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004551
Jeff Johnson295189b2012-06-20 16:38:30 -07004552 wdiGetStatsRspCb: callback for passing back the response
4553 of the get stats operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004554
Jeff Johnson295189b2012-06-20 16:38:30 -07004555 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004556 callback
4557
Jeff Johnson295189b2012-06-20 16:38:30 -07004558 @see WDI_Start
4559 @return Result of the function call
4560*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004561WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004562WDI_GetStatsReq
4563(
4564 WDI_GetStatsReqParamsType* pwdiGetStatsReqParams,
4565 WDI_GetStatsRspCb wdiGetStatsRspCb,
4566 void* pUserData
4567)
4568{
4569 WDI_EventInfoType wdiEventData;
4570 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4571
4572 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004573 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004574 ------------------------------------------------------------------------*/
4575 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4576 {
4577 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4578 "WDI API call before module is initialized - Fail request");
4579
Jeff Johnsone7245742012-09-05 17:12:55 -07004580 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004581 }
4582
4583 /*------------------------------------------------------------------------
4584 Fill in Event data and post to the Main FSM
4585 ------------------------------------------------------------------------*/
4586 wdiEventData.wdiRequest = WDI_GET_STATS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004587 wdiEventData.pEventData = pwdiGetStatsReqParams;
4588 wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams);
4589 wdiEventData.pCBfnc = wdiGetStatsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004590 wdiEventData.pUserData = pUserData;
4591
4592 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4593
4594}/*WDI_GetStatsReq*/
4595
4596
4597/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004598 @brief WDI_UpdateCfgReq will be called when the upper MAC when
Jeff Johnson295189b2012-06-20 16:38:30 -07004599 it wishes to change the configuration of the WLAN
4600 Device. Upon the call of this API the WLAN DAL will pack
4601 and send a HAL Update CFG request message to the lower
4602 RIVA sub-system if DAL is in state STARTED.
4603
4604 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004605 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004606
4607 WDI_Start must have been called.
4608
Jeff Johnsone7245742012-09-05 17:12:55 -07004609 @param wdiUpdateCfgReqParams: the update cfg parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004610 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004611
Jeff Johnson295189b2012-06-20 16:38:30 -07004612 wdiUpdateCfgsRspCb: callback for passing back the
4613 response of the update cfg operation received from the
4614 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004615
Jeff Johnson295189b2012-06-20 16:38:30 -07004616 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004617 callback
4618
Jeff Johnson295189b2012-06-20 16:38:30 -07004619 @see WDI_Start
4620 @return Result of the function call
4621*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004622WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004623WDI_UpdateCfgReq
4624(
4625 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams,
4626 WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb,
4627 void* pUserData
4628)
4629{
4630 WDI_EventInfoType wdiEventData;
4631 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4632
4633 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004634 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004635 ------------------------------------------------------------------------*/
4636 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4637 {
4638 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4639 "WDI API call before module is initialized - Fail request");
4640
Jeff Johnsone7245742012-09-05 17:12:55 -07004641 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004642 }
4643
4644 /*------------------------------------------------------------------------
4645 Fill in Event data and post to the Main FSM
4646 ------------------------------------------------------------------------*/
4647 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004648 wdiEventData.pEventData = pwdiUpdateCfgReqParams;
4649 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams);
4650 wdiEventData.pCBfnc = wdiUpdateCfgsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004651 wdiEventData.pUserData = pUserData;
4652
4653 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4654
4655}/*WDI_UpdateCfgReq*/
4656
4657
4658
4659/**
4660 @brief WDI_AddBAReq will be called when the upper MAC has setup
4661 successfully a BA session and needs to notify the HW for
4662 the appropriate settings to take place. Upon the call of
4663 this API the WLAN DAL will pack and send a HAL Add BA
4664 request message to the lower RIVA sub-system if DAL is
4665 in state STARTED.
4666
4667 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004668 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004669
4670 WDI_PostAssocReq must have been called.
4671
4672 @param wdiAddBAReqParams: the add BA parameters as specified by
4673 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004674
Jeff Johnson295189b2012-06-20 16:38:30 -07004675 wdiAddBARspCb: callback for passing back the response of
4676 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004677
Jeff Johnson295189b2012-06-20 16:38:30 -07004678 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004679 callback
4680
Jeff Johnson295189b2012-06-20 16:38:30 -07004681 @see WDI_PostAssocReq
4682 @return Result of the function call
4683*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004684WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004685WDI_AddBAReq
4686(
4687 WDI_AddBAReqParamsType* pwdiAddBAReqParams,
4688 WDI_AddBARspCb wdiAddBARspCb,
4689 void* pUserData
4690)
4691{
4692 WDI_EventInfoType wdiEventData;
4693 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4694
4695 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004696 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004697 ------------------------------------------------------------------------*/
4698 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4699 {
4700 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4701 "WDI API call before module is initialized - Fail request");
4702
Jeff Johnsone7245742012-09-05 17:12:55 -07004703 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004704 }
4705
4706 /*------------------------------------------------------------------------
4707 Fill in Event data and post to the Main FSM
4708 ------------------------------------------------------------------------*/
4709 wdiEventData.wdiRequest = WDI_ADD_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004710 wdiEventData.pEventData = pwdiAddBAReqParams;
4711 wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams);
4712 wdiEventData.pCBfnc = wdiAddBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004713 wdiEventData.pUserData = pUserData;
4714
4715 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4716
4717}/*WDI_AddBAReq*/
4718
4719
4720/**
4721 @brief WDI_TriggerBAReq will be called when the upper MAC has setup
4722 successfully a BA session and needs to notify the HW for
4723 the appropriate settings to take place. Upon the call of
4724 this API the WLAN DAL will pack and send a HAL Add BA
4725 request message to the lower RIVA sub-system if DAL is
4726 in state STARTED.
4727
4728 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004729 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004730
4731 WDI_PostAssocReq must have been called.
4732
4733 @param wdiAddBAReqParams: the add BA parameters as specified by
4734 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004735
Jeff Johnson295189b2012-06-20 16:38:30 -07004736 wdiAddBARspCb: callback for passing back the response of
4737 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004738
Jeff Johnson295189b2012-06-20 16:38:30 -07004739 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004740 callback
4741
Jeff Johnson295189b2012-06-20 16:38:30 -07004742 @see WDI_PostAssocReq
4743 @return Result of the function call
4744*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004745WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004746WDI_TriggerBAReq
4747(
4748 WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams,
4749 WDI_TriggerBARspCb wdiTriggerBARspCb,
4750 void* pUserData
4751)
4752{
4753 WDI_EventInfoType wdiEventData;
4754 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4755
4756 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004757 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004758 ------------------------------------------------------------------------*/
4759 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4760 {
4761 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4762 "WDI API call before module is initialized - Fail request");
4763
Jeff Johnsone7245742012-09-05 17:12:55 -07004764 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004765 }
4766
4767 /*------------------------------------------------------------------------
4768 Fill in Event data and post to the Main FSM
4769 ------------------------------------------------------------------------*/
4770 wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004771 wdiEventData.pEventData = pwdiTriggerBAReqParams;
4772 wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams);
4773 wdiEventData.pCBfnc = wdiTriggerBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004774 wdiEventData.pUserData = pUserData;
4775
4776 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4777
4778}/*WDI_AddBAReq*/
4779
4780/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004781 @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004782 wishes to update any of the Beacon parameters used by HW.
4783 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request
4784 message to the lower RIVA sub-system if DAL is in state
4785 STARTED.
4786
4787 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004788 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004789
4790 WDI_PostAssocReq must have been called.
4791
Jeff Johnsone7245742012-09-05 17:12:55 -07004792 @param wdiUpdateBeaconParams: the Beacon parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07004793 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004794
Jeff Johnson295189b2012-06-20 16:38:30 -07004795 wdiUpdateBeaconParamsRspCb: callback for passing back the
4796 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004797
Jeff Johnson295189b2012-06-20 16:38:30 -07004798 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004799 callback
4800
Jeff Johnson295189b2012-06-20 16:38:30 -07004801 @see WDI_PostAssocReq
4802 @return Result of the function call
4803*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004804WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004805WDI_UpdateBeaconParamsReq
4806(
4807 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams,
4808 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb,
4809 void* pUserData
4810)
4811{
4812 WDI_EventInfoType wdiEventData;
4813 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4814
4815 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004816 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004817 ------------------------------------------------------------------------*/
4818 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4819 {
4820 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4821 "WDI API call before module is initialized - Fail request");
4822
Jeff Johnsone7245742012-09-05 17:12:55 -07004823 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004824 }
4825
4826 /*------------------------------------------------------------------------
4827 Fill in Event data and post to the Main FSM
4828 ------------------------------------------------------------------------*/
4829 wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004830 wdiEventData.pEventData = pwdiUpdateBeaconParams;
4831 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams);
4832 wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004833 wdiEventData.pUserData = pUserData;
4834
4835 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4836
4837}/*WDI_UpdateBeaconParamsReq*/
4838
4839/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004840 @brief WDI_SendBeaconParamsReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004841 wishes to update the Beacon template used by HW.
4842 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request
4843 message to the lower RIVA sub-system if DAL is in state
4844 STARTED.
4845
4846 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004847 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004848
4849 WDI_PostAssocReq must have been called.
4850
Jeff Johnsone7245742012-09-05 17:12:55 -07004851 @param wdiSendBeaconParams: the Beacon parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07004852 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004853
Jeff Johnson295189b2012-06-20 16:38:30 -07004854 wdiSendBeaconParamsRspCb: callback for passing back the
4855 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004856
Jeff Johnson295189b2012-06-20 16:38:30 -07004857 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004858 callback
4859
Jeff Johnson295189b2012-06-20 16:38:30 -07004860 @see WDI_PostAssocReq
4861 @return Result of the function call
4862*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004863WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004864WDI_SendBeaconParamsReq
4865(
4866 WDI_SendBeaconParamsType* pwdiSendBeaconParams,
4867 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb,
4868 void* pUserData
4869)
4870{
4871 WDI_EventInfoType wdiEventData;
4872 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4873
4874 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004875 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004876 ------------------------------------------------------------------------*/
4877 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4878 {
4879 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4880 "WDI API call before module is initialized - Fail request");
4881
Jeff Johnsone7245742012-09-05 17:12:55 -07004882 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004883 }
4884
4885 /*------------------------------------------------------------------------
4886 Fill in Event data and post to the Main FSM
4887 ------------------------------------------------------------------------*/
4888 wdiEventData.wdiRequest = WDI_SND_BCON_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004889 wdiEventData.pEventData = pwdiSendBeaconParams;
4890 wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams);
4891 wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004892 wdiEventData.pUserData = pUserData;
4893
4894 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4895
4896}/*WDI_SendBeaconParamsReq*/
4897
4898/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004899 @brief WDI_UpdateProbeRspTemplateReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07004900 upper MAC wants to update the probe response template to
4901 be transmitted as Soft AP
4902 Upon the call of this API the WLAN DAL will
4903 pack and send the probe rsp template message to the
4904 lower RIVA sub-system if DAL is in state STARTED.
4905
4906 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004907 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004908
4909
Jeff Johnsone7245742012-09-05 17:12:55 -07004910 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004911 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004912
Jeff Johnson295189b2012-06-20 16:38:30 -07004913 wdiSendBeaconParamsRspCb: callback for passing back the
4914 response of the Send Beacon Params operation received
4915 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004916
Jeff Johnson295189b2012-06-20 16:38:30 -07004917 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004918 callback
4919
Jeff Johnson295189b2012-06-20 16:38:30 -07004920 @see WDI_AddBAReq
4921 @return Result of the function call
4922*/
4923
Jeff Johnsone7245742012-09-05 17:12:55 -07004924WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004925WDI_UpdateProbeRspTemplateReq
4926(
4927 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams,
4928 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb,
4929 void* pUserData
4930)
4931{
4932 WDI_EventInfoType wdiEventData;
4933 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4934
4935 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004936 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004937 ------------------------------------------------------------------------*/
4938 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4939 {
4940 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4941 "WDI API call before module is initialized - Fail request");
4942
Jeff Johnsone7245742012-09-05 17:12:55 -07004943 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004944 }
4945
4946 /*------------------------------------------------------------------------
4947 Fill in Event data and post to the Main FSM
4948 ------------------------------------------------------------------------*/
4949 wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004950 wdiEventData.pEventData = pwdiUpdateProbeRspParams;
4951 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams);
4952 wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004953 wdiEventData.pUserData = pUserData;
4954
4955 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4956
4957}/*WDI_UpdateProbeRspTemplateReq*/
4958
4959/**
4960 @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob
4961 to the NV memory.
4962
4963
4964 @param wdiNvDownloadReqParams: the NV Download parameters as specified by
4965 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004966
Jeff Johnson295189b2012-06-20 16:38:30 -07004967 wdiNvDownloadRspCb: callback for passing back the response of
4968 the NV Download operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004969
Jeff Johnson295189b2012-06-20 16:38:30 -07004970 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004971 callback
4972
Jeff Johnson295189b2012-06-20 16:38:30 -07004973 @see WDI_PostAssocReq
4974 @return Result of the function call
4975*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004976WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004977WDI_NvDownloadReq
4978(
4979 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams,
4980 WDI_NvDownloadRspCb wdiNvDownloadRspCb,
4981 void* pUserData
4982)
4983{
4984 WDI_EventInfoType wdiEventData;
4985
4986 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004987 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004988 ------------------------------------------------------------------------*/
4989 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4990 {
4991 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4992 "WDI API call before module is initialized - Fail request");
4993
Jeff Johnsone7245742012-09-05 17:12:55 -07004994 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004995 }
4996
4997 /*------------------------------------------------------------------------
4998 Fill in Event data and post to the Main FSM
4999 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005000 wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ;
5001 wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams;
5002 wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams);
5003 wdiEventData.pCBfnc = wdiNvDownloadRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005004 wdiEventData.pUserData = pUserData;
5005
5006 return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData);
5007
5008}/*WDI_NVDownloadReq*/
5009
5010#ifdef WLAN_FEATURE_P2P
5011/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005012 @brief WDI_SetP2PGONOAReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07005013 upper MAC wants to send Notice of Absence
5014 Upon the call of this API the WLAN DAL will
5015 pack and send the probe rsp template message to the
5016 lower RIVA sub-system if DAL is in state STARTED.
5017
5018 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005019 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005020
5021
Jeff Johnsone7245742012-09-05 17:12:55 -07005022 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07005023 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005024
Jeff Johnson295189b2012-06-20 16:38:30 -07005025 wdiSendBeaconParamsRspCb: callback for passing back the
5026 response of the Send Beacon Params operation received
5027 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005028
Jeff Johnson295189b2012-06-20 16:38:30 -07005029 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005030 callback
5031
Jeff Johnson295189b2012-06-20 16:38:30 -07005032 @see WDI_AddBAReq
5033 @return Result of the function call
5034*/
5035WDI_Status
5036WDI_SetP2PGONOAReq
5037(
5038 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams,
5039 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb,
5040 void* pUserData
5041)
5042{
5043 WDI_EventInfoType wdiEventData;
5044 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5045
5046 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005047 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005048 ------------------------------------------------------------------------*/
5049 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5050 {
5051 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5052 "WDI API call before module is initialized - Fail request");
5053
Jeff Johnsone7245742012-09-05 17:12:55 -07005054 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005055 }
5056
5057 /*------------------------------------------------------------------------
5058 Fill in Event data and post to the Main FSM
5059 ------------------------------------------------------------------------*/
5060 wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005061 wdiEventData.pEventData = pwdiP2PGONOAReqParams;
5062 wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams);
5063 wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005064 wdiEventData.pUserData = pUserData;
5065
5066 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5067
5068}/*WDI_SetP2PGONOAReq*/
5069#endif
5070
5071/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005072 @brief WDI_AddSTASelfReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07005073 UMAC wanted to add STA self while opening any new session
5074 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005075 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005076
5077
Jeff Johnsone7245742012-09-05 17:12:55 -07005078 @param pwdiAddSTASelfParams: the add sta self parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07005079 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005080
Jeff Johnson295189b2012-06-20 16:38:30 -07005081 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005082 callback
5083
5084 @see
Jeff Johnson295189b2012-06-20 16:38:30 -07005085 @return Result of the function call
5086*/
5087WDI_Status
5088WDI_AddSTASelfReq
5089(
5090 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams,
5091 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb,
5092 void* pUserData
5093)
5094{
5095 WDI_EventInfoType wdiEventData;
5096 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5097
5098 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005099 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005100 ------------------------------------------------------------------------*/
5101 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5102 {
5103 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5104 "WDI API call before module is initialized - Fail request");
5105
Jeff Johnsone7245742012-09-05 17:12:55 -07005106 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005107 }
5108
5109 /*------------------------------------------------------------------------
5110 Fill in Event data and post to the Main FSM
5111 ------------------------------------------------------------------------*/
5112 wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005113 wdiEventData.pEventData = pwdiAddSTASelfReqParams;
5114 wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams);
5115 wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005116 wdiEventData.pUserData = pUserData;
5117
5118 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5119
5120}/*WDI_AddSTASelfReq*/
5121
5122
Jeff Johnsone7245742012-09-05 17:12:55 -07005123#ifdef WLAN_FEATURE_VOWIFI_11R
Jeff Johnson295189b2012-06-20 16:38:30 -07005124/**
5125 @brief WDI_AggrAddTSReq will be called when the upper MAC to inform
5126 the device of a successful add TSpec negotiation. HW
5127 needs to receive the TSpec Info from the UMAC in order
5128 to configure properly the QoS data traffic. Upon the
5129 call of this API the WLAN DAL will pack and send a HAL
5130 Add TS request message to the lower RIVA sub-system if
5131 DAL is in state STARTED.
5132
5133 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005134 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005135
5136 WDI_PostAssocReq must have been called.
5137
5138 @param wdiAddTsReqParams: the add TS parameters as specified by
5139 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005140
Jeff Johnson295189b2012-06-20 16:38:30 -07005141 wdiAddTsRspCb: callback for passing back the response of
5142 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005143
Jeff Johnson295189b2012-06-20 16:38:30 -07005144 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005145 callback
5146
Jeff Johnson295189b2012-06-20 16:38:30 -07005147 @see WDI_PostAssocReq
5148 @return Result of the function call
5149*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005150WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005151WDI_AggrAddTSReq
5152(
5153 WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams,
5154 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb,
5155 void* pUserData
5156)
5157{
5158 WDI_EventInfoType wdiEventData;
5159 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5160
5161 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005162 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005163 ------------------------------------------------------------------------*/
5164 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5165 {
5166 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5167 "WDI API call before module is initialized - Fail request");
5168
Jeff Johnsone7245742012-09-05 17:12:55 -07005169 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005170 }
5171
5172 /*------------------------------------------------------------------------
5173 Fill in Event data and post to the Main FSM
5174 ------------------------------------------------------------------------*/
5175 wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005176 wdiEventData.pEventData = pwdiAggrAddTsReqParams;
5177 wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams);
5178 wdiEventData.pCBfnc = wdiAggrAddTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005179 wdiEventData.pUserData = pUserData;
5180
5181 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5182
5183}/*WDI_AggrAddTSReq*/
5184
5185#endif /* WLAN_FEATURE_VOWIFI_11R */
5186
5187#ifdef ANI_MANF_DIAG
5188/**
5189 @brief WDI_FTMCommandReq
5190 Post FTM Command Event
Jeff Johnsone7245742012-09-05 17:12:55 -07005191
5192 @param ftmCommandReq: FTM Command Body
5193 @param ftmCommandRspCb: FTM Response from HAL CB
Jeff Johnson295189b2012-06-20 16:38:30 -07005194 @param pUserData: Client Data
Jeff Johnsone7245742012-09-05 17:12:55 -07005195
Jeff Johnson295189b2012-06-20 16:38:30 -07005196 @see
5197 @return Result of the function call
5198*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005199WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005200WDI_FTMCommandReq
5201(
5202 WDI_FTMCommandReqType *ftmCommandReq,
5203 WDI_FTMCommandRspCb ftmCommandRspCb,
5204 void *pUserData
5205)
5206{
5207 WDI_EventInfoType wdiEventData;
5208 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5209
5210 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005211 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005212 ------------------------------------------------------------------------*/
5213 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5214 {
5215 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5216 "WDI API call before module is initialized - Fail request");
5217
Jeff Johnsone7245742012-09-05 17:12:55 -07005218 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005219 }
5220
5221 /*------------------------------------------------------------------------
5222 Fill in Event data and post to the Main FSM
5223 ------------------------------------------------------------------------*/
5224 wdiEventData.wdiRequest = WDI_FTM_CMD_REQ;
5225 wdiEventData.pEventData = (void *)ftmCommandReq;
5226 wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32);
5227 wdiEventData.pCBfnc = ftmCommandRspCb;
5228 wdiEventData.pUserData = pUserData;
5229
5230 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5231}
Jeff Johnsone7245742012-09-05 17:12:55 -07005232#endif /* ANI_MANF_DIAG */
Jeff Johnson295189b2012-06-20 16:38:30 -07005233/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005234 @brief WDI_HostResumeReq will be called
Jeff Johnson295189b2012-06-20 16:38:30 -07005235
5236 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005237 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005238
5239
5240 @param pwdiResumeReqParams: as specified by
5241 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005242
Jeff Johnson295189b2012-06-20 16:38:30 -07005243 wdiResumeReqRspCb: callback for passing back the response of
5244 the Resume Req received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005245
Jeff Johnson295189b2012-06-20 16:38:30 -07005246 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005247 callback
5248
5249 @see
Jeff Johnson295189b2012-06-20 16:38:30 -07005250 @return Result of the function call
5251*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005252WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005253WDI_HostResumeReq
5254(
5255 WDI_ResumeParamsType* pwdiResumeReqParams,
5256 WDI_HostResumeEventRspCb wdiResumeReqRspCb,
5257 void* pUserData
5258)
5259{
5260 WDI_EventInfoType wdiEventData;
5261 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5262
5263 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005264 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005265 ------------------------------------------------------------------------*/
5266 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5267 {
5268 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5269 "WDI API call before module is initialized - Fail request");
5270
Jeff Johnsone7245742012-09-05 17:12:55 -07005271 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005272 }
5273
5274 /*------------------------------------------------------------------------
5275 Fill in Event data and post to the Main FSM
5276 ------------------------------------------------------------------------*/
5277 wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005278 wdiEventData.pEventData = pwdiResumeReqParams;
5279 wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams);
5280 wdiEventData.pCBfnc = wdiResumeReqRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005281 wdiEventData.pUserData = pUserData;
5282
5283 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5284
5285}/*WDI_HostResumeReq*/
5286
5287/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005288 @brief WDI_DelSTASelfReq will be called
Jeff Johnson295189b2012-06-20 16:38:30 -07005289
5290 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005291 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005292
5293
5294 @param pwdiDelStaSelfReqParams: as specified by
5295 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005296
Jeff Johnson295189b2012-06-20 16:38:30 -07005297 wdiDelStaSelfRspCb: callback for passing back the response of
5298 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005299
Jeff Johnson295189b2012-06-20 16:38:30 -07005300 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005301 callback
5302
Jeff Johnson295189b2012-06-20 16:38:30 -07005303 @see WDI_PostAssocReq
5304 @return Result of the function call
5305*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005306WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005307WDI_DelSTASelfReq
5308(
5309 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams,
5310 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb,
5311 void* pUserData
5312)
5313{
5314 WDI_EventInfoType wdiEventData;
5315 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5316
5317 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005318 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005319 ------------------------------------------------------------------------*/
5320 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5321 {
5322 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5323 "WDI API call before module is initialized - Fail request");
5324
Jeff Johnsone7245742012-09-05 17:12:55 -07005325 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005326 }
5327
5328 /*------------------------------------------------------------------------
5329 Fill in Event data and post to the Main FSM
5330 ------------------------------------------------------------------------*/
5331 wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005332 wdiEventData.pEventData = pwdiDelStaSelfReqParams;
5333 wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams);
5334 wdiEventData.pCBfnc = wdiDelStaSelfRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005335 wdiEventData.pUserData = pUserData;
5336
5337 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5338
5339}/*WDI_AggrAddTSReq*/
5340
5341/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005342 @brief WDI_SetTxPerTrackingReq will be called when the upper MAC
5343 wants to set the Tx Per Tracking configurations.
Jeff Johnson295189b2012-06-20 16:38:30 -07005344 Upon the call of this API the WLAN DAL will pack
5345 and send a HAL Set Tx Per Tracking request message to the
5346 lower RIVA sub-system if DAL is in state STARTED.
5347
5348 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005349 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005350
Jeff Johnsone7245742012-09-05 17:12:55 -07005351 @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as
Jeff Johnson295189b2012-06-20 16:38:30 -07005352 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005353
Jeff Johnson295189b2012-06-20 16:38:30 -07005354 pwdiSetTxPerTrackingRspCb: callback for passing back the
5355 response of the set Tx PER Tracking configurations operation received
5356 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005357
Jeff Johnson295189b2012-06-20 16:38:30 -07005358 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005359 callback
5360
Jeff Johnson295189b2012-06-20 16:38:30 -07005361 @return Result of the function call
5362*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005363WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005364WDI_SetTxPerTrackingReq
5365(
5366 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams,
5367 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb,
5368 void* pUserData
5369)
5370{
5371 WDI_EventInfoType wdiEventData;
5372 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5373
5374 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005375 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005376 ------------------------------------------------------------------------*/
5377 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5378 {
5379 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5380 "WDI API call before module is initialized - Fail request");
5381
Jeff Johnsone7245742012-09-05 17:12:55 -07005382 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005383 }
5384
5385 /*------------------------------------------------------------------------
5386 Fill in Event data and post to the Main FSM
5387 ------------------------------------------------------------------------*/
5388 wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005389 wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07005390 wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -07005391 wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005392 wdiEventData.pUserData = pUserData;
5393
5394 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5395
5396}/*WDI_SetTxPerTrackingReq*/
5397
5398/**
5399 @brief WDI_SetTmLevelReq
5400 If HW Thermal condition changed, driver should react based on new
5401 HW thermal condition.
5402
5403 @param pwdiSetTmLevelReq: New thermal condition information
5404
5405 pwdiSetTmLevelRspCb: callback
5406
5407 usrData: user data will be passed back with the
5408 callback
5409
5410 @return Result of the function call
5411*/
5412WDI_Status
5413WDI_SetTmLevelReq
5414(
5415 WDI_SetTmLevelReqType *pwdiSetTmLevelReq,
5416 WDI_SetTmLevelCb pwdiSetTmLevelRspCb,
5417 void *usrData
5418)
5419{
5420 WDI_EventInfoType wdiEventData;
5421 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5422
5423 /*------------------------------------------------------------------------
5424 Sanity Check
5425 ------------------------------------------------------------------------*/
5426 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5427 {
5428 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5429 "WDI API call before module is initialized - Fail request");
5430
5431 return WDI_STATUS_E_NOT_ALLOWED;
5432 }
5433
5434 /*------------------------------------------------------------------------
5435 Fill in Event data and post to the Main FSM
5436 ------------------------------------------------------------------------*/
5437 wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ;
5438 wdiEventData.pEventData = pwdiSetTmLevelReq;
5439 wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq);
5440 wdiEventData.pCBfnc = pwdiSetTmLevelRspCb;
5441 wdiEventData.pUserData = usrData;
5442
5443 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5444}
5445
5446/**
5447 @brief WDI_HostSuspendInd
5448
5449 Suspend Indication from the upper layer will be sent
5450 down to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -07005451
Jeff Johnson295189b2012-06-20 16:38:30 -07005452 @param WDI_SuspendResumeIndParamsType
Jeff Johnsone7245742012-09-05 17:12:55 -07005453
5454 @see
5455
Jeff Johnson295189b2012-06-20 16:38:30 -07005456 @return Status of the request
5457*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005458WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005459WDI_HostSuspendInd
5460(
5461 WDI_SuspendParamsType* pwdiSuspendIndParams
5462)
5463{
5464
5465 WDI_EventInfoType wdiEventData;
5466 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5467
5468 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005469 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005470 ------------------------------------------------------------------------*/
5471 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5472 {
5473 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5474 "WDI API call before module is initialized - Fail request");
5475
Jeff Johnsone7245742012-09-05 17:12:55 -07005476 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005477 }
5478
5479 /*------------------------------------------------------------------------
5480 Fill in Event data and post to the Main FSM
5481 ------------------------------------------------------------------------*/
5482 wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -07005483 wdiEventData.pEventData = pwdiSuspendIndParams;
5484 wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams);
5485 wdiEventData.pCBfnc = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07005486 wdiEventData.pUserData = NULL;
5487
5488 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5489
5490}/*WDI_HostSuspendInd*/
5491
5492/**
5493 @brief WDI_HALDumpCmdReq
5494 Post HAL DUMP Command Event
Jeff Johnsone7245742012-09-05 17:12:55 -07005495
5496 @param halDumpCmdReqParams: Hal Dump Command Body
5497 @param halDumpCmdRspCb: HAL DUMP Response from HAL CB
Jeff Johnson295189b2012-06-20 16:38:30 -07005498 @param pUserData: Client Data
Jeff Johnsone7245742012-09-05 17:12:55 -07005499
Jeff Johnson295189b2012-06-20 16:38:30 -07005500 @see
5501 @return Result of the function call
5502*/
5503WDI_Status WDI_HALDumpCmdReq
5504(
5505 WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams,
5506 WDI_HALDumpCmdRspCb halDumpCmdRspCb,
5507 void *pUserData
5508)
5509{
5510 WDI_EventInfoType wdiEventData;
5511 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5512
5513 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005514 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005515 ------------------------------------------------------------------------*/
5516 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5517 {
5518 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5519 "WDI API call before module is initialized - Fail request");
5520
Jeff Johnsone7245742012-09-05 17:12:55 -07005521 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005522 }
5523
5524 /*------------------------------------------------------------------------
5525 Fill in Event data and post to the Main FSM
5526 ------------------------------------------------------------------------*/
5527 wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ;
5528 wdiEventData.pEventData = (void *)halDumpCmdReqParams;
5529 wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType);
5530 wdiEventData.pCBfnc = halDumpCmdRspCb;
5531 wdiEventData.pUserData = pUserData;
5532
5533 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5534}
5535
Jeff Johnsone7245742012-09-05 17:12:55 -07005536/*============================================================================
5537
Jeff Johnson295189b2012-06-20 16:38:30 -07005538 DAL Control Path Main FSM Function Implementation
Jeff Johnsone7245742012-09-05 17:12:55 -07005539
Jeff Johnson295189b2012-06-20 16:38:30 -07005540 ============================================================================*/
5541
5542/**
5543 @brief Main FSM Start function for all states except BUSY
5544
Jeff Johnsone7245742012-09-05 17:12:55 -07005545
5546 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -07005547 wdiEV: event posted to the main DAL FSM
5548 pEventData: pointer to the event information
Jeff Johnsone7245742012-09-05 17:12:55 -07005549 structure
5550
Jeff Johnson295189b2012-06-20 16:38:30 -07005551 @see
5552 @return Result of the function call
5553*/
5554WDI_Status
5555WDI_PostMainEvent
5556(
Jeff Johnsone7245742012-09-05 17:12:55 -07005557 WDI_ControlBlockType* pWDICtx,
5558 WDI_MainEventType wdiEV,
Jeff Johnson295189b2012-06-20 16:38:30 -07005559 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -07005560
Jeff Johnson295189b2012-06-20 16:38:30 -07005561)
5562{
Jeff Johnsone7245742012-09-05 17:12:55 -07005563 WDI_Status wdiStatus;
5564 WDI_MainFuncType pfnWDIMainEvHdlr;
5565 WDI_MainStateType wdiOldState;
Jeff Johnson295189b2012-06-20 16:38:30 -07005566 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5567
5568 /*-------------------------------------------------------------------------
5569 Sanity check
5570 -------------------------------------------------------------------------*/
5571 if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) ||
5572 ( wdiEV >= WDI_MAX_EVENT ))
5573 {
5574 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5575 "Invalid state or event in Post Main Ev function ST: %d EV: %d",
5576 pWDICtx->uGlobalState, wdiEV);
Jeff Johnsone7245742012-09-05 17:12:55 -07005577 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005578 }
5579
5580 /*Access to the global state must be locked */
5581 wpalMutexAcquire(&pWDICtx->wptMutex);
5582
5583 /*Fetch event handler for state*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005584 pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV];
Jeff Johnson295189b2012-06-20 16:38:30 -07005585
5586 wdiOldState = pWDICtx->uGlobalState;
5587
5588 /*
Jeff Johnsone7245742012-09-05 17:12:55 -07005589 --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a
5590 response comes from CCPU for the request sent by host:
5591 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 -07005592 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 -07005593 --Incase of WDI event is WDI_RESPONSE_EVENT and it is an indication from the
Jeff Johnson295189b2012-06-20 16:38:30 -07005594 CCPU:
5595 don't change the state */
5596 if ( WDI_RESPONSE_EVENT != wdiEV)
5597 {
5598 /*Transition to BUSY State - the request is now being processed by the FSM,
5599 if the request fails we shall transition back to the old state, if not
5600 the request will manage its own state transition*/
5601 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
5602 }
5603 /* If the state function associated with the EV is NULL it means that this
5604 event is not allowed in this state*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005605 if ( NULL != pfnWDIMainEvHdlr )
Jeff Johnson295189b2012-06-20 16:38:30 -07005606 {
5607 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005608 "Posting event %d in state: %d to the Main FSM",
Jeff Johnson295189b2012-06-20 16:38:30 -07005609 wdiEV, wdiOldState);
Jeff Johnsone7245742012-09-05 17:12:55 -07005610 wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07005611 }
5612 else
5613 {
5614 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07005615 "Unexpected event %d in state: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -07005616 wdiEV, wdiOldState);
Jeff Johnsone7245742012-09-05 17:12:55 -07005617 wdiStatus = WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005618 }
5619
5620 /* If a request handles itself well it will end up in a success or in a
5621 pending
5622 Success - means that the request was processed and the proper state
5623 transition already occurred or will occur when the resp is received
5624 - NO other state transition or dequeueing is required
Jeff Johnsone7245742012-09-05 17:12:55 -07005625
Jeff Johnson295189b2012-06-20 16:38:30 -07005626 Pending - means the request could not be processed at this moment in time
5627 because the FSM was already busy so no state transition or dequeueing
5628 is necessary anymore
Jeff Johnsone7245742012-09-05 17:12:55 -07005629
Jeff Johnson295189b2012-06-20 16:38:30 -07005630 Success for synchronous case means that the transition may occur and
5631 processing of pending requests may continue - so it should go through
5632 and restores the state and continue processing queued requests*/
5633 if (( WDI_STATUS_SUCCESS != wdiStatus )&&
5634 ( WDI_STATUS_PENDING != wdiStatus ))
5635 {
5636 if ( WDI_RESPONSE_EVENT != wdiEV)
5637 {
5638 /*The request has failed or could not be processed - transition back to
5639 the old state - check to see if anything was queued and try to execute
5640 The dequeue logic should post a message to a thread and return - no
5641 actual processing can occur */
5642 WDI_STATE_TRANSITION( pWDICtx, wdiOldState);
5643 }
5644 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -07005645
Jeff Johnson295189b2012-06-20 16:38:30 -07005646 }
5647
5648 /* we have completed processing the event */
5649 wpalMutexRelease(&pWDICtx->wptMutex);
5650
Jeff Johnsone7245742012-09-05 17:12:55 -07005651 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07005652
5653}/*WDI_PostMainEvent*/
5654
5655
5656/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005657 INIT State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005658--------------------------------------------------------------------------*/
5659/**
5660 @brief Main FSM Start function for all states except BUSY
5661
Jeff Johnsone7245742012-09-05 17:12:55 -07005662
5663 @param pWDICtx: pointer to the WLAN DAL context
5664 pEventData: pointer to the event information structure
5665
Jeff Johnson295189b2012-06-20 16:38:30 -07005666 @see
5667 @return Result of the function call
5668*/
5669WDI_Status
5670WDI_MainStart
Jeff Johnsone7245742012-09-05 17:12:55 -07005671(
Jeff Johnson295189b2012-06-20 16:38:30 -07005672 WDI_ControlBlockType* pWDICtx,
5673 WDI_EventInfoType* pEventData
5674)
5675{
5676
5677 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005678 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005679 ----------------------------------------------------------------------*/
5680 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5681 {
5682 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005683 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005684 pWDICtx, pEventData);
5685 return WDI_STATUS_E_FAILURE;
5686 }
5687
5688 wpalMutexAcquire(&pWDICtx->wptMutex);
5689
5690 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005691 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07005692 ----------------------------------------------------------------------*/
5693 if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened )
5694 {
5695 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5696 "Control Transport not yet Open - queueing the request");
5697
5698 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -07005699 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07005700
5701 wpalMutexRelease(&pWDICtx->wptMutex);
5702 return WDI_STATUS_PENDING;
5703 }
Jeff Johnsone7245742012-09-05 17:12:55 -07005704
Jeff Johnson295189b2012-06-20 16:38:30 -07005705 wpalMutexRelease(&pWDICtx->wptMutex);
5706
5707 /*Return Success*/
5708 return WDI_ProcessRequest( pWDICtx, pEventData );
5709
5710}/*WDI_MainStart*/
5711
5712/**
5713 @brief Main FSM Response function for state INIT
5714
Jeff Johnsone7245742012-09-05 17:12:55 -07005715
5716 @param pWDICtx: pointer to the WLAN DAL context
5717 pEventData: pointer to the event information structure
5718
Jeff Johnson295189b2012-06-20 16:38:30 -07005719 @see
5720 @return Result of the function call
5721*/
5722WDI_Status
5723WDI_MainRspInit
Jeff Johnsone7245742012-09-05 17:12:55 -07005724(
Jeff Johnson295189b2012-06-20 16:38:30 -07005725 WDI_ControlBlockType* pWDICtx,
5726 WDI_EventInfoType* pEventData
5727)
5728{
5729 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005730 Not expecting a response from the device before it is started
Jeff Johnson295189b2012-06-20 16:38:30 -07005731 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005732 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07005733
5734 /*Return Success*/
5735 return WDI_STATUS_E_NOT_ALLOWED;
5736}/* WDI_MainRspInit */
5737
5738/**
5739 @brief Main FSM Close function for all states except BUSY
5740
Jeff Johnsone7245742012-09-05 17:12:55 -07005741
5742 @param pWDICtx: pointer to the WLAN DAL context
5743 pEventData: pointer to the event information structure
5744
Jeff Johnson295189b2012-06-20 16:38:30 -07005745 @see
5746 @return Result of the function call
5747*/
5748WDI_Status
5749WDI_MainClose
Jeff Johnsone7245742012-09-05 17:12:55 -07005750(
Jeff Johnson295189b2012-06-20 16:38:30 -07005751 WDI_ControlBlockType* pWDICtx,
5752 WDI_EventInfoType* pEventData
5753)
5754{
5755
5756 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005757 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005758 ----------------------------------------------------------------------*/
5759 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5760 {
5761 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005762 "Invalid parameters on Main Close %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005763 pWDICtx, pEventData);
5764 return WDI_STATUS_E_FAILURE;
5765 }
5766
5767 /*Return Success*/
5768 return WDI_ProcessRequest( pWDICtx, pEventData );
5769
5770}/*WDI_MainClose*/
5771/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005772 STARTED State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005773--------------------------------------------------------------------------*/
5774/**
5775 @brief Main FSM Start function for state STARTED
5776
Jeff Johnsone7245742012-09-05 17:12:55 -07005777
5778 @param pWDICtx: pointer to the WLAN DAL context
5779 pEventData: pointer to the event information structure
5780
Jeff Johnson295189b2012-06-20 16:38:30 -07005781 @see
5782 @return Result of the function call
5783*/
5784WDI_Status
5785WDI_MainStartStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005786(
Jeff Johnson295189b2012-06-20 16:38:30 -07005787 WDI_ControlBlockType* pWDICtx,
5788 WDI_EventInfoType* pEventData
5789)
5790{
5791 WDI_StartRspCb wdiStartRspCb = NULL;
5792 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5793
5794 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005795 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005796 ----------------------------------------------------------------------*/
5797 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5798 {
5799 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005800 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005801 pWDICtx, pEventData);
5802 return WDI_STATUS_E_FAILURE;
5803 }
5804
5805 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005806 Nothing to do transport was already started
Jeff Johnson295189b2012-06-20 16:38:30 -07005807 ----------------------------------------------------------------------*/
5808 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005809 "Received start while transport was already started - nothing to do");
Jeff Johnson295189b2012-06-20 16:38:30 -07005810
5811 wpalMutexAcquire(&pWDICtx->wptMutex);
5812
5813 /*Transition back to started because the post function transitioned us to
5814 busy*/
5815 WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST);
5816
5817 /*Check to see if any request is pending*/
5818 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -07005819
Jeff Johnson295189b2012-06-20 16:38:30 -07005820 wpalMutexRelease(&pWDICtx->wptMutex);
5821
5822 /*Tell UMAC Success*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005823 wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc;
5824
Jeff Johnson295189b2012-06-20 16:38:30 -07005825 /*Notify UMAC*/
5826 wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData);
5827
5828 /*Return Success*/
5829 return WDI_STATUS_SUCCESS;
5830
5831}/*WDI_MainStartStarted*/
5832
5833/**
5834 @brief Main FSM Stop function for state STARTED
5835
Jeff Johnsone7245742012-09-05 17:12:55 -07005836
5837 @param pWDICtx: pointer to the WLAN DAL context
5838 pEventData: pointer to the event information structure
5839
Jeff Johnson295189b2012-06-20 16:38:30 -07005840 @see
5841 @return Result of the function call
5842*/
5843WDI_Status
5844WDI_MainStopStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005845(
Jeff Johnson295189b2012-06-20 16:38:30 -07005846 WDI_ControlBlockType* pWDICtx,
5847 WDI_EventInfoType* pEventData
5848)
5849{
5850 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005851 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005852 ----------------------------------------------------------------------*/
5853 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5854 {
5855 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07005856 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005857 pWDICtx, pEventData);
5858 return WDI_STATUS_E_FAILURE;
5859 }
5860
5861 /*State at this point is BUSY - because we enter this state before posting
5862 an event to the FSM in order to prevent potential race conditions*/
5863
5864 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
5865 "Processing stop request in FSM");
5866
5867 /*Return Success*/
5868 return WDI_ProcessRequest( pWDICtx, pEventData );
5869
5870}/*WDI_MainStopStarted*/
5871/**
5872 @brief Main FSM Request function for state started
5873
Jeff Johnsone7245742012-09-05 17:12:55 -07005874
5875 @param pWDICtx: pointer to the WLAN DAL context
5876 pEventData: pointer to the event information structure
5877
Jeff Johnson295189b2012-06-20 16:38:30 -07005878 @see
5879 @return Result of the function call
5880*/
5881WDI_Status
5882WDI_MainReqStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005883(
Jeff Johnson295189b2012-06-20 16:38:30 -07005884 WDI_ControlBlockType* pWDICtx,
5885 WDI_EventInfoType* pEventData
5886)
5887{
5888
5889 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005890 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005891 ----------------------------------------------------------------------*/
5892 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5893 {
5894 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005895 "Invalid parameters on Main Req Started %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005896 pWDICtx, pEventData);
5897 return WDI_STATUS_E_FAILURE;
5898 }
5899
5900 /*State at this point is BUSY - because we enter this state before posting
5901 an event to the FSM in order to prevent potential race conditions*/
5902
5903 /*Return Success*/
5904 return WDI_ProcessRequest( pWDICtx, pEventData );
5905
5906}/*WDI_MainReqStarted*/
5907
5908/**
5909 @brief Main FSM Response function for all states except INIT
5910
Jeff Johnsone7245742012-09-05 17:12:55 -07005911
5912 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -07005913 pEventData: pointer to the event information structure
Jeff Johnsone7245742012-09-05 17:12:55 -07005914
Jeff Johnson295189b2012-06-20 16:38:30 -07005915 @see
5916 @return Result of the function call
5917*/
5918WDI_Status
5919WDI_MainRsp
Jeff Johnsone7245742012-09-05 17:12:55 -07005920(
Jeff Johnson295189b2012-06-20 16:38:30 -07005921 WDI_ControlBlockType* pWDICtx,
5922 WDI_EventInfoType* pEventData
5923)
5924{
Jeff Johnsone7245742012-09-05 17:12:55 -07005925 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07005926 wpt_boolean expectedResponse;
5927
5928 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005929 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005930 ----------------------------------------------------------------------*/
5931 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5932 {
5933 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005934 "Invalid parameters on Main Response %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005935 pWDICtx, pEventData);
5936 return WDI_STATUS_E_FAILURE;
5937 }
5938
5939 if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse )
5940 {
5941 /* we received an expected response */
5942 expectedResponse = eWLAN_PAL_TRUE;
5943
5944 /*We expect that we will transition to started after this processing*/
5945 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
5946
5947 /* we are no longer expecting a response */
5948 pWDICtx->wdiExpectedResponse = WDI_MAX_RESP;
5949 }
5950 else
5951 {
5952 /* we received an indication or unexpected response */
5953 expectedResponse = eWLAN_PAL_FALSE;
5954 /* for indications no need to update state from what it is right
5955 now, unless it explicitly does it in the indication handler (say
5956 for device failure ind) */
5957 pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState;
5958 }
5959
5960 /*Process the response and indication */
5961 wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData );
5962
5963 /*Lock the CB as we are about to do a state transition*/
5964 wpalMutexAcquire(&pWDICtx->wptMutex);
5965
5966 /*Transition to the expected state after the response processing
5967 - this should always be started state with the following exceptions:
5968 1. processing of a failed start response
5969 2. device failure detected while processing response
5970 3. stop response received*/
5971 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
Jeff Johnsone7245742012-09-05 17:12:55 -07005972
Jeff Johnson295189b2012-06-20 16:38:30 -07005973 /*Dequeue request that may have been queued while we were waiting for the
5974 response */
5975 if ( expectedResponse )
5976 {
Jeff Johnsone7245742012-09-05 17:12:55 -07005977 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07005978 }
5979
5980 wpalMutexRelease(&pWDICtx->wptMutex);
5981
5982 /*Return Success - always */
Jeff Johnsone7245742012-09-05 17:12:55 -07005983 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07005984
5985}/*WDI_MainRsp*/
5986
5987/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005988 STOPPED State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005989--------------------------------------------------------------------------*/
5990/**
5991 @brief Main FSM Stop function for state STOPPED
5992
Jeff Johnsone7245742012-09-05 17:12:55 -07005993
5994 @param pWDICtx: pointer to the WLAN DAL context
5995 pEventData: pointer to the event information structure
5996
Jeff Johnson295189b2012-06-20 16:38:30 -07005997 @see
5998 @return Result of the function call
5999*/
6000WDI_Status
6001WDI_MainStopStopped
Jeff Johnsone7245742012-09-05 17:12:55 -07006002(
Jeff Johnson295189b2012-06-20 16:38:30 -07006003 WDI_ControlBlockType* pWDICtx,
6004 WDI_EventInfoType* pEventData
6005)
6006{
6007 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006008 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006009 ----------------------------------------------------------------------*/
6010 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6011 {
6012 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07006013 "Invalid parameters on Main Stop Stopped %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006014 pWDICtx, pEventData);
6015 return WDI_STATUS_E_FAILURE;
6016 }
6017
6018 /*We should normally not get a STOP request if we are already stopped
6019 since we should normally be stopped by the UMAC. However in some
6020 error situations we put ourselves in the stopped state without the
6021 UMAC knowing, so when we get a STOP request in this state we still
6022 process it since we need to clean up the underlying state */
6023 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6024 "Processing stop request while stopped in FSM");
6025
6026 /*Return Success*/
6027 return WDI_ProcessRequest( pWDICtx, pEventData );
6028
6029}/*WDI_MainStopStopped*/
6030
6031/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006032 BUSY State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07006033--------------------------------------------------------------------------*/
6034/**
6035 @brief Main FSM Start function for state BUSY
6036
Jeff Johnsone7245742012-09-05 17:12:55 -07006037
6038 @param pWDICtx: pointer to the WLAN DAL context
6039 pEventData: pointer to the event information structure
6040
Jeff Johnson295189b2012-06-20 16:38:30 -07006041 @see
6042 @return Result of the function call
6043*/
6044WDI_Status
6045WDI_MainStartBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006046(
Jeff Johnson295189b2012-06-20 16:38:30 -07006047 WDI_ControlBlockType* pWDICtx,
6048 WDI_EventInfoType* pEventData
6049)
6050{
6051 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006052 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006053 ----------------------------------------------------------------------*/
6054 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6055 {
6056 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006057 "Invalid parameters on Main Start in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006058 pWDICtx, pEventData);
6059 return WDI_STATUS_E_FAILURE;
6060 }
6061
6062 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006063 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006064 ----------------------------------------------------------------------*/
6065 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6066 "WDI Busy state - queue start request");
6067
6068 /*Queue the start request*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006069 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006070
6071 /*Return Success*/
6072 return WDI_STATUS_PENDING;
6073}/*WDI_MainStartBusy*/
6074
6075/**
6076 @brief Main FSM Stop function for state BUSY
6077
Jeff Johnsone7245742012-09-05 17:12:55 -07006078
6079 @param pWDICtx: pointer to the WLAN DAL context
6080 pEventData: pointer to the event information structure
6081
Jeff Johnson295189b2012-06-20 16:38:30 -07006082 @see
6083 @return Result of the function call
6084*/
6085WDI_Status
6086WDI_MainStopBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006087(
Jeff Johnson295189b2012-06-20 16:38:30 -07006088 WDI_ControlBlockType* pWDICtx,
6089 WDI_EventInfoType* pEventData
6090)
6091{
6092 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006093 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006094 ----------------------------------------------------------------------*/
6095 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6096 {
6097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006098 "Invalid parameters on Main Stop in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006099 pWDICtx, pEventData);
6100 return WDI_STATUS_E_FAILURE;
6101 }
6102
6103 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006104 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006105 ----------------------------------------------------------------------*/
6106 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6107 "WDI Busy state - queue stop request");
6108
Jeff Johnsone7245742012-09-05 17:12:55 -07006109 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006110 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006111
Jeff Johnson295189b2012-06-20 16:38:30 -07006112}/*WDI_MainStopBusy*/
6113
6114/**
6115 @brief Main FSM Request function for state BUSY
6116
Jeff Johnsone7245742012-09-05 17:12:55 -07006117
6118 @param pWDICtx: pointer to the WLAN DAL context
6119 pEventData: pointer to the event information structure
6120
Jeff Johnson295189b2012-06-20 16:38:30 -07006121 @see
6122 @return Result of the function call
6123*/
6124WDI_Status
6125WDI_MainReqBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006126(
Jeff Johnson295189b2012-06-20 16:38:30 -07006127 WDI_ControlBlockType* pWDICtx,
6128 WDI_EventInfoType* pEventData
6129)
6130{
6131 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006132 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006133 ----------------------------------------------------------------------*/
6134 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6135 {
6136 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006137 "Invalid parameters on Main Request in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006138 pWDICtx, pEventData);
6139 return WDI_STATUS_E_FAILURE;
6140 }
6141
6142 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006143 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006144 ----------------------------------------------------------------------*/
6145 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6146 "WDI Busy state - queue request %d because waiting for response %d",
6147 pEventData->wdiRequest, pWDICtx->wdiExpectedResponse);
6148
Jeff Johnsone7245742012-09-05 17:12:55 -07006149 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006150 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006151
Jeff Johnson295189b2012-06-20 16:38:30 -07006152}/*WDI_MainReqBusy*/
6153/**
6154 @brief Main FSM Close function for state BUSY
6155
Jeff Johnsone7245742012-09-05 17:12:55 -07006156
6157 @param pWDICtx: pointer to the WLAN DAL context
6158 pEventData: pointer to the event information structure
6159
Jeff Johnson295189b2012-06-20 16:38:30 -07006160 @see
6161 @return Result of the function call
6162*/
6163WDI_Status
6164WDI_MainCloseBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006165(
Jeff Johnson295189b2012-06-20 16:38:30 -07006166 WDI_ControlBlockType* pWDICtx,
6167 WDI_EventInfoType* pEventData
6168)
6169{
6170 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006171 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006172 ----------------------------------------------------------------------*/
6173 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6174 {
6175 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006176 "Invalid parameters on Main Close in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006177 pWDICtx, pEventData);
6178 return WDI_STATUS_E_FAILURE;
6179 }
6180
6181 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006182 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006183 ----------------------------------------------------------------------*/
6184 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6185 "WDI Busy state - queue close request");
6186
Jeff Johnsone7245742012-09-05 17:12:55 -07006187 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006188 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006189
Jeff Johnson295189b2012-06-20 16:38:30 -07006190}/*WDI_MainCloseBusy*/
6191
6192/**
6193 @brief Main FSM Shutdown function for INIT & STARTED states
6194
6195
6196 @param pWDICtx: pointer to the WLAN DAL context
6197 pEventData: pointer to the event information structure
6198
6199 @see
6200 @return Result of the function call
6201*/
6202WDI_Status
6203WDI_MainShutdown
6204(
6205 WDI_ControlBlockType* pWDICtx,
6206 WDI_EventInfoType* pEventData
6207)
6208{
6209 /*--------------------------------------------------------------------
6210 Sanity Check
6211 ----------------------------------------------------------------------*/
6212 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6213 {
6214 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6215 "Invalid parameters on Main Start %x %x",
6216 pWDICtx, pEventData);
6217 return WDI_STATUS_E_FAILURE;
6218 }
6219
6220 /*State at this point is BUSY - because we enter this state before posting
6221 an event to the FSM in order to prevent potential race conditions*/
6222
6223 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6224 "Processing shutdown request in FSM");
6225
6226 /*Return Success*/
6227 return WDI_ProcessRequest( pWDICtx, pEventData );
6228
6229}/*WDI_MainShutdown*/
6230
6231/**
6232 @brief Main FSM Shutdown function for BUSY state
6233
6234
6235 @param pWDICtx: pointer to the WLAN DAL context
6236 pEventData: pointer to the event information structure
6237
6238 @see
6239 @return Result of the function call
6240*/
6241WDI_Status
6242WDI_MainShutdownBusy
6243(
6244 WDI_ControlBlockType* pWDICtx,
6245 WDI_EventInfoType* pEventData
6246)
6247{
6248 /*--------------------------------------------------------------------
6249 Sanity Check
6250 ----------------------------------------------------------------------*/
6251 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6252 {
6253 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6254 "Invalid parameters on Main Start %x %x",
6255 pWDICtx, pEventData);
6256 return WDI_STATUS_E_FAILURE;
6257 }
6258
6259 /* If you are waiting for a HAL response at this stage, you are not
6260 * going to get it. Riva is already shutdown/crashed.
6261 */
6262 wpalTimerStop(&gWDICb.wptResponseTimer);
6263
6264 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6265 "Processing shutdown request in FSM: Busy state ");
6266
6267 return WDI_ProcessRequest( pWDICtx, pEventData );
6268
6269}/*WDI_MainShutdownBusy*/
6270
6271
Jeff Johnsone7245742012-09-05 17:12:55 -07006272/*=======================================================================
6273
Jeff Johnson295189b2012-06-20 16:38:30 -07006274 WLAN DAL Control Path Main Processing Functions
Jeff Johnsone7245742012-09-05 17:12:55 -07006275
Jeff Johnson295189b2012-06-20 16:38:30 -07006276*=======================================================================*/
6277
6278/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07006279 Main DAL Control Path Request Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -07006280========================================================================*/
6281/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006282 @brief Process Start Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006283 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006284
6285 @param pWDICtx: pointer to the WLAN DAL context
6286 pEventData: pointer to the event information structure
6287
Jeff Johnson295189b2012-06-20 16:38:30 -07006288 @see
6289 @return Result of the function call
6290*/
6291WDI_Status
6292WDI_ProcessStartReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006293(
Jeff Johnson295189b2012-06-20 16:38:30 -07006294 WDI_ControlBlockType* pWDICtx,
6295 WDI_EventInfoType* pEventData
6296)
6297{
6298 WDI_StartReqParamsType* pwdiStartParams = NULL;
6299 WDI_StartRspCb wdiStartRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006300 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006301 wpt_uint16 usDataOffset = 0;
6302 wpt_uint16 usSendSize = 0;
6303
Jeff Johnsone7245742012-09-05 17:12:55 -07006304 tHalMacStartReqMsg halStartReq;
6305 wpt_uint16 usLen = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07006306 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6307
6308 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006309 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006310 -------------------------------------------------------------------------*/
6311 if (( NULL == pEventData ) ||
6312 ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) ||
6313 ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc)))
6314 {
6315 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6316 "%s: Invalid parameters", __FUNCTION__);
6317 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006318 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006319 }
6320
6321 /*-----------------------------------------------------------------------
6322 Get message buffer
6323 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006324 usLen = sizeof(halStartReq.startReqParams) +
Jeff Johnson295189b2012-06-20 16:38:30 -07006325 pwdiStartParams->usConfigBufferLen;
6326
Jeff Johnsone7245742012-09-05 17:12:55 -07006327 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006328 usLen,
6329 &pSendBuffer, &usDataOffset, &usSendSize))||
6330 ( usSendSize < (usDataOffset + usLen )))
6331 {
6332 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6333 "Unable to get send buffer in start req %x %x %x",
6334 pEventData, pwdiStartParams, wdiStartRspCb);
6335 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006336 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006337 }
6338
6339 /*-----------------------------------------------------------------------
6340 Fill in the message
6341 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006342 halStartReq.startReqParams.driverType =
6343 WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType);
Jeff Johnson295189b2012-06-20 16:38:30 -07006344
Jeff Johnsone7245742012-09-05 17:12:55 -07006345 halStartReq.startReqParams.uConfigBufferLen =
6346 pwdiStartParams->usConfigBufferLen;
6347 wpalMemoryCopy( pSendBuffer+usDataOffset,
6348 &halStartReq.startReqParams,
6349 sizeof(halStartReq.startReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006350
Jeff Johnsone7245742012-09-05 17:12:55 -07006351 usDataOffset += sizeof(halStartReq.startReqParams);
6352 wpalMemoryCopy( pSendBuffer+usDataOffset,
6353 pwdiStartParams->pConfigBuffer,
6354 pwdiStartParams->usConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07006355
6356 pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006357 pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006358
6359 /*Save Low Level Ind CB and associated user data - it will be used further
6360 on when an indication is coming from the lower MAC*/
6361 pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006362 pWDICtx->pIndUserData = pwdiStartParams->pIndUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006363
Jeff Johnsone7245742012-09-05 17:12:55 -07006364 pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -07006365 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006366 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006367 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006368 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006369 wdiStartRspCb, pEventData->pUserData, WDI_START_RESP);
6370
Jeff Johnsone7245742012-09-05 17:12:55 -07006371
Jeff Johnson295189b2012-06-20 16:38:30 -07006372}/*WDI_ProcessStartReq*/
6373
6374/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006375 @brief Process Stop Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006376 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006377
6378 @param pWDICtx: pointer to the WLAN DAL context
6379 pEventData: pointer to the event information structure
6380
Jeff Johnson295189b2012-06-20 16:38:30 -07006381 @see
6382 @return Result of the function call
6383*/
6384WDI_Status
6385WDI_ProcessStopReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006386(
Jeff Johnson295189b2012-06-20 16:38:30 -07006387 WDI_ControlBlockType* pWDICtx,
6388 WDI_EventInfoType* pEventData
6389)
6390{
6391 WDI_StopReqParamsType* pwdiStopParams = NULL;
6392 WDI_StopRspCb wdiStopRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006393 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006394 wpt_uint16 usDataOffset = 0;
6395 wpt_uint16 usSendSize = 0;
Jeff Johnson43971f52012-07-17 12:26:56 -07006396 wpt_status status;
Jeff Johnsone7245742012-09-05 17:12:55 -07006397 tHalMacStopReqMsg halStopReq;
Jeff Johnson295189b2012-06-20 16:38:30 -07006398 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6399
6400 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006401 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006402 -------------------------------------------------------------------------*/
6403 if (( NULL == pEventData ) ||
6404 ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) ||
6405 ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc)))
6406 {
6407 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6408 "%s: Invalid parameters", __FUNCTION__);
6409 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006410 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006411 }
6412
6413 /*-----------------------------------------------------------------------
6414 Get message buffer
6415 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006416 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006417 sizeof(halStopReq.stopReqParams),
6418 &pSendBuffer, &usDataOffset, &usSendSize))||
6419 ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) )))
6420 {
6421 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6422 "Unable to get send buffer in stop req %x %x %x",
6423 pEventData, pwdiStopParams, wdiStopRspCb);
6424 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006425 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006426 }
6427
6428 /*-----------------------------------------------------------------------
6429 Fill in the message
6430 -----------------------------------------------------------------------*/
6431 halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON(
6432 pwdiStopParams->wdiStopReason);
6433
Jeff Johnsone7245742012-09-05 17:12:55 -07006434 wpalMemoryCopy( pSendBuffer+usDataOffset,
6435 &halStopReq.stopReqParams,
6436 sizeof(halStopReq.stopReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006437
6438 pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006439 pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006440
6441 /*! TO DO: stop the data services */
6442 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6443 {
6444 /*Stop the STA Table !UT- check this logic again
6445 It is safer to do it here than on the response - because a stop is imminent*/
6446 WDI_STATableStop(pWDICtx);
6447
6448 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -07006449 status = wpalEventReset(&pWDICtx->setPowerStateEvent);
6450 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006451 {
6452 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6453 "WDI Init failed to reset power state event");
6454
Jeff Johnsone7245742012-09-05 17:12:55 -07006455 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07006456 return VOS_STATUS_E_FAILURE;
6457 }
6458 /* Stop Transport Driver, DXE */
6459 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb);
6460 /*
Jeff Johnsone7245742012-09-05 17:12:55 -07006461 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -07006462 */
Jeff Johnson43971f52012-07-17 12:26:56 -07006463 status = wpalEventWait(&pWDICtx->setPowerStateEvent,
6464 WDI_SET_POWER_STATE_TIMEOUT);
6465 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006466 {
6467 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6468 "WDI Init failed to wait on an event");
6469
Jeff Johnsone7245742012-09-05 17:12:55 -07006470 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07006471 return VOS_STATUS_E_FAILURE;
6472 }
6473 }
6474
6475 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006476 Send Stop Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006477 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006478 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006479 wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP);
6480
6481}/*WDI_ProcessStopReq*/
6482
6483/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006484 @brief Process Close Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006485 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006486
6487 @param pWDICtx: pointer to the WLAN DAL context
6488 pEventData: pointer to the event information structure
6489
Jeff Johnson295189b2012-06-20 16:38:30 -07006490 @see
6491 @return Result of the function call
6492*/
6493WDI_Status
6494WDI_ProcessCloseReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006495(
Jeff Johnson295189b2012-06-20 16:38:30 -07006496 WDI_ControlBlockType* pWDICtx,
6497 WDI_EventInfoType* pEventData
6498)
6499{
Jeff Johnsone7245742012-09-05 17:12:55 -07006500 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07006501 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6502
6503 /*Lock control block for cleanup*/
6504 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006505
Jeff Johnson295189b2012-06-20 16:38:30 -07006506 /*Clear all pending request*/
6507 WDI_ClearPendingRequests(pWDICtx);
6508
6509 /* Close Control transport*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006510 WCTS_CloseTransport(pWDICtx->wctsHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07006511
6512 /* Close Data transport*/
6513 /* FTM mode does not open Data Path */
6514 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6515 {
6516 WDTS_Close(pWDICtx);
6517 }
6518
6519 /*Close the STA Table !UT- check this logic again*/
6520 WDI_STATableClose(pWDICtx);
6521
6522 /*close the PAL */
6523 wptStatus = wpalClose(pWDICtx->pPALContext);
6524 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
6525 {
6526 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6527 "Failed to wpal Close %d", wptStatus);
6528 WDI_ASSERT(0);
6529 }
6530
6531 /*Transition back to init state*/
6532 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
6533
6534 wpalMutexRelease(&pWDICtx->wptMutex);
6535
6536 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006537 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006538
Jeff Johnsone7245742012-09-05 17:12:55 -07006539 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07006540}/*WDI_ProcessCloseReq*/
6541
6542
6543/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07006544 SCANING REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07006545===========================================================================*/
6546
6547/**
6548 @brief Process Init Scan Request function (called when Main FSM
6549 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006550
6551 @param pWDICtx: pointer to the WLAN DAL context
6552 pEventData: pointer to the event information structure
6553
Jeff Johnson295189b2012-06-20 16:38:30 -07006554 @see
6555 @return Result of the function call
6556*/
6557WDI_Status
6558WDI_ProcessInitScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006559(
Jeff Johnson295189b2012-06-20 16:38:30 -07006560 WDI_ControlBlockType* pWDICtx,
6561 WDI_EventInfoType* pEventData
6562)
6563{
6564 WDI_InitScanReqParamsType* pwdiInitScanParams = NULL;
6565 WDI_InitScanRspCb wdiInitScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006566 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006567 wpt_uint16 usDataOffset = 0;
6568 wpt_uint16 usSendSize = 0;
6569 wpt_uint8 i = 0;
6570
6571 tHalInitScanReqMsg halInitScanReqMsg;
6572
Jeff Johnsone7245742012-09-05 17:12:55 -07006573 /*This is temporary fix.
Jeff Johnson295189b2012-06-20 16:38:30 -07006574 * It shold be removed once host and riva changes are in sync*/
6575 tHalInitScanConReqMsg halInitScanConReqMsg;
6576
6577 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6578
6579 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006580 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006581 -------------------------------------------------------------------------*/
6582 if (( NULL == pEventData ) ||
6583 ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) ||
6584 ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc)))
6585 {
6586 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6587 "%s: Invalid parameters", __FUNCTION__);
6588 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006589 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006590 }
6591
6592#if 0
6593 wpalMutexAcquire(&pWDICtx->wptMutex);
6594 /*-----------------------------------------------------------------------
6595 Check to see if SCAN is already in progress - if so reject the req
6596 We only allow one scan at a time
Jeff Johnsone7245742012-09-05 17:12:55 -07006597 ! TO DO: - revisit this constraint
Jeff Johnson295189b2012-06-20 16:38:30 -07006598 -----------------------------------------------------------------------*/
6599 if ( pWDICtx->bScanInProgress )
6600 {
6601 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6602 "Scan is already in progress - subsequent scan is not allowed"
6603 " until the first scan completes");
6604
6605 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006606 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006607 }
6608
Jeff Johnsone7245742012-09-05 17:12:55 -07006609 pWDICtx->bScanInProgress = eWLAN_PAL_TRUE;
6610 pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006611
6612 wpalMutexRelease(&pWDICtx->wptMutex);
6613#endif
6614
6615 if (pwdiInitScanParams->wdiReqInfo.bUseNOA)
6616 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006617 /*This is temporary fix.
Jeff Johnson295189b2012-06-20 16:38:30 -07006618 * It shold be removed once host and riva changes are in sync*/
6619 /*-----------------------------------------------------------------------
6620 Get message buffer
6621 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006622 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006623 sizeof(halInitScanConReqMsg.initScanParams),
6624 &pSendBuffer, &usDataOffset, &usSendSize))||
6625 ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) )))
6626 {
6627 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6628 "Unable to get send buffer in init scan req %x %x %x",
6629 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6630 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006631 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006632 }
6633
6634
6635 /*-----------------------------------------------------------------------
6636 Fill in the message
6637 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006638 halInitScanConReqMsg.initScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07006639 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6640
6641 wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid,
6642 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6643
Jeff Johnsone7245742012-09-05 17:12:55 -07006644 halInitScanConReqMsg.initScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07006645 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
Jeff Johnsone7245742012-09-05 17:12:55 -07006646 halInitScanConReqMsg.initScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07006647 pwdiInitScanParams->wdiReqInfo.ucFrameType;
Jeff Johnsone7245742012-09-05 17:12:55 -07006648 halInitScanConReqMsg.initScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07006649 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6650
6651 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr,
6652 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6653
6654#ifdef WLAN_FEATURE_P2P
6655 halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA;
6656 halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration;
6657#endif
6658
Jeff Johnsone7245742012-09-05 17:12:55 -07006659 halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07006660 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6661
6662 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6663 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006664 halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07006665 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6666 }
6667
Jeff Johnsone7245742012-09-05 17:12:55 -07006668 wpalMemoryCopy( pSendBuffer+usDataOffset,
6669 &halInitScanConReqMsg.initScanParams,
6670 sizeof(halInitScanConReqMsg.initScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006671 }
6672 else
6673 {
6674 /*-----------------------------------------------------------------------
6675 Get message buffer
6676 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006677 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006678 sizeof(halInitScanReqMsg.initScanParams),
6679 &pSendBuffer, &usDataOffset, &usSendSize))||
6680 ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) )))
6681 {
6682 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6683 "Unable to get send buffer in init scan req %x %x %x",
6684 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6685 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006686 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006687 }
6688
6689
6690 /*-----------------------------------------------------------------------
6691 Fill in the message
6692 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006693 halInitScanReqMsg.initScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07006694 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6695
6696 wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid,
6697 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6698
Jeff Johnsone7245742012-09-05 17:12:55 -07006699 halInitScanReqMsg.initScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07006700 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
Jeff Johnsone7245742012-09-05 17:12:55 -07006701 halInitScanReqMsg.initScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07006702 pwdiInitScanParams->wdiReqInfo.ucFrameType;
Jeff Johnsone7245742012-09-05 17:12:55 -07006703 halInitScanReqMsg.initScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07006704 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6705
6706 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr,
6707 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6708
Jeff Johnsone7245742012-09-05 17:12:55 -07006709 halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07006710 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6711
6712 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6713 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006714 halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07006715 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6716 }
6717
Jeff Johnsone7245742012-09-05 17:12:55 -07006718 wpalMemoryCopy( pSendBuffer+usDataOffset,
6719 &halInitScanReqMsg.initScanParams,
6720 sizeof(halInitScanReqMsg.initScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006721 }
6722
6723 pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006724 pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006725
6726 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006727 Send Init Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006728 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006729 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006730 wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP);
6731
6732}/*WDI_ProcessInitScanReq*/
6733
6734/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006735 @brief Process Start Scan Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07006736 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006737
6738 @param pWDICtx: pointer to the WLAN DAL context
6739 pEventData: pointer to the event information structure
6740
Jeff Johnson295189b2012-06-20 16:38:30 -07006741 @see
6742 @return Result of the function call
6743*/
6744WDI_Status
6745WDI_ProcessStartScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006746(
Jeff Johnson295189b2012-06-20 16:38:30 -07006747 WDI_ControlBlockType* pWDICtx,
6748 WDI_EventInfoType* pEventData
6749)
6750{
6751 WDI_StartScanReqParamsType* pwdiStartScanParams = NULL;
6752 WDI_StartScanRspCb wdiStartScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006753 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006754 wpt_uint16 usDataOffset = 0;
6755 wpt_uint16 usSendSize = 0;
6756
Jeff Johnsone7245742012-09-05 17:12:55 -07006757 tHalStartScanReqMsg halStartScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006758 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6759
6760 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006761 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006762 -------------------------------------------------------------------------*/
6763 if (( NULL == pEventData ) ||
6764 ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) ||
6765 ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc)))
6766 {
6767 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6768 "%s: Invalid parameters", __FUNCTION__);
6769 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006770 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006771 }
6772
6773#if 0
6774 wpalMutexAcquire(&pWDICtx->wptMutex);
6775 /*-----------------------------------------------------------------------
6776 Check to see if SCAN is already in progress - start scan is only
6777 allowed when a scan is ongoing and the state of the scan procedure
Jeff Johnsone7245742012-09-05 17:12:55 -07006778 is either init or end
Jeff Johnson295189b2012-06-20 16:38:30 -07006779 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006780 if (( !pWDICtx->bScanInProgress ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07006781 (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) &&
6782 ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState )))
6783 {
6784 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6785 "Scan start not allowed in this state %d %d",
6786 pWDICtx->bScanInProgress, pWDICtx->uScanState);
Jeff Johnsone7245742012-09-05 17:12:55 -07006787
Jeff Johnson295189b2012-06-20 16:38:30 -07006788 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006789 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006790 }
6791
Jeff Johnsone7245742012-09-05 17:12:55 -07006792 pWDICtx->uScanState = WDI_SCAN_STARTED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006793
6794 wpalMutexRelease(&pWDICtx->wptMutex);
6795#endif
6796
6797 /*-----------------------------------------------------------------------
6798 Get message buffer
6799 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006800 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006801 sizeof(halStartScanReqMsg.startScanParams),
6802 &pSendBuffer, &usDataOffset, &usSendSize))||
6803 ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) )))
6804 {
6805 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6806 "Unable to get send buffer in start scan req %x %x %x",
6807 pEventData, pwdiStartScanParams, wdiStartScanRspCb);
6808 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006809 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006810 }
6811
Jeff Johnsone7245742012-09-05 17:12:55 -07006812 halStartScanReqMsg.startScanParams.scanChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07006813 pwdiStartScanParams->ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -07006814 wpalMemoryCopy( pSendBuffer+usDataOffset,
6815 &halStartScanReqMsg.startScanParams,
6816 sizeof(halStartScanReqMsg.startScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006817
6818 pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006819 pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006820
6821 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006822 Send Start Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006823 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006824 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006825 wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP);
6826}/*WDI_ProcessStartScanReq*/
6827
6828
6829/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006830 @brief Process End Scan Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006831 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006832
6833 @param pWDICtx: pointer to the WLAN DAL context
6834 pEventData: pointer to the event information structure
6835
Jeff Johnson295189b2012-06-20 16:38:30 -07006836 @see
6837 @return Result of the function call
6838*/
6839WDI_Status
6840WDI_ProcessEndScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006841(
Jeff Johnson295189b2012-06-20 16:38:30 -07006842 WDI_ControlBlockType* pWDICtx,
6843 WDI_EventInfoType* pEventData
6844)
6845{
6846 WDI_EndScanReqParamsType* pwdiEndScanParams = NULL;
6847 WDI_EndScanRspCb wdiEndScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006848 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006849 wpt_uint16 usDataOffset = 0;
6850 wpt_uint16 usSendSize = 0;
6851
Jeff Johnsone7245742012-09-05 17:12:55 -07006852 tHalEndScanReqMsg halEndScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006853 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6854
6855 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006856 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006857 -------------------------------------------------------------------------*/
6858 if (( NULL == pEventData ) ||
6859 ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) ||
6860 ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc)))
6861 {
6862 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6863 "%s: Invalid parameters", __FUNCTION__);
6864 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006865 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006866 }
6867
Jeff Johnsone7245742012-09-05 17:12:55 -07006868 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6869 * sometimes because of this check the scan request is not being
Jeff Johnson295189b2012-06-20 16:38:30 -07006870 * forwarded to HAL and result in hang*/
6871#if 0
6872 wpalMutexAcquire(&pWDICtx->wptMutex);
6873 /*-----------------------------------------------------------------------
6874 Check to see if SCAN is already in progress - end scan is only
6875 allowed when a scan is ongoing and the state of the scan procedure
6876 is started
6877 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006878 if (( !pWDICtx->bScanInProgress ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07006879 ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState ))
6880 {
6881 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6882 "End start not allowed in this state %d %d",
6883 pWDICtx->bScanInProgress, pWDICtx->uScanState);
Jeff Johnsone7245742012-09-05 17:12:55 -07006884
Jeff Johnson295189b2012-06-20 16:38:30 -07006885 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006886 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006887 }
6888
Jeff Johnsone7245742012-09-05 17:12:55 -07006889 pWDICtx->uScanState = WDI_SCAN_ENDED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006890
6891 wpalMutexRelease(&pWDICtx->wptMutex);
6892#endif
6893
6894 /*-----------------------------------------------------------------------
6895 Get message buffer
6896 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006897 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006898 sizeof(halEndScanReqMsg.endScanParams),
6899 &pSendBuffer, &usDataOffset, &usSendSize))||
6900 ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) )))
6901 {
6902 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6903 "Unable to get send buffer in start scan req %x %x %x",
6904 pEventData, pwdiEndScanParams, wdiEndScanRspCb);
6905 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006906 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006907 }
6908
6909 halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel;
6910
Jeff Johnsone7245742012-09-05 17:12:55 -07006911 wpalMemoryCopy( pSendBuffer+usDataOffset,
6912 &halEndScanReqMsg.endScanParams,
6913 sizeof(halEndScanReqMsg.endScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006914
6915 pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006916 pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006917
6918 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006919 Send End Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006920 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006921 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006922 wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP);
6923}/*WDI_ProcessEndScanReq*/
6924
6925
6926/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006927 @brief Process Finish Scan Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07006928 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006929
6930 @param pWDICtx: pointer to the WLAN DAL context
6931 pEventData: pointer to the event information structure
6932
Jeff Johnson295189b2012-06-20 16:38:30 -07006933 @see
6934 @return Result of the function call
6935*/
6936WDI_Status
6937WDI_ProcessFinishScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006938(
Jeff Johnson295189b2012-06-20 16:38:30 -07006939 WDI_ControlBlockType* pWDICtx,
6940 WDI_EventInfoType* pEventData
6941)
6942{
6943 WDI_FinishScanReqParamsType* pwdiFinishScanParams;
6944 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07006945 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006946 wpt_uint16 usDataOffset = 0;
6947 wpt_uint16 usSendSize = 0;
6948 wpt_uint8 i = 0;
6949
Jeff Johnsone7245742012-09-05 17:12:55 -07006950 tHalFinishScanReqMsg halFinishScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006951 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6952
6953 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006954 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006955 -------------------------------------------------------------------------*/
6956 if (( NULL == pEventData ) ||
6957 ( NULL == pEventData->pEventData) ||
6958 ( NULL == pEventData->pCBfnc))
6959 {
6960 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6961 "%s: Invalid parameters", __FUNCTION__);
6962 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006963 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006964 }
6965
6966 pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData;
6967 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -07006968 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6969 * sometimes because of this check the scan request is not being
Jeff Johnson295189b2012-06-20 16:38:30 -07006970 * forwarded to HAL and result in hang*/
6971#if 0
6972 wpalMutexAcquire(&pWDICtx->wptMutex);
6973 /*-----------------------------------------------------------------------
6974 Check to see if SCAN is already in progress
6975 Finish scan gets invoked any scan states. ie. abort scan
6976 It should be allowed in any states.
6977 -----------------------------------------------------------------------*/
6978 if ( !pWDICtx->bScanInProgress )
6979 {
6980 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6981 "Finish start not allowed in this state %d",
6982 pWDICtx->bScanInProgress );
6983
6984 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006985 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006986 }
6987
6988 /*-----------------------------------------------------------------------
6989 It is safe to reset the scan flags here because until the response comes
Jeff Johnsone7245742012-09-05 17:12:55 -07006990 back all subsequent requests will be blocked at BUSY state
Jeff Johnson295189b2012-06-20 16:38:30 -07006991 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006992 pWDICtx->uScanState = WDI_SCAN_FINISHED_ST;
6993 pWDICtx->bScanInProgress = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006994 wpalMutexRelease(&pWDICtx->wptMutex);
6995#endif
6996
6997 if ( pWDICtx->bInBmps )
6998 {
6999 // notify DTS that we are entering BMPS
7000 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL);
7001 }
7002
7003 /*-----------------------------------------------------------------------
7004 Get message buffer
7005 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007006 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007007 sizeof(halFinishScanReqMsg.finishScanParams),
7008 &pSendBuffer, &usDataOffset, &usSendSize))||
7009 ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) )))
7010 {
7011 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7012 "Unable to get send buffer in start scan req %x %x %x",
7013 pEventData, pwdiFinishScanParams, wdiFinishScanRspCb);
7014 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007015 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007016 }
7017
Jeff Johnsone7245742012-09-05 17:12:55 -07007018 halFinishScanReqMsg.finishScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07007019 WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode);
7020
Jeff Johnsone7245742012-09-05 17:12:55 -07007021 halFinishScanReqMsg.finishScanParams.currentOperChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07007022 pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel;
7023
Jeff Johnsone7245742012-09-05 17:12:55 -07007024 halFinishScanReqMsg.finishScanParams.cbState =
Jeff Johnson295189b2012-06-20 16:38:30 -07007025 WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState);
7026
7027 wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid,
7028 pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
7029
Jeff Johnsone7245742012-09-05 17:12:55 -07007030 halFinishScanReqMsg.finishScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07007031 pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ;
Jeff Johnsone7245742012-09-05 17:12:55 -07007032 halFinishScanReqMsg.finishScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07007033 pwdiFinishScanParams->wdiReqInfo.ucFrameType ;
Jeff Johnsone7245742012-09-05 17:12:55 -07007034 halFinishScanReqMsg.finishScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07007035 pwdiFinishScanParams->wdiReqInfo.ucFrameLength ;
7036
Jeff Johnsone7245742012-09-05 17:12:55 -07007037 halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07007038 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ;
7039
7040 for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
7041 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007042 halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07007043 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ;
7044 }
7045
7046 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr,
7047 &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr);
7048
Jeff Johnsone7245742012-09-05 17:12:55 -07007049 wpalMemoryCopy( pSendBuffer+usDataOffset,
7050 &halFinishScanReqMsg.finishScanParams,
7051 sizeof(halFinishScanReqMsg.finishScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007052
7053 pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007054 pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007055
7056 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007057 Send Finish Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007058 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007059 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007060 wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP);
7061}/*WDI_ProcessFinishScanReq*/
7062
7063
7064/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007065 ASSOCIATION REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07007066==========================================================================*/
7067/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007068 @brief Process BSS Join for a given Session
7069
7070 @param pWDICtx: pointer to the WLAN DAL context
7071 pEventData: pointer to the event information structure
7072
Jeff Johnson295189b2012-06-20 16:38:30 -07007073 @see
7074 @return Result of the function call
7075*/
7076WDI_Status
7077WDI_ProcessBSSSessionJoinReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007078(
Jeff Johnson295189b2012-06-20 16:38:30 -07007079 WDI_ControlBlockType* pWDICtx,
7080 WDI_JoinReqParamsType* pwdiJoinParams,
7081 WDI_JoinRspCb wdiJoinRspCb,
7082 void* pUserData
7083)
7084{
7085 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007086 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007087 wpt_uint16 usDataOffset = 0;
7088 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007089 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007090
Jeff Johnsone7245742012-09-05 17:12:55 -07007091 tHalJoinReqMsg halJoinReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007092 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7093
7094 /*------------------------------------------------------------------------
7095 Check to see if we have any session with this BSSID already stored, we
7096 should not
7097 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007098 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7099 pwdiJoinParams->wdiReqInfo.macBSSID,
7100 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007101
7102 if ( NULL != pBSSSes )
7103 {
7104 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7105 "Association for this BSSID is already in place");
7106
Jeff Johnsone7245742012-09-05 17:12:55 -07007107 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007108 }
7109
7110 wpalMutexAcquire(&pWDICtx->wptMutex);
7111 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007112 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007113 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007114 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007115 if ( NULL == pBSSSes )
7116 {
7117
7118 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7119 "DAL has no free sessions - cannot run another join");
7120
7121 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007122 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007123 }
7124
7125 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007126 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7127 wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007128 WDI_MAC_ADDR_LEN);
7129
7130 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007131 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007132 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -07007133
Jeff Johnson295189b2012-06-20 16:38:30 -07007134 wpalMutexRelease(&pWDICtx->wptMutex);
7135
7136 /*-----------------------------------------------------------------------
7137 Get message buffer
7138 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007139 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007140 sizeof(halJoinReqMsg.joinReqParams),
7141 &pSendBuffer, &usDataOffset, &usSendSize))||
7142 ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) )))
7143 {
7144 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7145 "Unable to get send buffer in join req %x %x %x",
7146 pUserData, pwdiJoinParams, wdiJoinRspCb);
7147 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007148 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007149 }
7150
7151 wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -07007152 pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07007153
7154 wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr,
Jeff Johnsone7245742012-09-05 17:12:55 -07007155 pwdiJoinParams->wdiReqInfo.macSTASelf,
7156 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07007157
Jeff Johnsone7245742012-09-05 17:12:55 -07007158 halJoinReqMsg.joinReqParams.ucChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07007159 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel;
7160
7161 halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState;
7162
7163#ifndef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -07007164 halJoinReqMsg.joinReqParams.ucLocalPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -07007165 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint;
7166#endif
7167
Jeff Johnsone7245742012-09-05 17:12:55 -07007168 halJoinReqMsg.joinReqParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -07007169 WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo.
7170 wdiSecondaryChannelOffset);
7171
Jeff Johnsone7245742012-09-05 17:12:55 -07007172 wpalMemoryCopy( pSendBuffer+usDataOffset,
7173 &halJoinReqMsg.joinReqParams,
7174 sizeof(halJoinReqMsg.joinReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007175
7176 pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007177 pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007178
7179 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007180 Send Join Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007181 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007182 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7183 wdiJoinRspCb, pUserData, WDI_JOIN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07007184
7185}/*WDI_ProcessBSSSessionJoinReq*/
7186
7187/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007188 @brief Process Join Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007189 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007190
7191 @param pWDICtx: pointer to the WLAN DAL context
7192 pEventData: pointer to the event information structure
7193
Jeff Johnson295189b2012-06-20 16:38:30 -07007194 @see
7195 @return Result of the function call
7196*/
7197WDI_Status
7198WDI_ProcessJoinReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007199(
Jeff Johnson295189b2012-06-20 16:38:30 -07007200 WDI_ControlBlockType* pWDICtx,
7201 WDI_EventInfoType* pEventData
7202)
7203{
7204 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7205 WDI_JoinReqParamsType* pwdiJoinParams = NULL;
7206 WDI_JoinRspCb wdiJoinRspCb = NULL;
7207 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7208
7209 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007210 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007211 -------------------------------------------------------------------------*/
7212 if (( NULL == pEventData ) ||
7213 ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) ||
7214 ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc)))
7215 {
7216 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7217 "%s: Invalid parameters", __FUNCTION__);
7218 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007219 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007220 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007221
Jeff Johnson295189b2012-06-20 16:38:30 -07007222 /*-------------------------------------------------------------------------
7223 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007224 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007225 -------------------------------------------------------------------------*/
7226 wpalMutexAcquire(&pWDICtx->wptMutex);
7227
7228 if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress )
7229 {
7230 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7231 "Association is currently in progress, queueing new join req");
7232
7233 /*Association is in progress - queue current one*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007234 wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007235 pwdiJoinParams->wdiReqInfo.macBSSID);
7236
7237 wpalMutexRelease(&pWDICtx->wptMutex);
7238
Jeff Johnsone7245742012-09-05 17:12:55 -07007239 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007240 }
7241
7242 /*Starting a new association */
7243 pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE;
7244 wpalMutexRelease(&pWDICtx->wptMutex);
7245
7246 /*Process the Join Request*/
7247 return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams,
7248 wdiJoinRspCb,pEventData->pUserData);
7249
7250}/*WDI_ProcessJoinReq*/
7251
7252
7253/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007254 @brief Process Config BSS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007255 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007256
7257 @param pWDICtx: pointer to the WLAN DAL context
7258 pEventData: pointer to the event information structure
7259
Jeff Johnson295189b2012-06-20 16:38:30 -07007260 @see
7261 @return Result of the function call
7262*/
7263WDI_Status
7264WDI_ProcessConfigBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007265(
Jeff Johnson295189b2012-06-20 16:38:30 -07007266 WDI_ControlBlockType* pWDICtx,
7267 WDI_EventInfoType* pEventData
7268)
7269{
7270 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams;
7271 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007272 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007273 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007274 wpt_uint16 uMsgSize = 0;
7275 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007276 wpt_uint16 usDataOffset = 0;
7277 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007278 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007279
Jeff Johnsone7245742012-09-05 17:12:55 -07007280 tConfigBssReqMsg halConfigBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007281 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7282
7283 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007284 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007285 -------------------------------------------------------------------------*/
7286 if (( NULL == pEventData ) ||
7287 ( NULL == pEventData->pEventData ) ||
7288 ( NULL == pEventData->pCBfnc ))
7289 {
7290 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7291 "%s: Invalid parameters", __FUNCTION__);
7292 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007293 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007294 }
7295
7296 pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData;
7297 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc;
7298 /*-------------------------------------------------------------------------
7299 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007300 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007301 -------------------------------------------------------------------------*/
7302 wpalMutexAcquire(&pWDICtx->wptMutex);
7303
7304 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007305 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007306 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007307 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7308 pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7309 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007310
Jeff Johnsone7245742012-09-05 17:12:55 -07007311 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007312 {
7313#ifdef WLAN_FEATURE_VOWIFI_11R
7314 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007315 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007316 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007317 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007318 if ( NULL == pBSSSes )
7319 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007320
Jeff Johnson295189b2012-06-20 16:38:30 -07007321 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7322 "DAL has no free sessions - cannot run another join");
Jeff Johnsone7245742012-09-05 17:12:55 -07007323
Jeff Johnson295189b2012-06-20 16:38:30 -07007324 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007325 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007326 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007327
Jeff Johnson295189b2012-06-20 16:38:30 -07007328 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007329 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7330 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007331 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07007332
Jeff Johnson295189b2012-06-20 16:38:30 -07007333 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007334 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007335 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7336#else
Jeff Johnsone7245742012-09-05 17:12:55 -07007337 /* If the BSS type is IBSS create the session here as there is no Join
Jeff Johnson295189b2012-06-20 16:38:30 -07007338 * Request in case of IBSS*/
7339 if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) ||
7340 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) ||
7341 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) ||
7342 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE))
7343 {
7344 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007345 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007346 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007347 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007348 if ( NULL == pBSSSes )
7349 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007350
Jeff Johnson295189b2012-06-20 16:38:30 -07007351 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7352 "DAL has no free sessions - cannot run another join");
Jeff Johnsone7245742012-09-05 17:12:55 -07007353
Jeff Johnson295189b2012-06-20 16:38:30 -07007354 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007355 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007356 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007357
Jeff Johnson295189b2012-06-20 16:38:30 -07007358 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007359 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7360 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007361 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07007362
Jeff Johnson295189b2012-06-20 16:38:30 -07007363 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007364 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007365 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7366 }
7367 else
7368 {
7369 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007370 "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d",
7371 __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID),
7372 pwdiConfigBSSParams->wdiReqInfo.wdiBSSType);
7373
Jeff Johnson295189b2012-06-20 16:38:30 -07007374 /* for IBSS testing */
7375 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007376 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007377 }
7378#endif
7379 }
7380
7381 /*------------------------------------------------------------------------
7382 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007383 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007384 ------------------------------------------------------------------------*/
7385 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7386 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007387 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7388 "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d",
7389 __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID),
7390 ucCurrentBSSSesIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007391
Jeff Johnsone7245742012-09-05 17:12:55 -07007392 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007393
7394 wpalMutexRelease(&pWDICtx->wptMutex);
7395
Jeff Johnsone7245742012-09-05 17:12:55 -07007396 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007397 }
7398
7399 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07007400 wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq,
7401 pwdiConfigBSSParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007402 sizeof(pWDICtx->wdiCachedConfigBssReq));
7403
7404 wpalMutexRelease(&pWDICtx->wptMutex);
7405
Jeff Johnsone7245742012-09-05 17:12:55 -07007406 /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */
7407#ifdef WLAN_FEATURE_11AC
7408 if (WDI_getFwWlanFeatCaps(DOT11AC))
7409 uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC
7410 else
7411#endif
7412 uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure
Jeff Johnson295189b2012-06-20 16:38:30 -07007413
7414 /*-----------------------------------------------------------------------
7415 Get message buffer
7416 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007417 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007418 uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))||
7419 ( usSendSize < (usDataOffset + uMsgSize )))
7420 {
7421 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7422 "Unable to get send buffer in config bss req %x %x %x",
7423 pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb);
7424 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007425 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007426 }
7427
7428 /*Copy the BSS request */
Jeff Johnsone7245742012-09-05 17:12:55 -07007429 WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007430 &pwdiConfigBSSParams->wdiReqInfo);
7431
7432 /* Need to fill in the STA Index to invalid, since at this point we have not
7433 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -07007434 halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -07007435
7436 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007437 halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx;
7438
7439 wpalMemoryCopy( pSendBuffer+usDataOffset,
7440 &halConfigBssReqMsg.uBssParams.configBssParams,
7441 uMsgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07007442
7443 pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007444 pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007445
7446 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007447 Send Config BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007448 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007449 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7450 wdiConfigBSSRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007451 WDI_CONFIG_BSS_RESP);
7452
7453}/*WDI_ProcessConfigBSSReq*/
7454
7455
7456/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007457 @brief Process Del BSS Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007458 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007459
7460 @param pWDICtx: pointer to the WLAN DAL context
7461 pEventData: pointer to the event information structure
7462
Jeff Johnson295189b2012-06-20 16:38:30 -07007463 @see
7464 @return Result of the function call
7465*/
7466WDI_Status
7467WDI_ProcessDelBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007468(
Jeff Johnson295189b2012-06-20 16:38:30 -07007469 WDI_ControlBlockType* pWDICtx,
7470 WDI_EventInfoType* pEventData
7471)
7472{
7473 WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL;
7474 WDI_DelBSSRspCb wdiDelBSSRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007475 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007476 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007477 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007478 wpt_uint16 usDataOffset = 0;
7479 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007480 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007481
Jeff Johnsone7245742012-09-05 17:12:55 -07007482 tDeleteBssReqMsg halBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007483 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7484
7485 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007486 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007487 -------------------------------------------------------------------------*/
7488 if (( NULL == pEventData ) ||
7489 ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) ||
7490 ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc)))
7491 {
7492 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7493 "%s: Invalid parameters", __FUNCTION__);
7494 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007495 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007496 }
7497
7498 /*-------------------------------------------------------------------------
7499 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007500 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007501 -------------------------------------------------------------------------*/
7502 wpalMutexAcquire(&pWDICtx->wptMutex);
7503
7504 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007505 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007506 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007507 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7508 pwdiDelBSSParams->ucBssIdx,
7509 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007510
Jeff Johnsone7245742012-09-05 17:12:55 -07007511 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007512 {
7513 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007514 "%s: BSS does not yet exist. ucBssIdx %d",
7515 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007516
7517 wpalMutexRelease(&pWDICtx->wptMutex);
7518
Jeff Johnsone7245742012-09-05 17:12:55 -07007519 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007520 }
7521
7522 /*------------------------------------------------------------------------
7523 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007524 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007525 ------------------------------------------------------------------------*/
7526 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7527 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007528 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7529 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
7530 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007531
Jeff Johnsone7245742012-09-05 17:12:55 -07007532 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007533
7534 wpalMutexRelease(&pWDICtx->wptMutex);
7535
Jeff Johnsone7245742012-09-05 17:12:55 -07007536 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007537 }
7538
7539 /*-----------------------------------------------------------------------
7540 If we receive a Del BSS request for an association that is already in
7541 progress, it indicates that the assoc has failed => we no longer have
7542 an association in progress => we must check for pending associations
Jeff Johnsone7245742012-09-05 17:12:55 -07007543 that were queued and start as soon as the Del BSS response is received
Jeff Johnson295189b2012-06-20 16:38:30 -07007544 -----------------------------------------------------------------------*/
7545 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
7546 {
7547 /*We can switch to false here because even if a subsequent Join comes in
7548 it will only be processed when DAL transitions out of BUSY state which
7549 happens when the Del BSS request comes */
7550 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
7551
7552 /*Former association is complete - prepare next pending assoc for
7553 processing */
7554 WDI_DequeueAssocRequest(pWDICtx);
7555 }
7556
7557 wpalMutexRelease(&pWDICtx->wptMutex);
7558 /*-----------------------------------------------------------------------
7559 Get message buffer
7560 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007561 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007562 sizeof(halBssReqMsg.deleteBssParams),
7563 &pSendBuffer, &usDataOffset, &usSendSize))||
7564 ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) )))
7565 {
7566 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7567 "Unable to get send buffer in start req %x %x %x",
7568 pEventData, pwdiDelBSSParams, wdiDelBSSRspCb);
7569 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007570 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007571 }
7572
7573 /*Fill in the message request structure*/
7574
7575 /*BSS Index is saved on config BSS response and Post Assoc Response */
Jeff Johnsone7245742012-09-05 17:12:55 -07007576 halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07007577
Jeff Johnsone7245742012-09-05 17:12:55 -07007578 wpalMemoryCopy( pSendBuffer+usDataOffset,
7579 &halBssReqMsg.deleteBssParams,
7580 sizeof(halBssReqMsg.deleteBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007581
7582 pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007583 pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007584
Jeff Johnsone7245742012-09-05 17:12:55 -07007585
Jeff Johnson295189b2012-06-20 16:38:30 -07007586 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007587 Send Del BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007588 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007589 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007590 wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP);
7591
Jeff Johnsone7245742012-09-05 17:12:55 -07007592
Jeff Johnson295189b2012-06-20 16:38:30 -07007593}/*WDI_ProcessDelBSSReq*/
7594
7595/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007596 @brief Process Post Assoc Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007597 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007598
7599 @param pWDICtx: pointer to the WLAN DAL context
7600 pEventData: pointer to the event information structure
7601
Jeff Johnson295189b2012-06-20 16:38:30 -07007602 @see
7603 @return Result of the function call
7604*/
7605WDI_Status
7606WDI_ProcessPostAssocReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007607(
Jeff Johnson295189b2012-06-20 16:38:30 -07007608 WDI_ControlBlockType* pWDICtx,
7609 WDI_EventInfoType* pEventData
7610)
7611{
7612 WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL;
7613 WDI_PostAssocRspCb wdiPostAssocRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007614 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007615 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007616 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007617 wpt_uint16 usDataOffset = 0;
7618 wpt_uint16 usSendSize = 0;
7619 wpt_uint16 uMsgSize = 0;
7620 wpt_uint16 uOffset = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007621 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007622
Jeff Johnsone7245742012-09-05 17:12:55 -07007623 tPostAssocReqMsg halPostAssocReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007624 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7625
7626 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007627 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007628 -------------------------------------------------------------------------*/
7629 if (( NULL == pEventData ) ||
7630 ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) ||
7631 ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc)))
7632 {
7633 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7634 "%s: Invalid parameters", __FUNCTION__);
7635 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007636 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007637 }
7638
7639 /*-------------------------------------------------------------------------
7640 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007641 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007642 -------------------------------------------------------------------------*/
7643 wpalMutexAcquire(&pWDICtx->wptMutex);
7644
7645 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007646 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007647 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007648 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7649 pwdiPostAssocParams->wdiBSSParams.macBSSID,
7650 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007651
7652 if ( NULL == pBSSSes )
7653 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007654 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7655 "%s: Association sequence for this BSS does not yet exist - "
7656 "operation not allowed. macBSSID " MAC_ADDRESS_STR,
7657 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007658
7659 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007660 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007661 }
7662
7663 /*------------------------------------------------------------------------
7664 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007665 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007666 ------------------------------------------------------------------------*/
7667 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7668 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007669 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7670 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7671 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007672
Jeff Johnsone7245742012-09-05 17:12:55 -07007673 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007674
7675 wpalMutexRelease(&pWDICtx->wptMutex);
7676
Jeff Johnsone7245742012-09-05 17:12:55 -07007677 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007678 }
7679
7680 /*-----------------------------------------------------------------------
7681 If Post Assoc was not yet received - the current association must
7682 be in progress
7683 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007684 if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07007685 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
7686 {
7687 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7688 "Association sequence for this BSS association no longer in "
7689 "progress - not allowed");
7690
7691 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007692 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007693 }
7694
7695 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007696 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -07007697 -----------------------------------------------------------------------*/
7698 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
7699 {
7700 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7701 "Post Assoc not allowed before JOIN - failing request");
7702
7703 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007704 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007705 }
7706
7707 wpalMutexRelease(&pWDICtx->wptMutex);
7708
7709 uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) +
7710 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ;
7711 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007712 Fill message for tx over the bus
Jeff Johnson295189b2012-06-20 16:38:30 -07007713 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007714 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007715 uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))||
7716 ( usSendSize < (usDataOffset + uMsgSize )))
7717 {
7718 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7719 "Unable to get send buffer in start req %x %x %x",
7720 pEventData, pwdiPostAssocParams, wdiPostAssocRspCb);
7721 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007722 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007723 }
7724
7725 /*Copy the STA parameters */
7726 WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams,
7727 &pwdiPostAssocParams->wdiSTAParams );
7728
7729 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007730 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007731 WDI_STATableFindStaidByAddr(pWDICtx,
7732 pwdiPostAssocParams->wdiSTAParams.macSTA,
7733 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx ))
7734 {
7735 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7736 "This station does not exist in the WDI Station Table %d");
7737 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007738 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007739 }
7740
7741 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007742 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007743 pBSSSes->ucBSSIdx;
7744
7745 /*Copy the BSS parameters */
7746 WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7747 &pwdiPostAssocParams->wdiBSSParams);
7748
7749 /* Need to fill in the STA index of the peer */
Jeff Johnsone7245742012-09-05 17:12:55 -07007750 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007751 WDI_STATableFindStaidByAddr(pWDICtx,
7752 pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -07007753 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx))
Jeff Johnson295189b2012-06-20 16:38:30 -07007754 {
7755 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7756 "This station does not exist in the WDI Station Table %d");
7757 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007758 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007759 }
7760
7761 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007762 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007763 pBSSSes->ucBSSIdx;
7764
Jeff Johnsone7245742012-09-05 17:12:55 -07007765
7766 wpalMemoryCopy( pSendBuffer+usDataOffset,
7767 &halPostAssocReqMsg.postAssocReqParams.configStaParams,
7768 sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007769
7770 uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams);
7771
Jeff Johnsone7245742012-09-05 17:12:55 -07007772 wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset,
7773 &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7774 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007775
Jeff Johnsone7245742012-09-05 17:12:55 -07007776
Jeff Johnson295189b2012-06-20 16:38:30 -07007777 pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007778 pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007779
Jeff Johnsone7245742012-09-05 17:12:55 -07007780
7781 wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq,
Jeff Johnson295189b2012-06-20 16:38:30 -07007782 pwdiPostAssocParams,
Jeff Johnsone7245742012-09-05 17:12:55 -07007783 sizeof(pWDICtx->wdiCachedPostAssocReq));
Jeff Johnson295189b2012-06-20 16:38:30 -07007784
7785 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007786 Send Post Assoc Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007787 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007788 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007789 wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP);
7790
Jeff Johnsone7245742012-09-05 17:12:55 -07007791
Jeff Johnson295189b2012-06-20 16:38:30 -07007792}/*WDI_ProcessPostAssocReq*/
7793
7794/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007795 @brief Process Del STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007796 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007797
7798 @param pWDICtx: pointer to the WLAN DAL context
7799 pEventData: pointer to the event information structure
7800
Jeff Johnson295189b2012-06-20 16:38:30 -07007801 @see
7802 @return Result of the function call
7803*/
7804WDI_Status
7805WDI_ProcessDelSTAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007806(
Jeff Johnson295189b2012-06-20 16:38:30 -07007807 WDI_ControlBlockType* pWDICtx,
7808 WDI_EventInfoType* pEventData
7809)
7810{
7811 WDI_DelSTAReqParamsType* pwdiDelSTAParams;
7812 WDI_DelSTARspCb wdiDelSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007813 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007814 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007815 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007816 wpt_uint16 usDataOffset = 0;
7817 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007818 wpt_macAddr macBSSID;
Jeff Johnson295189b2012-06-20 16:38:30 -07007819 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7820
Jeff Johnsone7245742012-09-05 17:12:55 -07007821 tDeleteStaReqMsg halDelStaReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007822 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7823
7824 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007825 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007826 -------------------------------------------------------------------------*/
7827 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7828 ( NULL == pEventData->pCBfnc ))
7829 {
7830 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7831 "%s: Invalid parameters", __FUNCTION__);
7832 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007833 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007834 }
7835
7836 pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData;
7837 wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc;
7838 /*-------------------------------------------------------------------------
7839 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007840 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007841 -------------------------------------------------------------------------*/
7842 wpalMutexAcquire(&pWDICtx->wptMutex);
7843
7844 /*------------------------------------------------------------------------
7845 Find the BSS for which the request is made and identify WDI session
7846 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007847 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
7848 pwdiDelSTAParams->ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07007849 &macBSSID))
7850 {
7851 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7852 "This station does not exist in the WDI Station Table %d");
7853 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007854 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007855 }
7856
Jeff Johnsone7245742012-09-05 17:12:55 -07007857 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
7858 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007859 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007860 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7861 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
7862 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007863
7864 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007865 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007866 }
7867
7868 /*------------------------------------------------------------------------
7869 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007870 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007871 ------------------------------------------------------------------------*/
7872 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7873 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007874 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7875 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7876 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007877
Jeff Johnsone7245742012-09-05 17:12:55 -07007878 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007879 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007880 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007881 }
7882
7883 wpalMutexRelease(&pWDICtx->wptMutex);
7884 /*-----------------------------------------------------------------------
7885 Get message buffer
7886 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007887 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007888 sizeof(halDelStaReqMsg.delStaParams),
7889 &pSendBuffer, &usDataOffset, &usSendSize))||
7890 ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) )))
7891 {
7892 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7893 "Unable to get send buffer in start req %x %x %x",
7894 pEventData, pwdiDelSTAParams, wdiDelSTARspCb);
7895 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007896 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007897 }
7898
Jeff Johnsone7245742012-09-05 17:12:55 -07007899 halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx;
7900 wpalMemoryCopy( pSendBuffer+usDataOffset,
7901 &halDelStaReqMsg.delStaParams,
7902 sizeof(halDelStaReqMsg.delStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007903
7904 pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007905 pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007906
7907 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007908 Send Del STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007909 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007910 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007911 wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP);
7912
7913}/*WDI_ProcessDelSTAReq*/
7914
7915
7916/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007917 SECURITY REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07007918==========================================================================*/
7919/**
7920 @brief Process Set BSS Key Request function (called when Main FSM
7921 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007922
7923 @param pWDICtx: pointer to the WLAN DAL context
7924 pEventData: pointer to the event information structure
7925
Jeff Johnson295189b2012-06-20 16:38:30 -07007926 @see
7927 @return Result of the function call
7928*/
7929WDI_Status
7930WDI_ProcessSetBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007931(
Jeff Johnson295189b2012-06-20 16:38:30 -07007932 WDI_ControlBlockType* pWDICtx,
7933 WDI_EventInfoType* pEventData
7934)
7935{
7936 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams;
7937 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007938 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007939 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007940 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007941 wpt_uint16 usDataOffset = 0;
7942 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007943 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007944 tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}};
7945 wpt_uint8 keyIndex = 0;
7946
7947 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7948
7949 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007950 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007951 -------------------------------------------------------------------------*/
7952 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7953 ( NULL == pEventData->pCBfnc ))
7954 {
7955 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7956 "%s: Invalid parameters", __FUNCTION__);
7957 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007958 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007959 }
7960
7961 pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData;
7962 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc;
7963 /*-------------------------------------------------------------------------
7964 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007965 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007966 -------------------------------------------------------------------------*/
7967 wpalMutexAcquire(&pWDICtx->wptMutex);
7968
7969 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007970 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007971 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007972 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7973 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx,
7974 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007975
Jeff Johnsone7245742012-09-05 17:12:55 -07007976 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007977 {
7978 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007979 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
7980 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007981
7982 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007983 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007984 }
7985
7986 /*------------------------------------------------------------------------
7987 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007988 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007989 ------------------------------------------------------------------------*/
7990 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7991 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007992 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7993 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
7994 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007995
Jeff Johnsone7245742012-09-05 17:12:55 -07007996 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007997 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007998 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007999 }
8000
8001
8002 wpalMutexRelease(&pWDICtx->wptMutex);
8003 /*-----------------------------------------------------------------------
8004 Get message buffer
8005 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008006 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008007 sizeof(halSetBssKeyReqMsg.setBssKeyParams),
8008 &pSendBuffer, &usDataOffset, &usSendSize))||
8009 ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) )))
8010 {
8011 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8012 "Unable to get send buffer in set bss key req %x %x %x",
8013 pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb);
8014 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008015 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008016 }
8017
8018 /*-----------------------------------------------------------------------
8019 Copy the Key parameters into the HAL message
8020 -----------------------------------------------------------------------*/
8021
Jeff Johnsone7245742012-09-05 17:12:55 -07008022 halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008023
Jeff Johnsone7245742012-09-05 17:12:55 -07008024 halSetBssKeyReqMsg.setBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008025 WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType);
8026
Jeff Johnsone7245742012-09-05 17:12:55 -07008027 halSetBssKeyReqMsg.setBssKeyParams.numKeys =
Jeff Johnson295189b2012-06-20 16:38:30 -07008028 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys;
8029
8030 for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ;
8031 keyIndex++)
8032 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008033 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008034 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId;
8035 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast =
8036 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast;
8037 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection =
8038 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection;
8039 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008040 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008041 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008042 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008043 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008044 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008045 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength;
8046 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008047 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008048 WDI_MAX_KEY_LENGTH);
8049 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008050
8051 wpalMemoryCopy( pSendBuffer+usDataOffset,
8052 &halSetBssKeyReqMsg.setBssKeyParams,
8053 sizeof(halSetBssKeyReqMsg.setBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008054
8055 pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008056 pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008057
8058 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008059 Send Set BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008060 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008061 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8062 wdiSetBSSKeyRspCb, pEventData->pUserData,
8063 WDI_SET_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008064
8065}/*WDI_ProcessSetBssKeyReq*/
8066
8067/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008068 @brief Process Remove BSS Key Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07008069 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008070
8071 @param pWDICtx: pointer to the WLAN DAL context
8072 pEventData: pointer to the event information structure
8073
Jeff Johnson295189b2012-06-20 16:38:30 -07008074 @see
8075 @return Result of the function call
8076*/
8077WDI_Status
8078WDI_ProcessRemoveBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008079(
Jeff Johnson295189b2012-06-20 16:38:30 -07008080 WDI_ControlBlockType* pWDICtx,
8081 WDI_EventInfoType* pEventData
8082)
8083{
8084 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams;
8085 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008086 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008087 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008088 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008089 wpt_uint16 usDataOffset = 0;
8090 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008091 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008092 tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}};
8093 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8094
8095 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008096 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008097 -------------------------------------------------------------------------*/
8098 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8099 ( NULL == pEventData->pCBfnc ))
8100 {
8101 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8102 "%s: Invalid parameters", __FUNCTION__);
8103 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008104 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008105 }
8106
8107 pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData;
8108 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc;
8109 /*-------------------------------------------------------------------------
8110 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008111 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008112 -------------------------------------------------------------------------*/
8113 wpalMutexAcquire(&pWDICtx->wptMutex);
8114
8115 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008116 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07008117 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008118 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
8119 pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx,
8120 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07008121
Jeff Johnsone7245742012-09-05 17:12:55 -07008122 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008123 {
8124 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008125 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
8126 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008127
8128 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008129 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008130 }
8131
8132 /*------------------------------------------------------------------------
8133 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008134 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008135 ------------------------------------------------------------------------*/
8136 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8137 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008138 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8139 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8140 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008141
Jeff Johnsone7245742012-09-05 17:12:55 -07008142 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008143 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008144 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008145 }
8146
8147
8148 wpalMutexRelease(&pWDICtx->wptMutex);
8149
8150 /*-----------------------------------------------------------------------
8151 Get message buffer
8152 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008153 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008154 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams),
8155 &pSendBuffer, &usDataOffset, &usSendSize))||
8156 ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) )))
8157 {
8158 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8159 "Unable to get send buffer in set bss key req %x %x %x",
8160 pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb);
8161 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008162 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008163 }
8164 /*-----------------------------------------------------------------------
8165 Copy the Key parameters into the HAL message
8166 -----------------------------------------------------------------------*/
8167 halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
8168
Jeff Johnsone7245742012-09-05 17:12:55 -07008169 halRemoveBssKeyReqMsg.removeBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008170 WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType);
8171
8172 halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId;
8173
Jeff Johnsone7245742012-09-05 17:12:55 -07008174 halRemoveBssKeyReqMsg.removeBssKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008175 WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType);
8176
Jeff Johnsone7245742012-09-05 17:12:55 -07008177 wpalMemoryCopy( pSendBuffer+usDataOffset,
8178 &halRemoveBssKeyReqMsg.removeBssKeyParams,
8179 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008180
8181 pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008182 pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008183
8184 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008185 Send Remove BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008186 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008187 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008188 wdiRemoveBSSKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008189 WDI_RMV_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008190}/*WDI_ProcessRemoveBssKeyReq*/
8191
8192/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008193 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008194 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008195
8196 @param pWDICtx: pointer to the WLAN DAL context
8197 pEventData: pointer to the event information structure
8198
Jeff Johnson295189b2012-06-20 16:38:30 -07008199 @see
8200 @return Result of the function call
8201*/
8202WDI_Status
8203WDI_ProcessSetStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008204(
Jeff Johnson295189b2012-06-20 16:38:30 -07008205 WDI_ControlBlockType* pWDICtx,
8206 WDI_EventInfoType* pEventData
8207)
8208{
8209 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8210 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8211 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008212 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008213 wpt_uint16 usDataOffset = 0;
8214 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008215 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008216 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008217 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008218 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8219 wpt_uint8 keyIndex = 0;
8220
8221 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8222
8223 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008224 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008225 -------------------------------------------------------------------------*/
8226 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8227 ( NULL == pEventData->pCBfnc ))
8228 {
8229 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8230 "%s: Invalid parameters", __FUNCTION__);
8231 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008232 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008233 }
8234
8235 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8236 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8237 /*-------------------------------------------------------------------------
8238 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008239 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008240 -------------------------------------------------------------------------*/
8241 wpalMutexAcquire(&pWDICtx->wptMutex);
8242
8243 /*------------------------------------------------------------------------
8244 Find the BSS for which the request is made and identify WDI session
8245 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008246 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8247 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008248 &macBSSID))
8249 {
8250 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8251 "This station does not exist in the WDI Station Table %d");
8252 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008253 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008254 }
8255
Jeff Johnsone7245742012-09-05 17:12:55 -07008256 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8257 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008258 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008259 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8260 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8261 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008262
8263 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008264 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008265 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008266
Jeff Johnson295189b2012-06-20 16:38:30 -07008267 /*------------------------------------------------------------------------
8268 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008269 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008270 ------------------------------------------------------------------------*/
8271 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8272 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008273 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8274 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8275 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008276
Jeff Johnsone7245742012-09-05 17:12:55 -07008277 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008278 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008279 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008280 }
8281
8282
8283 wpalMutexRelease(&pWDICtx->wptMutex);
8284 /*-----------------------------------------------------------------------
8285 Get message buffer
8286 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008287 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008288 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8289 &pSendBuffer, &usDataOffset, &usSendSize))||
8290 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8291 {
8292 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8293 "Unable to get send buffer in set bss key req %x %x %x",
8294 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8295 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008296 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008297 }
8298 /*-----------------------------------------------------------------------
8299 Copy the STA Key parameters into the HAL message
8300 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008301 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008302 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8303
Jeff Johnsone7245742012-09-05 17:12:55 -07008304 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008305 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8306
8307 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8308
8309 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8310
8311 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8312
8313#ifdef WLAN_SOFTAP_FEATURE
8314 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8315 keyIndex++)
8316 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008317 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008318 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8319 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8320 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8321 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8322 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8323 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008324 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008325 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008326 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008327 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008328 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008329 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8330 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008331 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008332 WDI_MAX_KEY_LENGTH);
8333 }
8334#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008335 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008336 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8337 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8338 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8339 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8340 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8341 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008342 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008343 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008344 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008345 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008346 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008347 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8348 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008349 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008350 WDI_MAX_KEY_LENGTH);
8351#endif
8352
Jeff Johnsone7245742012-09-05 17:12:55 -07008353 wpalMemoryCopy( pSendBuffer+usDataOffset,
8354 &halSetStaKeyReqMsg.setStaKeyParams,
8355 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008356
8357 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008358 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008359
8360 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008361 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008362 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008363 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8364 wdiSetSTAKeyRspCb, pEventData->pUserData,
8365 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008366
8367}/*WDI_ProcessSetSTAKeyReq*/
8368
8369/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008370 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008371 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008372
8373 @param pWDICtx: pointer to the WLAN DAL context
8374 pEventData: pointer to the event information structure
8375
Jeff Johnson295189b2012-06-20 16:38:30 -07008376 @see
8377 @return Result of the function call
8378*/
8379WDI_Status
8380WDI_ProcessRemoveStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008381(
Jeff Johnson295189b2012-06-20 16:38:30 -07008382 WDI_ControlBlockType* pWDICtx,
8383 WDI_EventInfoType* pEventData
8384)
8385{
8386 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams;
8387 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8388 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008389 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008390 wpt_uint16 usDataOffset = 0;
8391 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008392 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008393 wpt_macAddr macBSSID;
8394 wpt_uint8 ucCurrentBSSSesIdx;
8395 tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}};
8396 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8397
8398 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008399 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008400 -------------------------------------------------------------------------*/
8401 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8402 ( NULL == pEventData->pCBfnc ))
8403 {
8404 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8405 "%s: Invalid parameters", __FUNCTION__);
8406 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008407 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008408 }
8409
8410 pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8411 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8412 /*-------------------------------------------------------------------------
8413 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008414 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008415 -------------------------------------------------------------------------*/
8416 wpalMutexAcquire(&pWDICtx->wptMutex);
8417
8418 /*------------------------------------------------------------------------
8419 Find the BSS for which the request is made and identify WDI session
8420 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008421 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8422 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008423 &macBSSID))
8424 {
8425 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8426 "This station does not exist in the WDI Station Table %d");
8427 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008428 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008429 }
8430
Jeff Johnsone7245742012-09-05 17:12:55 -07008431 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8432 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008433 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008434 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8435 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8436 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008437
8438 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008439 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008440 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008441
Jeff Johnson295189b2012-06-20 16:38:30 -07008442 /*------------------------------------------------------------------------
8443 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008444 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008445 ------------------------------------------------------------------------*/
8446 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8447 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008448 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8449 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8450 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008451
Jeff Johnsone7245742012-09-05 17:12:55 -07008452 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008453 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008454 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008455 }
8456
8457
8458
8459 wpalMutexRelease(&pWDICtx->wptMutex);
8460 /*-----------------------------------------------------------------------
8461 Get message buffer
8462 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008463 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008464 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams),
8465 &pSendBuffer, &usDataOffset, &usSendSize))||
8466 ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) )))
8467 {
8468 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8469 "Unable to get send buffer in set bss key req %x %x %x",
8470 pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb);
8471 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008472 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008473 }
8474
8475 /*-----------------------------------------------------------------------
8476 Copy the Key parameters into the HAL message
8477 -----------------------------------------------------------------------*/
8478
Jeff Johnsone7245742012-09-05 17:12:55 -07008479 halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008480 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8481
Jeff Johnsone7245742012-09-05 17:12:55 -07008482 halRemoveStaKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008483 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType);
8484
Jeff Johnsone7245742012-09-05 17:12:55 -07008485 halRemoveStaKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008486 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId;
8487
Jeff Johnsone7245742012-09-05 17:12:55 -07008488 halRemoveStaKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008489 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast;
8490
Jeff Johnsone7245742012-09-05 17:12:55 -07008491 wpalMemoryCopy( pSendBuffer+usDataOffset,
8492 &halRemoveStaKeyReqMsg.removeStaKeyParams,
8493 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008494
8495 pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008496 pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008497
8498 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008499 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008500 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008501 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008502 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008503 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008504
8505}/*WDI_ProcessRemoveSTAKeyReq*/
8506
8507/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008508 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008509 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008510
8511 @param pWDICtx: pointer to the WLAN DAL context
8512 pEventData: pointer to the event information structure
8513
Jeff Johnson295189b2012-06-20 16:38:30 -07008514 @see
8515 @return Result of the function call
8516*/
8517WDI_Status
8518WDI_ProcessSetStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008519(
Jeff Johnson295189b2012-06-20 16:38:30 -07008520 WDI_ControlBlockType* pWDICtx,
8521 WDI_EventInfoType* pEventData
8522)
8523{
8524 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8525 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8526 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008527 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008528 wpt_uint16 usDataOffset = 0;
8529 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008530 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008531 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008532 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008533 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8534 wpt_uint8 keyIndex = 0;
8535
8536 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8537
8538 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008539 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008540 -------------------------------------------------------------------------*/
8541 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8542 ( NULL == pEventData->pCBfnc ))
8543 {
8544 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8545 "%s: Invalid parameters", __FUNCTION__);
8546 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008547 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008548 }
8549
8550 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8551 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8552 /*-------------------------------------------------------------------------
8553 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008554 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008555 -------------------------------------------------------------------------*/
8556 wpalMutexAcquire(&pWDICtx->wptMutex);
8557
8558 /*------------------------------------------------------------------------
8559 Find the BSS for which the request is made and identify WDI session
8560 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008561 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8562 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008563 &macBSSID))
8564 {
8565 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8566 "This station does not exist in the WDI Station Table %d");
8567 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008568 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008569 }
8570
Jeff Johnsone7245742012-09-05 17:12:55 -07008571 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8572 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008573 {
8574 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008575 "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8576 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008577
8578 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008579 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008580 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008581
Jeff Johnson295189b2012-06-20 16:38:30 -07008582 /*------------------------------------------------------------------------
8583 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008584 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008585 ------------------------------------------------------------------------*/
8586 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8587 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008588 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8589 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8590 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008591
Jeff Johnsone7245742012-09-05 17:12:55 -07008592 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008593 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008594 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008595 }
8596
8597
8598 wpalMutexRelease(&pWDICtx->wptMutex);
8599 /*-----------------------------------------------------------------------
8600 Get message buffer
8601 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008602 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008603 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8604 &pSendBuffer, &usDataOffset, &usSendSize))||
8605 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8606 {
8607 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8608 "Unable to get send buffer in set bss key req %x %x %x",
8609 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8610 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008611 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008612 }
8613 /*-----------------------------------------------------------------------
8614 Copy the STA Key parameters into the HAL message
8615 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008616 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008617 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8618
Jeff Johnsone7245742012-09-05 17:12:55 -07008619 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008620 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8621
8622 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8623
8624 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8625
8626 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8627
8628#ifdef WLAN_SOFTAP_FEATURE
8629 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8630 keyIndex++)
8631 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008632 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008633 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8634 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8635 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8636 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8637 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8638 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008639 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008640 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008641 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008642 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008643 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008644 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8645 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008646 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008647 WDI_MAX_KEY_LENGTH);
8648 }
8649#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008650 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008651 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8652 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8653 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8654 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8655 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8656 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008657 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008658 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008659 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008660 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008661 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008662 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8663 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008664 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008665 WDI_MAX_KEY_LENGTH);
8666#endif
8667
Jeff Johnsone7245742012-09-05 17:12:55 -07008668 wpalMemoryCopy( pSendBuffer+usDataOffset,
8669 &halSetStaKeyReqMsg.setStaKeyParams,
8670 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008671
8672 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008673 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008674
8675 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008676 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008677 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008678 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8679 wdiSetSTAKeyRspCb, pEventData->pUserData,
8680 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008681
8682}/*WDI_ProcessSetSTABcastKeyReq*/
8683
8684/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008685 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008686 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008687
8688 @param pWDICtx: pointer to the WLAN DAL context
8689 pEventData: pointer to the event information structure
8690
Jeff Johnson295189b2012-06-20 16:38:30 -07008691 @see
8692 @return Result of the function call
8693*/
8694WDI_Status
8695WDI_ProcessRemoveStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008696(
Jeff Johnson295189b2012-06-20 16:38:30 -07008697 WDI_ControlBlockType* pWDICtx,
8698 WDI_EventInfoType* pEventData
8699)
8700{
8701 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams;
8702 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8703 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008704 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008705 wpt_uint16 usDataOffset = 0;
8706 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008707 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008708 wpt_macAddr macBSSID;
8709 wpt_uint8 ucCurrentBSSSesIdx;
8710 tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}};
8711 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8712
8713 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008714 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008715 -------------------------------------------------------------------------*/
8716 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8717 ( NULL == pEventData->pCBfnc ))
8718 {
8719 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8720 "%s: Invalid parameters", __FUNCTION__);
8721 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008722 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008723 }
8724
8725 pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8726 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8727 /*-------------------------------------------------------------------------
8728 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008729 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008730 -------------------------------------------------------------------------*/
8731 wpalMutexAcquire(&pWDICtx->wptMutex);
8732
8733 /*------------------------------------------------------------------------
8734 Find the BSS for which the request is made and identify WDI session
8735 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008736 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8737 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008738 &macBSSID))
8739 {
8740 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8741 "This station does not exist in the WDI Station Table %d");
8742 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008743 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008744 }
8745
Jeff Johnsone7245742012-09-05 17:12:55 -07008746 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8747 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008748 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008749 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8750 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8751 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008752
8753 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008754 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008755 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008756
Jeff Johnson295189b2012-06-20 16:38:30 -07008757 /*------------------------------------------------------------------------
8758 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008759 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008760 ------------------------------------------------------------------------*/
8761 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8762 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008763 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8764 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8765 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008766
Jeff Johnsone7245742012-09-05 17:12:55 -07008767 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008768 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008769 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008770 }
8771
8772
8773
8774 wpalMutexRelease(&pWDICtx->wptMutex);
8775 /*-----------------------------------------------------------------------
8776 Get message buffer
8777 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008778 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008779 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams),
8780 &pSendBuffer, &usDataOffset, &usSendSize))||
8781 ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) )))
8782 {
8783 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8784 "Unable to get send buffer in set bss key req %x %x %x",
8785 pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb);
8786 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008787 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008788 }
8789
8790 /*-----------------------------------------------------------------------
8791 Copy the Key parameters into the HAL message
8792 -----------------------------------------------------------------------*/
8793
Jeff Johnsone7245742012-09-05 17:12:55 -07008794 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008795 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx;
8796
Jeff Johnsone7245742012-09-05 17:12:55 -07008797 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008798 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType);
8799
Jeff Johnsone7245742012-09-05 17:12:55 -07008800 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008801 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId;
8802
Jeff Johnsone7245742012-09-05 17:12:55 -07008803 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008804 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast;
8805
Jeff Johnsone7245742012-09-05 17:12:55 -07008806 wpalMemoryCopy( pSendBuffer+usDataOffset,
8807 &halRemoveStaBcastKeyReqMsg.removeStaKeyParams,
8808 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008809
8810 pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008811 pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008812
8813 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008814 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008815 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008816 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008817 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008818 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008819
8820}/*WDI_ProcessRemoveSTABcastKeyReq*/
8821
8822/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07008823 QOS and BA PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07008824==========================================================================*/
8825/**
8826 @brief Process Add TSpec Request function (called when Main FSM
8827 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008828
8829 @param pWDICtx: pointer to the WLAN DAL context
8830 pEventData: pointer to the event information structure
8831
Jeff Johnson295189b2012-06-20 16:38:30 -07008832 @see
8833 @return Result of the function call
8834*/
8835WDI_Status
8836WDI_ProcessAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008837(
Jeff Johnson295189b2012-06-20 16:38:30 -07008838 WDI_ControlBlockType* pWDICtx,
8839 WDI_EventInfoType* pEventData
8840)
8841{
8842 WDI_AddTSReqParamsType* pwdiAddTSParams;
8843 WDI_AddTsRspCb wdiAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008844 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008845 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008846 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008847 wpt_uint16 usDataOffset = 0;
8848 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008849 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008850 wpt_macAddr macBSSID;
8851 tAddTsParams halAddTsParams = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -07008852
Jeff Johnson295189b2012-06-20 16:38:30 -07008853 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8854
8855 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008856 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008857 -------------------------------------------------------------------------*/
8858 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8859 ( NULL == pEventData->pCBfnc ))
8860 {
8861 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8862 "%s: Invalid parameters", __FUNCTION__);
8863 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008864 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008865 }
8866
8867 pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData;
8868 wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc;
8869 /*-------------------------------------------------------------------------
8870 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008871 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008872 -------------------------------------------------------------------------*/
8873 wpalMutexAcquire(&pWDICtx->wptMutex);
8874
8875 /*------------------------------------------------------------------------
8876 Find the BSS for which the request is made and identify WDI session
8877 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008878 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8879 pwdiAddTSParams->wdiTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008880 &macBSSID))
8881 {
8882 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8883 "This station does not exist in the WDI Station Table %d");
8884 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008885 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008886 }
8887
Jeff Johnsone7245742012-09-05 17:12:55 -07008888 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8889 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008890 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8892 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8893 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008894
8895 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008896 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008897 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008898
Jeff Johnson295189b2012-06-20 16:38:30 -07008899 /*------------------------------------------------------------------------
8900 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008901 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008902 ------------------------------------------------------------------------*/
8903 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8904 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008905 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8906 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8907 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008908
Jeff Johnsone7245742012-09-05 17:12:55 -07008909 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008910 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008911 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008912 }
8913
8914 wpalMutexRelease(&pWDICtx->wptMutex);
8915 /*-----------------------------------------------------------------------
8916 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07008917 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07008918 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008919 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ,
8920 sizeof(halAddTsParams),
8921 &pSendBuffer, &usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -07008922 &usSendSize))||
8923 ( usSendSize < (usDataOffset + sizeof(halAddTsParams) )))
8924 {
8925 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8926 "Unable to get send buffer in set bss key req %x %x %x",
8927 pEventData, pwdiAddTSParams, wdiAddTSRspCb);
8928 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008929 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008930 }
8931
8932 halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx;
8933 halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx;
8934
8935 //TSPEC IE
8936 halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType;
8937 halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -07008938 halAddTsParams.tspec.nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008939 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008940 halAddTsParams.tspec.maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008941 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008942 halAddTsParams.tspec.minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008943 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008944 halAddTsParams.tspec.maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008945 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008946 halAddTsParams.tspec.inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008947 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008948 halAddTsParams.tspec.suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008949 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008950 halAddTsParams.tspec.svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008951 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -07008952 halAddTsParams.tspec.minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008953 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008954 halAddTsParams.tspec.meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008955 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008956 halAddTsParams.tspec.peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008957 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008958 halAddTsParams.tspec.maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008959 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008960 halAddTsParams.tspec.delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -07008961 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -07008962 halAddTsParams.tspec.minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008963 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008964 halAddTsParams.tspec.surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -07008965 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -07008966 halAddTsParams.tspec.mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008967 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime;
8968
8969 //TSPEC IE : TS INFO : TRAFFIC
Jeff Johnsone7245742012-09-05 17:12:55 -07008970 halAddTsParams.tspec.tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -07008971 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -07008972 halAddTsParams.tspec.tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -07008973 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -07008974 halAddTsParams.tspec.tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -07008975 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008976 halAddTsParams.tspec.tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -07008977 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -07008978 halAddTsParams.tspec.tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -07008979 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction;
Jeff Johnsone7245742012-09-05 17:12:55 -07008980 halAddTsParams.tspec.tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -07008981 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid;
Jeff Johnsone7245742012-09-05 17:12:55 -07008982 halAddTsParams.tspec.tsinfo.traffic.trafficType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008983 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType;
8984
8985 //TSPEC IE : TS INFO : SCHEDULE
Jeff Johnsone7245742012-09-05 17:12:55 -07008986 halAddTsParams.tspec.tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -07008987 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -07008988 halAddTsParams.tspec.tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -07008989 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule;
8990
Jeff Johnsone7245742012-09-05 17:12:55 -07008991 wpalMemoryCopy( pSendBuffer+usDataOffset,
8992 &halAddTsParams,
8993 sizeof(halAddTsParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008994
8995 pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008996 pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008997
8998 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008999 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009000 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009001 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07009002 wdiAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07009003 WDI_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009004}/*WDI_ProcessAddTSpecReq*/
9005
9006
9007/**
9008 @brief Process Del TSpec Request function (called when Main FSM
9009 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009010
9011 @param pWDICtx: pointer to the WLAN DAL context
9012 pEventData: pointer to the event information structure
9013
Jeff Johnson295189b2012-06-20 16:38:30 -07009014 @see
9015 @return Result of the function call
9016*/
9017WDI_Status
9018WDI_ProcessDelTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009019(
Jeff Johnson295189b2012-06-20 16:38:30 -07009020 WDI_ControlBlockType* pWDICtx,
9021 WDI_EventInfoType* pEventData
9022)
9023{
9024 WDI_DelTSReqParamsType* pwdiDelTSParams;
9025 WDI_DelTsRspCb wdiDelTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009026 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009027 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009028 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009029 wpt_uint16 usDataOffset = 0;
9030 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009031 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009032 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9033
9034 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009035 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009036 -------------------------------------------------------------------------*/
9037 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9038 ( NULL == pEventData->pCBfnc ))
9039 {
9040 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9041 "%s: Invalid parameters", __FUNCTION__);
9042 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009043 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009044 }
9045
9046 pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData;
9047 wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc;
9048
9049 /*-------------------------------------------------------------------------
9050 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009051 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009052 -------------------------------------------------------------------------*/
9053 wpalMutexAcquire(&pWDICtx->wptMutex);
9054
9055 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009056 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009057 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009058 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
9059 pwdiDelTSParams->wdiDelTSInfo.macBSSID,
9060 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009061
Jeff Johnsone7245742012-09-05 17:12:55 -07009062 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009063 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009064 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9065 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9066 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
9067
Jeff Johnson295189b2012-06-20 16:38:30 -07009068 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009069 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009070 }
9071
9072 /*------------------------------------------------------------------------
9073 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009074 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009075 ------------------------------------------------------------------------*/
9076 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9077 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009078 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9079 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9080 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009081
Jeff Johnsone7245742012-09-05 17:12:55 -07009082 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009083 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009084 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009085 }
9086
9087
9088 wpalMutexRelease(&pWDICtx->wptMutex);
9089 /*-----------------------------------------------------------------------
9090 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009091 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009092 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009093 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009094 sizeof(pwdiDelTSParams->wdiDelTSInfo),
9095 &pSendBuffer, &usDataOffset, &usSendSize))||
9096 ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) )))
9097 {
9098 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9099 "Unable to get send buffer in set bss key req %x %x %x",
9100 pEventData, pwdiDelTSParams, wdiDelTSRspCb);
9101 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009102 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009103 }
9104
Jeff Johnsone7245742012-09-05 17:12:55 -07009105 wpalMemoryCopy( pSendBuffer+usDataOffset,
9106 &pwdiDelTSParams->wdiDelTSInfo,
9107 sizeof(pwdiDelTSParams->wdiDelTSInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009108
9109 pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009110 pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009111
9112 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009113 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009114 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009115 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9116 wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009117}/*WDI_ProcessDelTSpecReq*/
9118
9119/**
9120 @brief Process Update EDCA Params Request function (called when
9121 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009122
9123 @param pWDICtx: pointer to the WLAN DAL context
9124 pEventData: pointer to the event information structure
9125
Jeff Johnson295189b2012-06-20 16:38:30 -07009126 @see
9127 @return Result of the function call
9128*/
9129WDI_Status
9130WDI_ProcessUpdateEDCAParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009131(
Jeff Johnson295189b2012-06-20 16:38:30 -07009132 WDI_ControlBlockType* pWDICtx,
9133 WDI_EventInfoType* pEventData
9134)
9135{
9136 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams;
9137 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009138 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009139 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009140 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009141 wpt_uint16 usDataOffset = 0;
9142 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009143 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009144 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9145
9146 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009147 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009148 -------------------------------------------------------------------------*/
9149 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9150 ( NULL == pEventData->pCBfnc ))
9151 {
9152 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9153 "%s: Invalid parameters", __FUNCTION__);
9154 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009155 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009156 }
9157
9158 pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData;
9159 wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc;
9160 /*-------------------------------------------------------------------------
9161 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009162 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009163 -------------------------------------------------------------------------*/
9164 wpalMutexAcquire(&pWDICtx->wptMutex);
9165
9166 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009167 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009168 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009169 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
9170 pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx,
9171 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009172
Jeff Johnsone7245742012-09-05 17:12:55 -07009173 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009174 {
9175 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07009176 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
9177 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009178
9179 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009180 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009181 }
9182
9183 /*------------------------------------------------------------------------
9184 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009185 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009186 ------------------------------------------------------------------------*/
9187 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9188 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009189 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9190 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
9191 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009192
Jeff Johnsone7245742012-09-05 17:12:55 -07009193 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009194 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009195 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009196 }
9197
9198
9199 wpalMutexRelease(&pWDICtx->wptMutex);
9200 /*-----------------------------------------------------------------------
9201 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009202 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009203 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009204 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009205 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo),
9206 &pSendBuffer, &usDataOffset, &usSendSize))||
9207 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) )))
9208 {
9209 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9210 "Unable to get send buffer in set bss key req %x %x %x",
9211 pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb);
9212 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009213 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009214 }
9215
Jeff Johnsone7245742012-09-05 17:12:55 -07009216 wpalMemoryCopy( pSendBuffer+usDataOffset,
9217 &pwdiUpdateEDCAParams->wdiEDCAInfo,
9218 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009219
9220 pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009221 pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009222
9223 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009224 Send Update EDCA Params Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009225 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009226 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9227 wdiUpdateEDCARspCb, pEventData->pUserData,
9228 WDI_UPD_EDCA_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009229}/*WDI_ProcessUpdateEDCAParamsReq*/
9230
9231/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009232 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009233 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009234
9235 @param pWDICtx: pointer to the WLAN DAL context
9236 pEventData: pointer to the event information structure
9237
Jeff Johnson295189b2012-06-20 16:38:30 -07009238 @see
9239 @return Result of the function call
9240*/
9241WDI_Status
9242WDI_ProcessAddBASessionReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009243(
Jeff Johnson295189b2012-06-20 16:38:30 -07009244 WDI_ControlBlockType* pWDICtx,
9245 WDI_EventInfoType* pEventData
9246)
9247{
9248 WDI_AddBASessionReqParamsType* pwdiAddBASessionParams;
9249 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009250 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009251 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009252 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009253 wpt_uint16 usDataOffset = 0;
9254 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009255 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009256 wpt_macAddr macBSSID;
9257
9258 tAddBASessionReqMsg halAddBASessionReq;
9259 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9260
9261 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009262 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009263 -------------------------------------------------------------------------*/
9264 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9265 ( NULL == pEventData->pCBfnc ))
9266 {
9267 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9268 "%s: Invalid parameters", __FUNCTION__);
9269 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009270 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009271 }
9272
Jeff Johnsone7245742012-09-05 17:12:55 -07009273 pwdiAddBASessionParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009274 (WDI_AddBASessionReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009275 wdiAddBASessionRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009276 (WDI_AddBASessionRspCb)pEventData->pCBfnc;
9277 /*-------------------------------------------------------------------------
9278 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009279 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009280 -------------------------------------------------------------------------*/
9281 wpalMutexAcquire(&pWDICtx->wptMutex);
9282
9283 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009284 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009285 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009286 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9287 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009288 &macBSSID))
9289 {
9290 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9291 "This station does not exist in the WDI Station Table %d");
9292 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009293 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009294 }
9295
9296
Jeff Johnsone7245742012-09-05 17:12:55 -07009297 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009298
Jeff Johnsone7245742012-09-05 17:12:55 -07009299 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009300 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009301 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9302 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9303 __func__, MAC_ADDR_ARRAY(macBSSID));
9304
Jeff Johnson295189b2012-06-20 16:38:30 -07009305 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009306 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009307 }
9308
9309 /*------------------------------------------------------------------------
9310 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009311 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009312 ------------------------------------------------------------------------*/
9313 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9314 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009315 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9316 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9317 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009318
Jeff Johnsone7245742012-09-05 17:12:55 -07009319 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009320 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009321 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009322 }
9323
9324
9325 wpalMutexRelease(&pWDICtx->wptMutex);
9326 /*-----------------------------------------------------------------------
9327 Get message buffer
9328 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009329 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9330 WDI_ADD_BA_SESSION_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009331 sizeof(halAddBASessionReq.addBASessionParams),
9332 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009333 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009334 (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) )))
9335 {
9336 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9337 "Unable to get send buffer in Add BA session req %x %x %x",
9338 pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb);
9339 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009340 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009341 }
9342
9343 halAddBASessionReq.addBASessionParams.staIdx =
9344 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx;
9345 wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr,
9346 pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr,
9347 WDI_MAC_ADDR_LEN);
9348 halAddBASessionReq.addBASessionParams.baTID =
9349 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID;
9350 halAddBASessionReq.addBASessionParams.baPolicy =
9351 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy;
9352 halAddBASessionReq.addBASessionParams.baBufferSize =
9353 pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize;
9354 halAddBASessionReq.addBASessionParams.baTimeout =
9355 pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout;
9356 halAddBASessionReq.addBASessionParams.baSSN =
9357 pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN;
9358 halAddBASessionReq.addBASessionParams.baDirection =
9359 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection;
9360
Jeff Johnsone7245742012-09-05 17:12:55 -07009361 wpalMemoryCopy( pSendBuffer+usDataOffset,
9362 &halAddBASessionReq.addBASessionParams,
9363 sizeof(halAddBASessionReq.addBASessionParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009364
9365 pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009366 pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009367
9368 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009369 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009370 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009371 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9372 wdiAddBASessionRspCb, pEventData->pUserData,
9373 WDI_ADD_BA_SESSION_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009374}/*WDI_ProcessAddBASessionReq*/
9375
9376/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009377 @brief Process Del BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009378 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009379
9380 @param pWDICtx: pointer to the WLAN DAL context
9381 pEventData: pointer to the event information structure
9382
Jeff Johnson295189b2012-06-20 16:38:30 -07009383 @see
9384 @return Result of the function call
9385*/
9386WDI_Status
9387WDI_ProcessDelBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009388(
Jeff Johnson295189b2012-06-20 16:38:30 -07009389 WDI_ControlBlockType* pWDICtx,
9390 WDI_EventInfoType* pEventData
9391)
9392{
9393 WDI_DelBAReqParamsType* pwdiDelBAParams;
9394 WDI_DelBARspCb wdiDelBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009395 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009396 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009397 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009398 wpt_uint16 usDataOffset = 0;
9399 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009400 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009401 wpt_macAddr macBSSID;
9402 tDelBAParams halDelBAparam;
9403 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9404
9405 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009406 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009407 -------------------------------------------------------------------------*/
9408 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9409 ( NULL == pEventData->pCBfnc ))
9410 {
9411 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9412 "%s: Invalid parameters", __FUNCTION__);
9413 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009414 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009415 }
9416
9417 pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData;
9418 wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc;
9419 /*-------------------------------------------------------------------------
9420 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009421 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009422 -------------------------------------------------------------------------*/
9423 wpalMutexAcquire(&pWDICtx->wptMutex);
9424
9425 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009426 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009427 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009428 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9429 pwdiDelBAParams->wdiBAInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009430 &macBSSID))
9431 {
9432 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9433 "This station does not exist in the WDI Station Table %d");
9434 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009435 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009436 }
9437
Jeff Johnsone7245742012-09-05 17:12:55 -07009438 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009439
Jeff Johnsone7245742012-09-05 17:12:55 -07009440 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009441 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009442 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9443 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9444 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009445
9446 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009447 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009448 }
9449
9450 /*------------------------------------------------------------------------
9451 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009452 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009453 ------------------------------------------------------------------------*/
9454 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9455 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009456 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9457 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9458 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009459
Jeff Johnsone7245742012-09-05 17:12:55 -07009460 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009461 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009462 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009463 }
9464
9465 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009466 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009467 sizeof(halDelBAparam),
9468 &pSendBuffer, &usDataOffset, &usSendSize))||
9469 ( usSendSize < (usDataOffset + sizeof(halDelBAparam) )))
9470 {
9471 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9472 "Unable to get send buffer for DEL BA req %x %x %x",
9473 pEventData, pwdiDelBAParams, wdiDelBARspCb);
9474 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009475 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009476 }
9477
9478 halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx;
9479 halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID;
9480 halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection;
9481
Jeff Johnsone7245742012-09-05 17:12:55 -07009482 wpalMemoryCopy( pSendBuffer+usDataOffset,
9483 &halDelBAparam,
9484 sizeof(halDelBAparam));
Jeff Johnson295189b2012-06-20 16:38:30 -07009485
9486 pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009487 pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009488
9489 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009490 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009491 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009492 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9493 wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009494}/*WDI_ProcessDelBAReq*/
9495
9496#ifdef FEATURE_WLAN_CCX
9497
9498WDI_Status
9499WDI_ProcessTSMStatsReq
9500(
9501 WDI_ControlBlockType* pWDICtx,
9502 WDI_EventInfoType* pEventData
9503)
9504{
9505 WDI_TSMStatsReqParamsType* pwdiTSMParams;
9506 WDI_TsmRspCb wdiTSMRspCb;
9507 wpt_uint8 ucCurrentBSSSesIdx = 0;
9508 WDI_BSSSessionType* pBSSSes = NULL;
9509 wpt_uint8* pSendBuffer = NULL;
9510 wpt_uint16 usDataOffset = 0;
9511 wpt_uint16 usSendSize = 0;
9512 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9513 tTsmStatsParams halTsmStatsReqParams = {0};
9514
9515 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9516
9517 /*-------------------------------------------------------------------------
9518 Sanity check
9519 -------------------------------------------------------------------------*/
9520 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9521 ( NULL == pEventData->pCBfnc ))
9522 {
9523 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9524 "%s: Invalid parameters", __FUNCTION__);
9525 WDI_ASSERT(0);
9526 return WDI_STATUS_E_FAILURE;
9527 }
9528
9529 pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData;
9530 wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc;
9531 /*-------------------------------------------------------------------------
9532 Check to see if we are in the middle of an association, if so queue, if
9533 not it means it is free to process request
9534 -------------------------------------------------------------------------*/
9535 wpalMutexAcquire(&pWDICtx->wptMutex);
9536
9537 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes);
9538 if ( NULL == pBSSSes )
9539 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009540 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9541 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9542 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009543
9544 wpalMutexRelease(&pWDICtx->wptMutex);
9545 return WDI_STATUS_E_NOT_ALLOWED;
9546 }
9547
9548 /*------------------------------------------------------------------------
9549 Check if this BSS is being currently processed or queued,
9550 if queued - queue the new request as well
9551 ------------------------------------------------------------------------*/
9552 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9553 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009554 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9555 "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9556 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009557
9558 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9559 wpalMutexRelease(&pWDICtx->wptMutex);
9560 return wdiStatus;
9561 }
9562
9563 wpalMutexRelease(&pWDICtx->wptMutex);
9564 /*-----------------------------------------------------------------------
9565 Get message buffer
9566 ! TO DO : proper conversion into the HAL Message Request Format
9567 -----------------------------------------------------------------------*/
9568 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ,
9569 sizeof(halTsmStatsReqParams),
9570 &pSendBuffer, &usDataOffset, &usSendSize))||
9571 ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) )))
9572 {
9573 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9574 "Unable to get send buffer in set bss key req %x %x %x",
9575 pEventData, pwdiTSMParams, wdiTSMRspCb);
9576 WDI_ASSERT(0);
9577 return WDI_STATUS_E_FAILURE;
9578 }
9579
9580 halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid;
9581 wpalMemoryCopy(halTsmStatsReqParams.bssId,
9582 pwdiTSMParams->wdiTsmStatsParamsInfo.bssid,
9583 WDI_MAC_ADDR_LEN);
9584 wpalMemoryCopy( pSendBuffer+usDataOffset,
9585 &halTsmStatsReqParams,
9586 sizeof(halTsmStatsReqParams));
9587
9588 pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB;
9589 pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData;
9590
9591 /*-------------------------------------------------------------------------
9592 Send TSM Stats Request to HAL
9593 -------------------------------------------------------------------------*/
9594 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9595 wdiTSMRspCb, pEventData->pUserData,
9596 WDI_TSM_STATS_RESP);
9597}/*WDI_ProcessTSMStatsReq*/
9598
9599#endif
9600
9601
9602/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009603 @brief Process Flush AC Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009604 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009605
9606 @param pWDICtx: pointer to the WLAN DAL context
9607 pEventData: pointer to the event information structure
9608
Jeff Johnson295189b2012-06-20 16:38:30 -07009609 @see
9610 @return Result of the function call
9611*/
9612WDI_Status
9613WDI_ProcessFlushAcReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009614(
Jeff Johnson295189b2012-06-20 16:38:30 -07009615 WDI_ControlBlockType* pWDICtx,
9616 WDI_EventInfoType* pEventData
9617)
9618{
9619 WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL;
9620 WDI_FlushAcRspCb wdiFlushAcRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009621 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009622 wpt_uint16 usDataOffset = 0;
9623 wpt_uint16 usSendSize = 0;
9624 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9625
9626 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009627 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009628 -------------------------------------------------------------------------*/
9629 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9630 ( NULL == pEventData->pCBfnc ))
9631 {
9632 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9633 "%s: Invalid parameters", __FUNCTION__);
9634 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009635 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009636 }
9637
9638 pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData;
9639 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc;
9640 /*-----------------------------------------------------------------------
9641 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009642 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009643 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009644 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009645 sizeof(pwdiFlushAcParams->wdiFlushAcInfo),
9646 &pSendBuffer, &usDataOffset, &usSendSize))||
9647 ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) )))
9648 {
9649 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9650 "Unable to get send buffer in set bss key req %x %x %x",
9651 pEventData, pwdiFlushAcParams, wdiFlushAcRspCb);
9652 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009653 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009654 }
9655
Jeff Johnsone7245742012-09-05 17:12:55 -07009656 wpalMemoryCopy( pSendBuffer+usDataOffset,
9657 &pwdiFlushAcParams->wdiFlushAcInfo,
9658 sizeof(pwdiFlushAcParams->wdiFlushAcInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009659
9660 pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009661 pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009662
9663 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009664 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009665 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009666 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9667 wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009668}/*WDI_ProcessFlushAcReq*/
9669
9670/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009671 @brief Process BT AMP event Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009672 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009673
9674 @param pWDICtx: pointer to the WLAN DAL context
9675 pEventData: pointer to the event information structure
9676
Jeff Johnson295189b2012-06-20 16:38:30 -07009677 @see
9678 @return Result of the function call
9679*/
9680WDI_Status
9681WDI_ProcessBtAmpEventReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009682(
Jeff Johnson295189b2012-06-20 16:38:30 -07009683 WDI_ControlBlockType* pWDICtx,
9684 WDI_EventInfoType* pEventData
9685)
9686{
9687 WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL;
9688 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009689 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009690 wpt_uint16 usDataOffset = 0;
9691 wpt_uint16 usSendSize = 0;
9692
9693 tBtAmpEventMsg haltBtAmpEventMsg;
9694 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9695
9696 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009697 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009698 -------------------------------------------------------------------------*/
9699 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9700 ( NULL == pEventData->pCBfnc ))
9701 {
9702 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9703 "%s: Invalid parameters", __FUNCTION__);
9704 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009705 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009706 }
9707
9708 pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData;
9709 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc;
9710 /*-----------------------------------------------------------------------
9711 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009712 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009713 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009714 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009715 sizeof(haltBtAmpEventMsg.btAmpEventParams),
9716 &pSendBuffer, &usDataOffset, &usSendSize))||
9717 ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) )))
9718 {
9719 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9720 "Unable to get send buffer in BT AMP event req %x %x %x",
9721 pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb);
9722 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009723 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009724 }
9725
Jeff Johnsone7245742012-09-05 17:12:55 -07009726 haltBtAmpEventMsg.btAmpEventParams.btAmpEventType =
Jeff Johnson295189b2012-06-20 16:38:30 -07009727 pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType;
Jeff Johnsone7245742012-09-05 17:12:55 -07009728 wpalMemoryCopy( pSendBuffer+usDataOffset,
9729 &haltBtAmpEventMsg.btAmpEventParams,
9730 sizeof(haltBtAmpEventMsg.btAmpEventParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009731
9732 pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009733 pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009734
9735 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009736 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009737 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009738 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9739 wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009740}/*WDI_ProcessBtAmpEventReq*/
9741
9742/**
9743 @brief Process Add STA self Request function (called when Main FSM
9744 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009745
9746 @param pWDICtx: pointer to the WLAN DAL context
9747 pEventData: pointer to the event information structure
9748
Jeff Johnson295189b2012-06-20 16:38:30 -07009749 @see
9750 @return Result of the function call
9751*/
9752WDI_Status
9753WDI_ProcessAddSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009754(
Jeff Johnson295189b2012-06-20 16:38:30 -07009755 WDI_ControlBlockType* pWDICtx,
9756 WDI_EventInfoType* pEventData
9757)
9758{
9759 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams;
9760 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009761 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009762 wpt_uint16 usDataOffset = 0;
9763 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009764 tAddStaSelfParams halAddSTASelfParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07009765 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9766
9767 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009768 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009769 -------------------------------------------------------------------------*/
9770 if (( NULL == pEventData ) ||
9771 ( NULL == pEventData->pEventData) ||
9772 ( NULL == pEventData->pCBfnc))
9773 {
9774 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9775 "%s: Invalid parameters", __FUNCTION__);
9776 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009777 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009778 }
9779
Jeff Johnsone7245742012-09-05 17:12:55 -07009780 pwdiAddSTASelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009781 (WDI_AddSTASelfReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009782 wdiAddSTASelfReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009783 (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc;
9784 /*-----------------------------------------------------------------------
9785 Get message buffer
9786 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009787 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9788 WDI_ADD_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009789 sizeof(tAddStaSelfParams),
9790 &pSendBuffer, &usDataOffset, &usSendSize))||
9791 ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) )))
9792 {
9793 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9794 "Unable to get send buffer in ADD STA SELF REQ %x %x %x",
9795 pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb);
9796 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009797 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009798 }
9799
9800 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07009801 wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07009802 sizeof(pWDICtx->wdiCacheAddSTASelfReq));
9803
Jeff Johnsone7245742012-09-05 17:12:55 -07009804 wpalMemoryCopy(halAddSTASelfParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009805 pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ;
9806
Jeff Johnsone7245742012-09-05 17:12:55 -07009807 wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams,
9808 sizeof(tAddStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009809
9810 pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009811 pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009812
9813 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009814 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009815 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009816 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9817 wdiAddSTASelfReqRspCb, pEventData->pUserData,
9818 WDI_ADD_STA_SELF_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009819}/*WDI_ProcessAddSTASelfReq*/
9820
9821
9822
9823/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009824 @brief Process Del Sta Self Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009825 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009826
9827 @param pWDICtx: pointer to the WLAN DAL context
9828 pEventData: pointer to the event information structure
9829
Jeff Johnson295189b2012-06-20 16:38:30 -07009830 @see
9831 @return Result of the function call
9832*/
9833WDI_Status
9834WDI_ProcessDelSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009835(
Jeff Johnson295189b2012-06-20 16:38:30 -07009836 WDI_ControlBlockType* pWDICtx,
9837 WDI_EventInfoType* pEventData
9838)
9839{
9840 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams;
9841 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009842 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009843 wpt_uint16 usDataOffset = 0;
9844 wpt_uint16 usSendSize = 0;
9845 tDelStaSelfParams halSetDelSelfSTAParams;
9846 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9847
9848 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009849 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009850 -------------------------------------------------------------------------*/
9851 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9852 ( NULL == pEventData->pCBfnc ))
9853 {
9854 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9855 "%s: Invalid parameters", __FUNCTION__);
9856 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009857 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009858 }
9859
Jeff Johnsone7245742012-09-05 17:12:55 -07009860 pwdiDelStaSelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009861 (WDI_DelSTASelfReqParamsType*)pEventData->pEventData;
9862 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc;
9863
9864 /*-----------------------------------------------------------------------
9865 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009866 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009867 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009868 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009869 sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo),
9870 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009871 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009872 (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) )))
9873 {
9874 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9875 "Unable to get send buffer in Del Sta Self req %x %x %x",
9876 pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb);
9877 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009878 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009879 }
9880
Jeff Johnsone7245742012-09-05 17:12:55 -07009881 wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009882 pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ;
9883
Jeff Johnsone7245742012-09-05 17:12:55 -07009884 wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams,
9885 sizeof(tDelStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009886
9887 pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009888 pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009889
9890 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009891 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009892 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009893 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9894 wdiDelStaSelfRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07009895 WDI_DEL_STA_SELF_RESP);
9896
9897}
9898
Jeff Johnsone7245742012-09-05 17:12:55 -07009899#ifdef FEATURE_OEM_DATA_SUPPORT
9900/**
9901 @brief Process Start Oem Data Request function (called when Main
9902 FSM allows it)
9903
9904 @param pWDICtx: pointer to the WLAN DAL context
9905 pEventData: pointer to the event information structure
9906
9907 @see
9908 @return Result of the function call
9909*/
9910WDI_Status
9911WDI_ProcessStartOemDataReq
9912(
9913 WDI_ControlBlockType* pWDICtx,
9914 WDI_EventInfoType* pEventData
9915)
9916{
9917 WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL;
9918 WDI_oemDataRspCb wdiOemDataRspCb;
9919 wpt_uint8* pSendBuffer = NULL;
9920 wpt_uint16 usDataOffset = 0;
9921 wpt_uint16 usSendSize = 0;
9922 wpt_uint16 reqLen;
9923 tStartOemDataReqParams* halStartOemDataReqParams;
9924
9925 /*-------------------------------------------------------------------------
9926 Sanity check
9927 -------------------------------------------------------------------------*/
9928 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9929 ( NULL == pEventData->pCBfnc ))
9930 {
9931 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9932 "%s: Invalid parameters", __FUNCTION__);
9933 WDI_ASSERT(0);
9934 return WDI_STATUS_E_FAILURE;
9935 }
9936
9937 pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData;
9938 wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc;
9939
9940 /*-----------------------------------------------------------------------
9941 Get message buffer
9942 -----------------------------------------------------------------------*/
9943
9944 reqLen = sizeof(tStartOemDataReqParams);
9945
9946 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9947 WDI_START_OEM_DATA_REQ, reqLen,
9948 &pSendBuffer, &usDataOffset, &usSendSize))||
9949 (usSendSize < (usDataOffset + reqLen)))
9950 {
9951 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9952 "Unable to get send buffer in Start Oem Data req %x %x %x",
9953 pEventData, pwdiOemDataReqParams, wdiOemDataRspCb);
9954 WDI_ASSERT(0);
9955 return WDI_STATUS_E_FAILURE;
9956 }
9957
9958 //copying WDI OEM DATA REQ PARAMS to shared memory
9959 halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset );
9960
9961 wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr));
9962 wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE);
9963
9964 pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB;
9965 pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData;
9966
9967 /*-------------------------------------------------------------------------
9968 Send Start Request to HAL
9969 -------------------------------------------------------------------------*/
9970 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9971 wdiOemDataRspCb, pEventData->pUserData,
9972 WDI_START_OEM_DATA_RESP);
9973}/*WDI_ProcessStartOemDataReq*/
9974#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07009975
9976/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009977 @brief Process Host Resume Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009978 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009979
9980 @param pWDICtx: pointer to the WLAN DAL context
9981 pEventData: pointer to the event information structure
9982
Jeff Johnson295189b2012-06-20 16:38:30 -07009983 @see
9984 @return Result of the function call
9985*/
9986WDI_Status
9987WDI_ProcessHostResumeReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009988(
Jeff Johnson295189b2012-06-20 16:38:30 -07009989 WDI_ControlBlockType* pWDICtx,
9990 WDI_EventInfoType* pEventData
9991)
9992{
9993 WDI_ResumeParamsType* pwdiHostResumeParams = NULL;
9994 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009995 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009996 wpt_uint16 usDataOffset = 0;
9997 wpt_uint16 usSendSize = 0;
9998 tHalWlanHostResumeReqParam halResumeReqParams;
9999
10000 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10001
10002 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010003 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010004 -------------------------------------------------------------------------*/
10005 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10006 ( NULL == pEventData->pCBfnc ))
10007 {
10008 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10009 "%s: Invalid parameters ",__FUNCTION__);
10010 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010011 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010012 }
10013
10014 pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData;
10015 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc;
10016
10017 /*-----------------------------------------------------------------------
10018 Get message buffer
10019 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010020 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010021 WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams),
10022 &pSendBuffer, &usDataOffset, &usSendSize))||
10023 (usSendSize < (usDataOffset + sizeof(halResumeReqParams))))
10024 {
10025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070010026 "Unable to get send buffer in Start Oem Data req %x %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070010027 pEventData, pwdiHostResumeParams, wdiHostResumeRspCb);
10028 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010029 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010030 }
10031
Jeff Johnsone7245742012-09-05 17:12:55 -070010032 halResumeReqParams.configuredMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070010033 pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070010034
10035 wpalMemoryCopy( pSendBuffer+usDataOffset,
10036 &halResumeReqParams,
10037 sizeof(halResumeReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010038
10039 pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010040 pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010041
10042 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010043 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010044 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010045 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10046 wdiHostResumeRspCb, pEventData->pUserData,
10047 WDI_HOST_RESUME_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010048}/*WDI_ProcessHostResumeReq*/
10049
10050/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010051 @brief Process set Tx Per Tracking Parameters Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070010052 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010053
10054 @param pWDICtx: pointer to the WLAN DAL context
10055 pEventData: pointer to the event information structure
10056
Jeff Johnson295189b2012-06-20 16:38:30 -070010057 @see
10058 @return Result of the function call
10059*/
10060WDI_Status
10061WDI_ProcessSetTxPerTrackingReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010062(
Jeff Johnson295189b2012-06-20 16:38:30 -070010063 WDI_ControlBlockType* pWDICtx,
10064 WDI_EventInfoType* pEventData
10065)
10066{
10067 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL;
10068 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010069 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010070 wpt_uint16 usDataOffset = 0;
10071 wpt_uint16 usSendSize = 0;
10072 tHalTxPerTrackingReqParam halTxPerTrackingReqParam;
10073 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10074
10075 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010076 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010077 -------------------------------------------------------------------------*/
10078 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10079 ( NULL == pEventData->pCBfnc ))
10080 {
10081 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10082 "%s: Invalid parameters ",__FUNCTION__);
10083 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010084 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010085 }
10086
10087 pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData;
10088 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -070010089
Jeff Johnson295189b2012-06-20 16:38:30 -070010090 /*-----------------------------------------------------------------------
10091 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010092 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010093 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010094 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010095 sizeof(halTxPerTrackingReqParam),
10096 &pSendBuffer, &usDataOffset, &usSendSize))||
10097 ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) )))
10098 {
10099 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10100 "Unable to get send buffer in set tx per tracking req %x %x %x",
10101 pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb);
10102 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010103 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010104 }
Jeff Johnsone7245742012-09-05 17:12:55 -070010105
Jeff Johnson295189b2012-06-20 16:38:30 -070010106 halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable;
10107 halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod;
10108 halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio;
10109 halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark;
Jeff Johnsone7245742012-09-05 17:12:55 -070010110
10111 wpalMemoryCopy( pSendBuffer+usDataOffset,
10112 &halTxPerTrackingReqParam,
10113 sizeof(halTxPerTrackingReqParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010114
10115 pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010116 pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010117
10118 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010119 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010120 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010121 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10122 pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010123}/*WDI_ProcessSetTxPerTrackingReq*/
10124
10125/*=========================================================================
10126 Indications
10127=========================================================================*/
10128
10129/**
10130 @brief Process Suspend Indications function (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010131
10132 @param pWDICtx: pointer to the WLAN DAL context
10133 pEventData: pointer to the event information structure
10134
Jeff Johnson295189b2012-06-20 16:38:30 -070010135 @see
10136 @return Result of the function call
10137*/
10138WDI_Status
10139WDI_ProcessHostSuspendInd
Jeff Johnsone7245742012-09-05 17:12:55 -070010140(
Jeff Johnson295189b2012-06-20 16:38:30 -070010141 WDI_ControlBlockType* pWDICtx,
10142 WDI_EventInfoType* pEventData
10143)
10144{
10145 WDI_SuspendParamsType *pSuspendIndParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070010146 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010147 wpt_uint16 usDataOffset = 0;
10148 wpt_uint16 usSendSize = 0;
10149 WDI_Status wdiStatus;
10150 tHalWlanHostSuspendIndParam halWlanSuspendIndparams;
10151 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10152
10153 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010154 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010155 -------------------------------------------------------------------------*/
10156 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
10157 {
10158 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10159 "%s: Invalid parameters in Suspend ind",__FUNCTION__);
10160 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010161 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010162 }
10163
10164 pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData;
10165
10166 /*-----------------------------------------------------------------------
10167 Get message buffer
10168 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010169 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
10170 WDI_HOST_SUSPEND_IND,
Jeff Johnson295189b2012-06-20 16:38:30 -070010171 sizeof(halWlanSuspendIndparams),
10172 &pSendBuffer, &usDataOffset, &usSendSize))||
10173 (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams))))
10174 {
10175 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10176 "Unable to get send buffer in Suspend Ind ");
10177 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010178 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010179 }
10180
10181 halWlanSuspendIndparams.configuredMcstBcstFilterSetting =
10182 pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting;
10183
Jeff Johnsone7245742012-09-05 17:12:55 -070010184 halWlanSuspendIndparams.activeSessionCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070010185 WDI_GetActiveSessionsCount(pWDICtx);
10186
Jeff Johnsone7245742012-09-05 17:12:55 -070010187 wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams,
10188 sizeof(tHalWlanHostSuspendIndParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010189
10190 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010191 Send Suspend Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010192 -------------------------------------------------------------------------*/
10193 pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010194 pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010195
Jeff Johnsone7245742012-09-05 17:12:55 -070010196 wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070010197 return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC;
10198}/*WDI_ProcessHostSuspendInd*/
10199
10200/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070010201 MISC CONTROL PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -070010202==========================================================================*/
10203/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010204 @brief Process Channel Switch Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010205 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010206
10207 @param pWDICtx: pointer to the WLAN DAL context
10208 pEventData: pointer to the event information structure
10209
Jeff Johnson295189b2012-06-20 16:38:30 -070010210 @see
10211 @return Result of the function call
10212*/
10213WDI_Status
10214WDI_ProcessChannelSwitchReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010215(
Jeff Johnson295189b2012-06-20 16:38:30 -070010216 WDI_ControlBlockType* pWDICtx,
10217 WDI_EventInfoType* pEventData
10218)
10219{
10220 WDI_SwitchChReqParamsType* pwdiSwitchChParams;
10221 WDI_SwitchChRspCb wdiSwitchChRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010222 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010223 wpt_uint16 usDataOffset = 0;
10224 wpt_uint16 usSendSize = 0;
10225 tSwitchChannelReqMsg halSwitchChannelReq = {{0}};
10226 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10227
10228 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010229 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010230 -------------------------------------------------------------------------*/
10231 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10232 ( NULL == pEventData->pCBfnc ))
10233 {
10234 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10235 "%s: Invalid parameters", __FUNCTION__);
10236 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010237 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010238 }
10239
10240 pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData;
10241 wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc;
10242 /*-----------------------------------------------------------------------
10243 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010244 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010245 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010246 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010247 sizeof(halSwitchChannelReq.switchChannelParams),
10248 &pSendBuffer, &usDataOffset, &usSendSize))||
10249 ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) )))
10250 {
10251 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10252 "Unable to get send buffer in channel switch req %x %x %x",
10253 pEventData, pwdiSwitchChParams, wdiSwitchChRspCb);
10254 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010255 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010256 }
10257
Jeff Johnsone7245742012-09-05 17:12:55 -070010258 halSwitchChannelReq.switchChannelParams.channelNumber =
Jeff Johnson295189b2012-06-20 16:38:30 -070010259 pwdiSwitchChParams->wdiChInfo.ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -070010260#ifndef WLAN_FEATURE_VOWIFI
10261 halSwitchChannelReq.switchChannelParams.localPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -070010262 pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint;
10263#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010264 halSwitchChannelReq.switchChannelParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070010265 pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset;
10266
10267#ifdef WLAN_FEATURE_VOWIFI
10268 halSwitchChannelReq.switchChannelParams.maxTxPower
Jeff Johnsone7245742012-09-05 17:12:55 -070010269 = pwdiSwitchChParams->wdiChInfo.cMaxTxPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070010270 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr,
10271 pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr,
10272 WDI_MAC_ADDR_LEN);
10273 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId,
10274 pwdiSwitchChParams->wdiChInfo.macBSSId,
10275 WDI_MAC_ADDR_LEN);
10276#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010277 wpalMemoryCopy( pSendBuffer+usDataOffset,
10278 &halSwitchChannelReq.switchChannelParams,
10279 sizeof(halSwitchChannelReq.switchChannelParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010280
10281 pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010282 pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010283
10284 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010285 Send Switch Channel Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010286 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010287 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10288 wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010289}/*WDI_ProcessChannelSwitchReq*/
10290
10291/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010292 @brief Process Config STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010293 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010294
10295 @param pWDICtx: pointer to the WLAN DAL context
10296 pEventData: pointer to the event information structure
10297
Jeff Johnson295189b2012-06-20 16:38:30 -070010298 @see
10299 @return Result of the function call
10300*/
10301WDI_Status
10302WDI_ProcessConfigStaReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010303(
Jeff Johnson295189b2012-06-20 16:38:30 -070010304 WDI_ControlBlockType* pWDICtx,
10305 WDI_EventInfoType* pEventData
10306)
10307{
10308 WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams;
10309 WDI_ConfigSTARspCb wdiConfigSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010310 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010311 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010312 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010313 wpt_uint16 usDataOffset = 0;
10314 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010315 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010316
Jeff Johnsone7245742012-09-05 17:12:55 -070010317 tConfigStaReqMsg halConfigStaReqMsg;
10318 wpt_uint16 uMsgSize = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010319 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10320
10321 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010322 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010323 -------------------------------------------------------------------------*/
10324 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10325 ( NULL == pEventData->pCBfnc ))
10326 {
10327 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10328 "%s: Invalid parameters", __FUNCTION__);
10329 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010330 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010331 }
10332
10333 pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData;
10334 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc;
10335 /*-------------------------------------------------------------------------
10336 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010337 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010338 -------------------------------------------------------------------------*/
10339 wpalMutexAcquire(&pWDICtx->wptMutex);
10340
10341 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010342 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010343 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010344 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10345 pwdiConfigSTAParams->wdiReqInfo.macBSSID,
10346 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010347
Jeff Johnsone7245742012-09-05 17:12:55 -070010348 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010349 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010350 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10351 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10352 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010353
10354 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010355 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010356 }
10357
10358 /*------------------------------------------------------------------------
10359 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010360 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010361 ------------------------------------------------------------------------*/
10362 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10363 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010364 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10365 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10366 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010367
Jeff Johnsone7245742012-09-05 17:12:55 -070010368 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010369 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010370 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010371 }
10372
10373 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010374
10375 /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */
10376#ifdef WLAN_FEATURE_11AC
10377 if (WDI_getFwWlanFeatCaps(DOT11AC))
10378 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC
10379 else
10380#endif
10381 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default
10382
Jeff Johnson295189b2012-06-20 16:38:30 -070010383 /*-----------------------------------------------------------------------
10384 Get message buffer
10385 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010386 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ,
10387 uMsgSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070010388 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010389 ( usSendSize < (usDataOffset + uMsgSize )))
Jeff Johnson295189b2012-06-20 16:38:30 -070010390 {
10391 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10392 "Unable to get send buffer in config sta req %x %x %x",
10393 pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb);
10394 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010395 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010396 }
10397
10398 /*Copy the station context*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010399 WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010400 &pwdiConfigSTAParams->wdiReqInfo);
10401
10402 if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF)
10403 {
10404 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010405 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -070010406 WDI_STATableFindStaidByAddr(pWDICtx,
10407 pwdiConfigSTAParams->wdiReqInfo.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070010408 (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx ))
Jeff Johnson295189b2012-06-20 16:38:30 -070010409 {
10410 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10411 "This station does not exist in the WDI Station Table %d");
10412 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010413 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010414 }
10415 }
10416 else
10417 {
10418 /* Need to fill in the STA Index to invalid, since at this point we have not
10419 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -070010420 halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070010421 }
10422
10423 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010424 halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070010425
Jeff Johnsone7245742012-09-05 17:12:55 -070010426 wpalMemoryCopy( pSendBuffer+usDataOffset,
10427 &halConfigStaReqMsg.uStaParams,
10428 sizeof(halConfigStaReqMsg.uStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010429
10430 pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010431 pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010432
Jeff Johnsone7245742012-09-05 17:12:55 -070010433 wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq,
10434 pwdiConfigSTAParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010435 sizeof(pWDICtx->wdiCachedConfigStaReq));
10436
10437 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010438 Send Config STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010439 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010440 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10441 wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010442}/*WDI_ProcessConfigStaReq*/
10443
10444
10445/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010446 @brief Process Set Link State Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010447 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010448
10449 @param pWDICtx: pointer to the WLAN DAL context
10450 pEventData: pointer to the event information structure
10451
Jeff Johnson295189b2012-06-20 16:38:30 -070010452 @see
10453 @return Result of the function call
10454*/
10455WDI_Status
10456WDI_ProcessSetLinkStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010457(
Jeff Johnson295189b2012-06-20 16:38:30 -070010458 WDI_ControlBlockType* pWDICtx,
10459 WDI_EventInfoType* pEventData
10460)
10461{
10462 WDI_SetLinkReqParamsType* pwdiSetLinkParams;
10463 WDI_SetLinkStateRspCb wdiSetLinkRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010464 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010465 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010466 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010467 wpt_uint16 usDataOffset = 0;
10468 wpt_uint16 usSendSize = 0;
10469 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnsone7245742012-09-05 17:12:55 -070010470 tLinkStateParams halLinkStateReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070010471 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10472
10473 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010474 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010475 -------------------------------------------------------------------------*/
10476 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10477 ( NULL == pEventData->pCBfnc ))
10478 {
10479 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10480 "%s: Invalid parameters", __FUNCTION__);
10481 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010482 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010483 }
10484
10485 pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData;
10486 wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc;
10487 /*-------------------------------------------------------------------------
10488 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010489 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010490 -------------------------------------------------------------------------*/
10491 wpalMutexAcquire(&pWDICtx->wptMutex);
10492
10493 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010494 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010495 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010496 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10497 pwdiSetLinkParams->wdiLinkInfo.macBSSID,
10498 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010499
Jeff Johnsone7245742012-09-05 17:12:55 -070010500 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010501 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010502 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10503 "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR,
10504 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010505 }
10506 else
10507 {
10508 /*------------------------------------------------------------------------
10509 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010510 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010511 ------------------------------------------------------------------------*/
10512 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10513 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010514 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10515 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10516 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
10517
10518 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010519 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010520 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010521 }
10522 }
10523 /* If the link is set to enter IDLE - the Session allocated for this BSS
10524 will be deleted on the Set Link State response coming from HAL
10525 - cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -070010526 wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010527 sizeof(pWDICtx->wdiCacheSetLinkStReq));
10528
10529 wpalMutexRelease(&pWDICtx->wptMutex);
10530 /*-----------------------------------------------------------------------
10531 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010532 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010533 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010534
10535 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010536 sizeof(halLinkStateReqMsg),
10537 &pSendBuffer, &usDataOffset, &usSendSize))||
10538 ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) )))
10539 {
10540 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10541 "Unable to get send buffer in set bss key req %x %x %x",
10542 pEventData, pwdiSetLinkParams, wdiSetLinkRspCb);
10543 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010544 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010545 }
10546
10547 wpalMemoryCopy(halLinkStateReqMsg.bssid,
10548 pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN);
10549
10550 wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr,
10551 pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN);
10552
Jeff Johnsone7245742012-09-05 17:12:55 -070010553 halLinkStateReqMsg.state =
Jeff Johnson295189b2012-06-20 16:38:30 -070010554 WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState);
10555
Jeff Johnsone7245742012-09-05 17:12:55 -070010556 wpalMemoryCopy( pSendBuffer+usDataOffset,
10557 &halLinkStateReqMsg,
10558 sizeof(halLinkStateReqMsg));
Jeff Johnson295189b2012-06-20 16:38:30 -070010559
10560 pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010561 pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010562
10563 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010564 Send Set Link State Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010565 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010566 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10567 wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010568}/*WDI_ProcessSetLinkStateReq*/
10569
10570
10571/**
10572 @brief Process Get Stats Request function (called when Main FSM
10573 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010574
10575 @param pWDICtx: pointer to the WLAN DAL context
10576 pEventData: pointer to the event information structure
10577
Jeff Johnson295189b2012-06-20 16:38:30 -070010578 @see
10579 @return Result of the function call
10580*/
10581WDI_Status
10582WDI_ProcessGetStatsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010583(
Jeff Johnson295189b2012-06-20 16:38:30 -070010584 WDI_ControlBlockType* pWDICtx,
10585 WDI_EventInfoType* pEventData
10586)
10587{
10588 WDI_GetStatsReqParamsType* pwdiGetStatsParams;
10589 WDI_GetStatsRspCb wdiGetStatsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010590 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010591 wpt_uint16 usDataOffset = 0;
10592 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010593 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010594 WDI_BSSSessionType* pBSSSes = NULL;
10595 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010596 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010597 tHalStatsReqMsg halStatsReqMsg;
10598 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10599
10600 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010601 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010602 -------------------------------------------------------------------------*/
10603 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) ||
10604 ( NULL == pEventData->pCBfnc ) )
10605 {
10606 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10607 "%s: Invalid parameters", __FUNCTION__);
10608 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010609 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010610 }
10611
10612 pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData;
10613 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc;
10614
10615 /*-------------------------------------------------------------------------
10616 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010617 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010618 -------------------------------------------------------------------------*/
10619 wpalMutexAcquire(&pWDICtx->wptMutex);
10620
10621 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010622 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010623 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010624 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10625 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010626 &macBSSID))
10627 {
10628 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10629 "This station does not exist in the WDI Station Table %d");
10630 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010631 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010632 }
10633
Jeff Johnsone7245742012-09-05 17:12:55 -070010634 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10635 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010636 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010637 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10638 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10639 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010640
10641 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010642 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010643 }
10644
10645 /*------------------------------------------------------------------------
10646 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010647 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010648 ------------------------------------------------------------------------*/
10649 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10650 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010651 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10652 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10653 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010654
Jeff Johnsone7245742012-09-05 17:12:55 -070010655 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010656 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010657 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010658 }
10659
10660
10661 wpalMutexRelease(&pWDICtx->wptMutex);
10662
10663 /*-----------------------------------------------------------------------
10664 Get message buffer
10665 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010666 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010667 sizeof(halStatsReqMsg.statsReqParams),
10668 &pSendBuffer, &usDataOffset, &usSendSize))||
10669 ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) )))
10670 {
10671 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10672 "Unable to get send buffer in set bss key req %x %x %x",
10673 pEventData, pwdiGetStatsParams, wdiGetStatsRspCb);
10674 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010675 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010676 }
10677
Jeff Johnsone7245742012-09-05 17:12:55 -070010678 halStatsReqMsg.statsReqParams.staId =
Jeff Johnson295189b2012-06-20 16:38:30 -070010679 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070010680 halStatsReqMsg.statsReqParams.statsMask =
Jeff Johnson295189b2012-06-20 16:38:30 -070010681 pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask;
Jeff Johnsone7245742012-09-05 17:12:55 -070010682 wpalMemoryCopy( pSendBuffer+usDataOffset,
10683 &halStatsReqMsg.statsReqParams,
10684 sizeof(halStatsReqMsg.statsReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010685
10686 pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010687 pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010688
10689 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010690 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010691 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010692 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10693 wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010694}/*WDI_ProcessGetStatsReq*/
10695
10696/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010697 @brief Process Update Cfg Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070010698 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010699
10700 @param pWDICtx: pointer to the WLAN DAL context
10701 pEventData: pointer to the event information structure
10702
Jeff Johnson295189b2012-06-20 16:38:30 -070010703 @see
10704 @return Result of the function call
10705*/
10706WDI_Status
10707WDI_ProcessUpdateCfgReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010708(
Jeff Johnson295189b2012-06-20 16:38:30 -070010709 WDI_ControlBlockType* pWDICtx,
10710 WDI_EventInfoType* pEventData
10711)
10712{
10713 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL;
10714 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL;
10715
Jeff Johnsone7245742012-09-05 17:12:55 -070010716 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010717 wpt_uint16 usDataOffset = 0;
10718 wpt_uint16 usSendSize = 0;
10719 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10720
10721 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010722 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010723 -------------------------------------------------------------------------*/
10724 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10725 ( NULL == pEventData->pCBfnc))
10726 {
10727 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10728 "%s: Invalid parameters", __FUNCTION__);
10729 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010730 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010731 }
10732
10733 pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData;
10734 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc;
10735
10736 /*-----------------------------------------------------------------------
10737 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010738 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010739 -----------------------------------------------------------------------*/
10740
Jeff Johnsone7245742012-09-05 17:12:55 -070010741 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010742 pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32),
10743 &pSendBuffer, &usDataOffset, &usSendSize))||
10744 ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen)))
10745 {
10746 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10747 "Unable to get send buffer in set bss key req %x %x %x",
10748 pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb);
10749 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010750 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010751 }
10752
Jeff Johnsone7245742012-09-05 17:12:55 -070010753 wpalMemoryCopy( pSendBuffer+usDataOffset,
10754 &pwdiUpdateCfgParams->uConfigBufferLen,
10755 sizeof(wpt_uint32));
10756 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32),
10757 pwdiUpdateCfgParams->pConfigBuffer,
10758 pwdiUpdateCfgParams->uConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -070010759
10760 pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010761 pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010762
10763 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010764 Send Update Cfg Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010765 -------------------------------------------------------------------------*/
10766
Jeff Johnsone7245742012-09-05 17:12:55 -070010767 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10768 wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010769
10770}/*WDI_ProcessUpdateCfgReq*/
10771
10772
10773/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010774 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010775 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010776
10777 @param pWDICtx: pointer to the WLAN DAL context
10778 pEventData: pointer to the event information structure
10779
Jeff Johnson295189b2012-06-20 16:38:30 -070010780 @see
10781 @return Result of the function call
10782*/
10783WDI_Status
10784WDI_ProcessAddBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010785(
Jeff Johnson295189b2012-06-20 16:38:30 -070010786 WDI_ControlBlockType* pWDICtx,
10787 WDI_EventInfoType* pEventData
10788)
10789{
10790 WDI_AddBAReqParamsType* pwdiAddBAParams;
10791 WDI_AddBARspCb wdiAddBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010792 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010793 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010794 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010795 wpt_uint16 usDataOffset = 0;
10796 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010797 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010798 wpt_macAddr macBSSID;
10799
10800 tAddBAReqMsg halAddBAReq;
10801 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10802
10803 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010804 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010805 -------------------------------------------------------------------------*/
10806 if (( NULL == pEventData ) ||
10807 ( NULL == pEventData->pEventData) ||
10808 ( NULL == pEventData->pCBfnc ))
10809 {
10810 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10811 "%s: Invalid parameters", __FUNCTION__);
10812 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010813 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010814 }
10815
10816 pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData;
10817 wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc;
10818
10819 /*-------------------------------------------------------------------------
10820 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010821 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010822 -------------------------------------------------------------------------*/
10823 wpalMutexAcquire(&pWDICtx->wptMutex);
10824
10825 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010826 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010827 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010828 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10829 pwdiAddBAParams->wdiBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010830 &macBSSID))
10831 {
10832 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10833 "This station does not exist in the WDI Station Table %d");
10834 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010835 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010836 }
10837
Jeff Johnsone7245742012-09-05 17:12:55 -070010838 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10839 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010840 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010841 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10842 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10843 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010844
10845 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010846 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010847 }
10848
10849 /*------------------------------------------------------------------------
10850 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010851 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010852 ------------------------------------------------------------------------*/
10853 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10854 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010855 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10856 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10857 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010858
Jeff Johnsone7245742012-09-05 17:12:55 -070010859 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010860 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010861 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010862 }
10863
10864
10865 wpalMutexRelease(&pWDICtx->wptMutex);
10866 /*-----------------------------------------------------------------------
10867 Get message buffer
10868 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010869 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010870 sizeof(halAddBAReq.addBAParams),
10871 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010872 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070010873 (usDataOffset + sizeof(halAddBAReq.addBAParams) )))
10874 {
10875 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10876 "Unable to get send buffer in Add BA req %x %x %x",
10877 pEventData, pwdiAddBAParams, wdiAddBARspCb);
10878 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010879 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010880 }
10881
Jeff Johnsone7245742012-09-05 17:12:55 -070010882 halAddBAReq.addBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070010883 pwdiAddBAParams->wdiBAInfoType.ucBaSessionID;
10884 halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize;
10885#ifdef FEATURE_ON_CHIP_REORDERING
Jeff Johnsone7245742012-09-05 17:12:55 -070010886 halAddBAReq.addBAParams.isReorderingDoneOnChip =
Jeff Johnson295189b2012-06-20 16:38:30 -070010887 pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip;
10888#endif
10889
Jeff Johnsone7245742012-09-05 17:12:55 -070010890 wpalMemoryCopy( pSendBuffer+usDataOffset,
10891 &halAddBAReq.addBAParams,
10892 sizeof(halAddBAReq.addBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010893
10894 pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010895 pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010896
10897 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010898 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010899 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010900 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10901 wdiAddBARspCb, pEventData->pUserData,
10902 WDI_ADD_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010903}/*WDI_ProcessAddBAReq*/
10904
10905
10906
10907/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010908 @brief Process Trigger BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010909 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010910
10911 @param pWDICtx: pointer to the WLAN DAL context
10912 pEventData: pointer to the event information structure
10913
Jeff Johnson295189b2012-06-20 16:38:30 -070010914 @see
10915 @return Result of the function call
10916*/
10917WDI_Status
10918WDI_ProcessTriggerBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010919(
Jeff Johnson295189b2012-06-20 16:38:30 -070010920 WDI_ControlBlockType* pWDICtx,
10921 WDI_EventInfoType* pEventData
10922)
10923{
10924 WDI_TriggerBAReqParamsType* pwdiTriggerBAParams;
10925 WDI_TriggerBARspCb wdiTriggerBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010926 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010927 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010928 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010929 wpt_uint16 usDataOffset = 0;
10930 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010931 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010932 wpt_uint16 index;
10933 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010934
Jeff Johnson295189b2012-06-20 16:38:30 -070010935 tTriggerBAReqMsg halTriggerBAReq;
10936 tTriggerBaReqCandidate* halTriggerBACandidate;
10937 WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate;
10938 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10939
10940 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010941 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010942 -------------------------------------------------------------------------*/
10943 if (( NULL == pEventData ) ||
10944 ( NULL == pEventData->pEventData ) ||
10945 ( NULL == pEventData->pCBfnc ))
10946 {
10947 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10948 "%s: Invalid parameters", __FUNCTION__);
10949 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010950 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010951 }
10952
10953 pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData;
10954 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc;
10955 /*-------------------------------------------------------------------------
10956 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010957 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010958 -------------------------------------------------------------------------*/
10959 wpalMutexAcquire(&pWDICtx->wptMutex);
10960
10961 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010962 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010963 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010964 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10965 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010966 &macBSSID))
10967 {
10968 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10969 "This station does not exist in the WDI Station Table %d");
10970 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010971 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010972 }
10973
Jeff Johnsone7245742012-09-05 17:12:55 -070010974 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10975 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010976 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010977 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10978 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10979 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010980
10981 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010982 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010983 }
10984
10985 /*------------------------------------------------------------------------
10986 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010987 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010988 ------------------------------------------------------------------------*/
10989 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10990 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010991 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10992 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10993 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010994
Jeff Johnsone7245742012-09-05 17:12:55 -070010995 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010996 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010997 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010998 }
10999
11000
11001 wpalMutexRelease(&pWDICtx->wptMutex);
11002 /*-----------------------------------------------------------------------
11003 Get message buffer
11004 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011005 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11006 WDI_TRIGGER_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011007 sizeof(halTriggerBAReq.triggerBAParams) +
Jeff Johnsone7245742012-09-05 17:12:55 -070011008 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011009 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt),
11010 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011011 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070011012 (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+
Jeff Johnsone7245742012-09-05 17:12:55 -070011013 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011014 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) )))
11015 {
11016 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11017 "Unable to get send buffer in Trigger BA req %x %x %x",
11018 pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb);
11019 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011020 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011021 }
11022
Jeff Johnsone7245742012-09-05 17:12:55 -070011023 halTriggerBAReq.triggerBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070011024 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID;
Jeff Johnsone7245742012-09-05 17:12:55 -070011025 halTriggerBAReq.triggerBAParams.baCandidateCnt =
Jeff Johnson295189b2012-06-20 16:38:30 -070011026 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt;
11027
Jeff Johnsone7245742012-09-05 17:12:55 -070011028 wpalMemoryCopy( pSendBuffer+usDataOffset,
11029 &halTriggerBAReq.triggerBAParams,
11030 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011031
Jeff Johnsone7245742012-09-05 17:12:55 -070011032 wdiTriggerBACandidate =
Jeff Johnson295189b2012-06-20 16:38:30 -070011033 (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1);
11034 halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+
11035 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnsone7245742012-09-05 17:12:55 -070011036
11037 for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ;
Jeff Johnson295189b2012-06-20 16:38:30 -070011038 index++)
11039 {
11040 halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx;
11041 halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap;
11042 halTriggerBACandidate++;
11043 wdiTriggerBACandidate++;
11044 }
11045
11046 pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011047 pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011048
11049 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011050 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011051 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011052 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11053 wdiTriggerBARspCb, pEventData->pUserData,
11054 WDI_TRIGGER_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011055}/*WDI_ProcessTriggerBAReq*/
11056
11057
11058
11059/**
11060 @brief Process Update Beacon Params Request function (called when Main FSM
11061 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011062
11063 @param pWDICtx: pointer to the WLAN DAL context
11064 pEventData: pointer to the event information structure
11065
Jeff Johnson295189b2012-06-20 16:38:30 -070011066 @see
11067 @return Result of the function call
11068*/
11069WDI_Status
11070WDI_ProcessUpdateBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011071(
Jeff Johnson295189b2012-06-20 16:38:30 -070011072 WDI_ControlBlockType* pWDICtx,
11073 WDI_EventInfoType* pEventData
11074)
11075{
11076 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams;
11077 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011078 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011079 wpt_uint16 usDataOffset = 0;
11080 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011081 tUpdateBeaconParams halUpdateBeaconParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011082 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11083
11084 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011085 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011086 -------------------------------------------------------------------------*/
11087 if (( NULL == pEventData ) ||
11088 ( NULL == pEventData->pEventData) ||
11089 ( NULL == pEventData->pCBfnc))
11090 {
11091 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11092 "%s: Invalid parameters", __FUNCTION__);
11093 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011094 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011095 }
11096
11097 pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData;
11098 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc;
11099 /*-----------------------------------------------------------------------
11100 Get message buffer
11101 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011102 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011103 sizeof(halUpdateBeaconParams),
11104 &pSendBuffer, &usDataOffset, &usSendSize))||
11105 ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) )))
11106 {
11107 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11108 "Unable to get send buffer in set bss key req %x %x %x",
11109 pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb);
11110 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011111 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011112 }
11113
11114 /*BSS Index of the BSS*/
11115 halUpdateBeaconParams.bssIdx =
11116 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx;
11117 /*shortPreamble mode. HAL should update all the STA rates when it
11118 receives this message*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011119 halUpdateBeaconParams.fShortPreamble =
Jeff Johnson295189b2012-06-20 16:38:30 -070011120 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble;
11121 /* short Slot time.*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011122 halUpdateBeaconParams.fShortSlotTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070011123 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime;
11124 /* Beacon Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070011125 halUpdateBeaconParams.beaconInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011126 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval;
11127
11128 /*Protection related */
Jeff Johnsone7245742012-09-05 17:12:55 -070011129 halUpdateBeaconParams.llaCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011130 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011131 halUpdateBeaconParams.llbCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011132 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011133 halUpdateBeaconParams.llgCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011134 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011135 halUpdateBeaconParams.ht20MhzCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011136 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011137 halUpdateBeaconParams.llnNonGFCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011138 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011139 halUpdateBeaconParams.fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070011140 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport;
11141 halUpdateBeaconParams.fRIFSMode =
11142 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode;
Jeff Johnsone7245742012-09-05 17:12:55 -070011143 halUpdateBeaconParams.paramChangeBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070011144 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap;
11145
Jeff Johnsone7245742012-09-05 17:12:55 -070011146 wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams,
11147 sizeof(halUpdateBeaconParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011148
11149 pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011150 pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011151
11152 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011153 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011154 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011155 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11156 wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011157}/*WDI_ProcessUpdateBeaconParamsReq*/
11158
11159
11160
11161/**
11162 @brief Process Send Beacon template Request function (called when Main FSM
11163 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011164
11165 @param pWDICtx: pointer to the WLAN DAL context
11166 pEventData: pointer to the event information structure
11167
Jeff Johnson295189b2012-06-20 16:38:30 -070011168 @see
11169 @return Result of the function call
11170*/
11171WDI_Status
11172WDI_ProcessSendBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011173(
Jeff Johnson295189b2012-06-20 16:38:30 -070011174 WDI_ControlBlockType* pWDICtx,
11175 WDI_EventInfoType* pEventData
11176)
11177{
11178 WDI_SendBeaconParamsType* pwdiSendBeaconParams;
11179 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011180 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011181 wpt_uint16 usDataOffset = 0;
11182 wpt_uint16 usSendSize = 0;
11183 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11184
11185 tSendBeaconReqMsg halSendBeaconReq;
11186 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011187 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011188 -------------------------------------------------------------------------*/
11189 if (( NULL == pEventData ) ||
11190 ( NULL == pEventData->pEventData ) ||
11191 ( NULL == pEventData->pCBfnc ))
11192 {
11193 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11194 "%s: Invalid parameters", __FUNCTION__);
11195 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011196 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011197 }
11198
11199 pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData;
11200 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc;
11201 /*-----------------------------------------------------------------------
11202 Get message buffer
11203 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011204 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011205 sizeof(halSendBeaconReq.sendBeaconParam),
11206 &pSendBuffer, &usDataOffset, &usSendSize))||
11207 ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) )))
11208 {
11209 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11210 "Unable to get send buffer in send beacon req %x %x %x",
11211 pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb);
11212 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011213 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011214 }
11215
11216 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId,
11217 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID,
11218 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011219 halSendBeaconReq.sendBeaconParam.beaconLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070011220 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength;
11221 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon,
11222 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon,
11223 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength);
11224#ifdef WLAN_SOFTAP_FEATURE
Jeff Johnsone7245742012-09-05 17:12:55 -070011225 halSendBeaconReq.sendBeaconParam.timIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011226 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset;
11227#endif
11228#ifdef WLAN_FEATURE_P2P
Jeff Johnsone7245742012-09-05 17:12:55 -070011229 halSendBeaconReq.sendBeaconParam.p2pIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011230 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset;
11231#endif
11232
Jeff Johnsone7245742012-09-05 17:12:55 -070011233 wpalMemoryCopy( pSendBuffer+usDataOffset,
11234 &halSendBeaconReq.sendBeaconParam,
11235 sizeof(halSendBeaconReq.sendBeaconParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070011236
11237 pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011238 pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011239
11240 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011241 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011242 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011243 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11244 wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011245}/*WDI_ProcessSendBeaconParamsReq*/
11246
11247/**
11248 @brief Process Update Beacon Params Request function (called when Main FSM
11249 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011250
11251 @param pWDICtx: pointer to the WLAN DAL context
11252 pEventData: pointer to the event information structure
11253
Jeff Johnson295189b2012-06-20 16:38:30 -070011254 @see
11255 @return Result of the function call
11256*/
11257WDI_Status
11258WDI_ProcessUpdateProbeRspTemplateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011259(
Jeff Johnson295189b2012-06-20 16:38:30 -070011260 WDI_ControlBlockType* pWDICtx,
11261 WDI_EventInfoType* pEventData
11262)
11263{
11264 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams;
11265 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011266 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011267 wpt_uint16 usDataOffset = 0;
11268 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011269 tSendProbeRespReqParams halUpdateProbeRspTmplParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011270 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11271
11272 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011273 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011274 -------------------------------------------------------------------------*/
11275 if (( NULL == pEventData ) ||
11276 ( NULL == pEventData->pEventData) ||
11277 ( NULL == pEventData->pCBfnc))
11278 {
11279 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11280 "%s: Invalid parameters", __FUNCTION__);
11281 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011282 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011283 }
11284
Jeff Johnsone7245742012-09-05 17:12:55 -070011285 pwdiUpdateProbeRespTmplParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011286 (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011287 wdiUpdateProbeRespTmplRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011288 (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc;
11289 /*-----------------------------------------------------------------------
11290 Get message buffer
11291 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011292 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011293 sizeof(halUpdateProbeRspTmplParams),
11294 &pSendBuffer, &usDataOffset, &usSendSize))||
11295 ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) )))
11296 {
11297 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11298 "Unable to get send buffer in set bss key req %x %x %x",
11299 pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb);
11300 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011301 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011302 }
11303
11304 wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070011305 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070011306 WDI_MAC_ADDR_LEN);
11307
Jeff Johnsone7245742012-09-05 17:12:55 -070011308 halUpdateProbeRspTmplParams.probeRespTemplateLen =
Jeff Johnson295189b2012-06-20 16:38:30 -070011309 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen;
11310
11311 wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate,
11312 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070011313 BEACON_TEMPLATE_SIZE);
Jeff Johnson295189b2012-06-20 16:38:30 -070011314
11315
11316 wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap,
11317 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap,
11318 WDI_PROBE_REQ_BITMAP_IE_LEN);
11319
Jeff Johnsone7245742012-09-05 17:12:55 -070011320 wpalMemoryCopy( pSendBuffer+usDataOffset,
11321 &halUpdateProbeRspTmplParams,
11322 sizeof(halUpdateProbeRspTmplParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011323
11324 pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011325 pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011326
11327 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011328 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011329 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011330 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11331 wdiUpdateProbeRespTmplRspCb, pEventData->pUserData,
11332 WDI_UPD_PROBE_RSP_TEMPLATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011333}/*WDI_ProcessUpdateProbeRspTemplateReq*/
11334
11335/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011336 @brief Process NV blob download function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070011337 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011338
11339 @param pWDICtx: pointer to the WLAN DAL context
11340 pEventData: pointer to the event information structure
11341
Jeff Johnson295189b2012-06-20 16:38:30 -070011342 @see
11343 @return Result of the function call
11344*/
11345WDI_Status
11346WDI_ProcessNvDownloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011347(
Jeff Johnson295189b2012-06-20 16:38:30 -070011348 WDI_ControlBlockType* pWDICtx,
11349 WDI_EventInfoType* pEventData
11350)
11351{
11352
11353 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL;
11354 WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL;
11355
11356 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011357 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011358 -------------------------------------------------------------------------*/
11359 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011360 ( NULL == (pwdiNvDownloadReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011361 (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011362 ( NULL == (wdiNvDownloadRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011363 (WDI_NvDownloadRspCb)pEventData->pCBfnc)))
11364 {
11365 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11366 "%s: Invalid parameters", __FUNCTION__);
11367 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011368 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011369 }
11370
11371 /*Intialize the Nv Blob Info */
Jeff Johnsone7245742012-09-05 17:12:55 -070011372 pWDICtx->wdiNvBlobInfo.usTotalFragment =
Jeff Johnson295189b2012-06-20 16:38:30 -070011373 TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize);
11374
11375 /*cache the wdi nv request message here if the the first fragment
11376 * To issue the request to HAL for the next fragment */
11377 if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
11378 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011379 wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq,
11380 pwdiNvDownloadReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070011381 sizeof(pWDICtx->wdiCachedNvDownloadReq));
11382
11383 pWDICtx->pfncRspCB = pEventData->pCBfnc;
11384 pWDICtx->pRspCBUserData = pEventData->pUserData;
11385 }
11386
11387 return WDI_SendNvBlobReq(pWDICtx,pEventData);
11388}
11389
11390/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011391 @brief Process Set Max Tx Power Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011392 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011393
11394 @param pWDICtx: pointer to the WLAN DAL context
11395 pEventData: pointer to the event information structure
11396
Jeff Johnson295189b2012-06-20 16:38:30 -070011397 @see
11398 @return Result of the function call
11399*/
11400WDI_Status WDI_ProcessSetMaxTxPowerReq
11401(
11402 WDI_ControlBlockType* pWDICtx,
11403 WDI_EventInfoType* pEventData
11404)
11405{
11406 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL;
11407 WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011408 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011409 wpt_uint16 usDataOffset = 0;
11410 wpt_uint16 usSendSize = 0;
11411 tSetMaxTxPwrReq halSetMaxTxPower;
11412 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11413
11414 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011415 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011416 -------------------------------------------------------------------------*/
11417 if (( NULL == pEventData ) ||
11418 ( NULL == pEventData->pEventData ) ||
11419 ( NULL == pEventData->pCBfnc ))
11420 {
11421 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11422 "%s: Invalid parameters", __FUNCTION__);
11423 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011424 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011425 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011426 pwdiSetMaxTxPowerParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011427 (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011428 wdiSetMaxTxPowerRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011429 (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc;
11430
11431 /*-----------------------------------------------------------------------
11432 Get message buffer
11433 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011434if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011435 sizeof(halSetMaxTxPower.setMaxTxPwrParams),
11436 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011437 ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams)
Jeff Johnson295189b2012-06-20 16:38:30 -070011438)))
11439 {
11440 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11441 "Unable to get Set Max Tx Power req %x %x %x",
11442 pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb);
11443 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011444 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011445 }
11446
11447 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId,
11448 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId,
11449 WDI_MAC_ADDR_LEN);
11450
11451 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr,
11452 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr,
11453 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011454 halSetMaxTxPower.setMaxTxPwrParams.power =
Jeff Johnson295189b2012-06-20 16:38:30 -070011455 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070011456
11457 wpalMemoryCopy( pSendBuffer+usDataOffset,
11458 &halSetMaxTxPower.setMaxTxPwrParams,
11459 sizeof(halSetMaxTxPower.setMaxTxPwrParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011460
11461 pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011462 pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011463
11464 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011465 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011466 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011467 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11468 wdiSetMaxTxPowerRspCb, pEventData->pUserData,
11469 WDI_SET_MAX_TX_POWER_RESP);
11470
Jeff Johnson295189b2012-06-20 16:38:30 -070011471}
11472
11473#ifdef WLAN_FEATURE_P2P
11474
11475/**
11476 @brief Process P2P Notice Of Absence Request function (called when Main FSM
11477 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011478
11479 @param pWDICtx: pointer to the WLAN DAL context
11480 pEventData: pointer to the event information structure
11481
Jeff Johnson295189b2012-06-20 16:38:30 -070011482 @see
11483 @return Result of the function call
11484*/
11485WDI_Status
11486WDI_ProcessP2PGONOAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011487(
Jeff Johnson295189b2012-06-20 16:38:30 -070011488 WDI_ControlBlockType* pWDICtx,
11489 WDI_EventInfoType* pEventData
11490)
11491{
11492 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams;
11493 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011494 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011495 wpt_uint16 usDataOffset = 0;
11496 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011497 tSetP2PGONOAParams halSetP2PGONOAParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011498 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11499
11500 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011501 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011502 -------------------------------------------------------------------------*/
11503 if (( NULL == pEventData ) ||
11504 ( NULL == pEventData->pEventData) ||
11505 ( NULL == pEventData->pCBfnc))
11506 {
11507 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11508 "%s: Invalid parameters", __FUNCTION__);
11509 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011510 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011511 }
11512
Jeff Johnsone7245742012-09-05 17:12:55 -070011513 pwdiP2PGONOAReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011514 (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011515 wdiP2PGONOAReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011516 (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc;
11517 /*-----------------------------------------------------------------------
11518 Get message buffer
11519 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011520 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11521 WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011522 sizeof(halSetP2PGONOAParams),
11523 &pSendBuffer, &usDataOffset, &usSendSize))||
11524 ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) )))
11525 {
11526 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11527 "Unable to get send buffer in set P2P GO NOA REQ %x %x %x",
11528 pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb);
11529 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011530 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011531 }
11532
Jeff Johnsone7245742012-09-05 17:12:55 -070011533 halSetP2PGONOAParams.opp_ps =
Jeff Johnson295189b2012-06-20 16:38:30 -070011534 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps;
Jeff Johnsone7245742012-09-05 17:12:55 -070011535 halSetP2PGONOAParams.ctWindow =
Jeff Johnson295189b2012-06-20 16:38:30 -070011536 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow;
11537 halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount;
Jeff Johnsone7245742012-09-05 17:12:55 -070011538 halSetP2PGONOAParams.duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011539 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011540 halSetP2PGONOAParams.interval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011541 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070011542 halSetP2PGONOAParams.single_noa_duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011543 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011544 halSetP2PGONOAParams.psSelection =
Jeff Johnson295189b2012-06-20 16:38:30 -070011545 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection;
11546
Jeff Johnsone7245742012-09-05 17:12:55 -070011547 wpalMemoryCopy( pSendBuffer+usDataOffset,
11548 &halSetP2PGONOAParams,
11549 sizeof(halSetP2PGONOAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011550
11551 pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011552 pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011553
11554 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011555 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011556 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011557 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11558 wdiP2PGONOAReqRspCb, pEventData->pUserData,
11559 WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011560}/*WDI_ProcessP2PGONOAReq*/
11561
11562#endif
11563
11564
11565/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011566 @brief Function to handle the ack from DXE once the power
Jeff Johnson295189b2012-06-20 16:38:30 -070011567 state is set.
Jeff Johnsone7245742012-09-05 17:12:55 -070011568 @param None
11569
11570 @see
11571 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070011572*/
11573void
11574WDI_SetPowerStateCb
11575(
11576 wpt_status status,
11577 unsigned int dxePhyAddr,
11578 void *pContext
11579)
11580{
11581 wpt_status wptStatus;
11582 WDI_ControlBlockType *pCB = NULL;
11583 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
11584 if(eWLAN_PAL_STATUS_E_FAILURE == status )
11585 {
11586 //it shouldn't happen, put an error msg
11587 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011588 /*
11589 * Trigger the event to bring the Enter BMPS req function to come
11590 * out of wait
Jeff Johnson295189b2012-06-20 16:38:30 -070011591*/
11592 if( NULL != pContext )
11593 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011594 pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnson295189b2012-06-20 16:38:30 -070011595 }
11596 else
11597 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011598 //put an error msg
Jeff Johnson295189b2012-06-20 16:38:30 -070011599 pCB = &gWDICb;
11600 }
11601 pCB->dxePhyAddr = dxePhyAddr;
11602 wptStatus = wpalEventSet(&pCB->setPowerStateEvent);
11603 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
11604 {
11605 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11606 "Failed to set an event");
11607
Jeff Johnsone7245742012-09-05 17:12:55 -070011608 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011609 }
11610 return;
11611}
11612
11613
11614/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011615 @brief Process Enter IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011616 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011617
11618 @param pWDICtx: pointer to the WLAN DAL context
11619 pEventData: pointer to the event information structure
11620
Jeff Johnson295189b2012-06-20 16:38:30 -070011621 @see
11622 @return Result of the function call
11623*/
11624WDI_Status
11625WDI_ProcessEnterImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011626(
Jeff Johnson295189b2012-06-20 16:38:30 -070011627 WDI_ControlBlockType* pWDICtx,
11628 WDI_EventInfoType* pEventData
11629)
11630{
Jeff Johnson43971f52012-07-17 12:26:56 -070011631 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011632 WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011633 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011634 wpt_uint16 usDataOffset = 0;
11635 wpt_uint16 usSendSize = 0;
11636 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11637
11638 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011639 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011640 -------------------------------------------------------------------------*/
11641 if (( NULL == pEventData ) ||
11642 ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc)))
11643 {
11644 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11645 "%s: Invalid parameters", __FUNCTION__);
11646 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011647 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011648 }
11649
11650 /*-----------------------------------------------------------------------
11651 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011652 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011653 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011654 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011655 0,
11656 &pSendBuffer, &usDataOffset, &usSendSize))||
11657 ( usSendSize < (usDataOffset )))
11658 {
11659 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11660 "Unable to get send buffer in Enter IMPS req %x %x",
11661 pEventData, wdiEnterImpsRspCb);
11662 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011663 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011664 }
11665
11666 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011667 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11668 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011669 {
11670 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11671 "WDI Init failed to reset an event");
11672
Jeff Johnsone7245742012-09-05 17:12:55 -070011673 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011674 return VOS_STATUS_E_FAILURE;
11675 }
11676
11677 // notify DTS that we are entering IMPS
11678 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb);
11679
11680 /*
Jeff Johnsone7245742012-09-05 17:12:55 -070011681 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011682 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011683 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11684 WDI_SET_POWER_STATE_TIMEOUT);
11685 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011686 {
11687 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11688 "WDI Init failed to wait on an event");
11689
Jeff Johnsone7245742012-09-05 17:12:55 -070011690 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011691 return VOS_STATUS_E_FAILURE;
11692 }
11693
11694 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011695 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011696 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011697 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11698 wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011699}/*WDI_ProcessEnterImpsReq*/
11700
11701/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011702 @brief Process Exit IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011703 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011704
11705 @param pWDICtx: pointer to the WLAN DAL context
11706 pEventData: pointer to the event information structure
11707
Jeff Johnson295189b2012-06-20 16:38:30 -070011708 @see
11709 @return Result of the function call
11710*/
11711WDI_Status
11712WDI_ProcessExitImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011713(
Jeff Johnson295189b2012-06-20 16:38:30 -070011714 WDI_ControlBlockType* pWDICtx,
11715 WDI_EventInfoType* pEventData
11716)
11717{
11718 WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011719 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011720 wpt_uint16 usDataOffset = 0;
11721 wpt_uint16 usSendSize = 0;
11722 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11723
11724 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011725 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011726 -------------------------------------------------------------------------*/
11727 if (( NULL == pEventData ) ||
11728 ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc)))
11729 {
11730 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11731 "%s: Invalid parameters", __FUNCTION__);
11732 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011733 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011734 }
11735
11736 /*-----------------------------------------------------------------------
11737 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011738 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011739 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011740 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011741 0,
11742 &pSendBuffer, &usDataOffset, &usSendSize))||
11743 ( usSendSize < (usDataOffset )))
11744 {
11745 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11746 "Unable to get send buffer in Exit IMPS req %x %x",
11747 pEventData, wdiExitImpsRspCb);
11748 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011749 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011750 }
11751
11752 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011753 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011754 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011755 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11756 wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011757}/*WDI_ProcessExitImpsReq*/
11758
11759/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011760 @brief Process Enter BMPS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011761 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011762
11763 @param pWDICtx: pointer to the WLAN DAL context
11764 pEventData: pointer to the event information structure
11765
Jeff Johnson295189b2012-06-20 16:38:30 -070011766 @see
11767 @return Result of the function call
11768*/
11769WDI_Status
11770WDI_ProcessEnterBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011771(
Jeff Johnson295189b2012-06-20 16:38:30 -070011772 WDI_ControlBlockType* pWDICtx,
11773 WDI_EventInfoType* pEventData
11774)
11775{
11776 WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL;
11777 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011778 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011779 wpt_uint16 usDataOffset = 0;
11780 wpt_uint16 usSendSize = 0;
11781 tHalEnterBmpsReqParams enterBmpsReq;
Jeff Johnson43971f52012-07-17 12:26:56 -070011782 wpt_status wptStatus;
11783
Jeff Johnson295189b2012-06-20 16:38:30 -070011784 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11785
11786 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011787 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011788 -------------------------------------------------------------------------*/
11789 if (( NULL == pEventData ) ||
11790 ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) ||
11791 ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc)))
11792 {
11793 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11794 "%s: Invalid parameters", __FUNCTION__);
11795 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011796 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011797 }
11798
11799 /*-----------------------------------------------------------------------
11800 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011801 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011802 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011803 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011804 sizeof(enterBmpsReq),
11805 &pSendBuffer, &usDataOffset, &usSendSize))||
11806 ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) )))
11807 {
11808 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11809 "Unable to get send buffer in Enter BMPS req %x %x %x",
11810 pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb);
11811 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011812 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011813 }
11814
11815 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011816 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11817 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011818 {
11819 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11820 "WDI Init failed to reset an event");
11821
Jeff Johnsone7245742012-09-05 17:12:55 -070011822 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011823 return VOS_STATUS_E_FAILURE;
11824 }
11825
11826 // notify DTS that we are entering BMPS
11827 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb);
11828
11829/*
Jeff Johnsone7245742012-09-05 17:12:55 -070011830 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011831 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011832 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11833 WDI_SET_POWER_STATE_TIMEOUT);
11834 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011835 {
11836 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11837 "WDI Init failed to wait on an event");
11838
Jeff Johnsone7245742012-09-05 17:12:55 -070011839 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011840 return VOS_STATUS_E_FAILURE;
11841 }
11842
11843 pWDICtx->bInBmps = eWLAN_PAL_TRUE;
11844
11845 enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx;
11846 enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt;
11847 enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount;
11848 enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod;
11849
11850 // For CCX and 11R Roaming
11851 enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod;
11852 enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage;
11853 enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable;
11854
11855 wpalMemoryCopy( pSendBuffer+usDataOffset,
11856 &enterBmpsReq,
11857 sizeof(enterBmpsReq));
11858
11859 pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011860 pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011861
11862 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011863 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011864 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011865 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11866 wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011867}/*WDI_ProcessEnterBmpsReq*/
11868
11869/**
11870 @brief Process Exit BMPS Request function (called when Main FSM
11871 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011872
11873 @param pWDICtx: pointer to the WLAN DAL context
11874 pEventData: pointer to the event information structure
11875
Jeff Johnson295189b2012-06-20 16:38:30 -070011876 @see
11877 @return Result of the function call
11878*/
11879WDI_Status
11880WDI_ProcessExitBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011881(
Jeff Johnson295189b2012-06-20 16:38:30 -070011882 WDI_ControlBlockType* pWDICtx,
11883 WDI_EventInfoType* pEventData
11884)
11885{
11886 WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL;
11887 WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011888 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011889 wpt_uint16 usDataOffset = 0;
11890 wpt_uint16 usSendSize = 0;
11891 tHalExitBmpsReqParams exitBmpsReq;
11892 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11893
11894 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011895 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011896 -------------------------------------------------------------------------*/
11897 if (( NULL == pEventData ) ||
11898 ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) ||
11899 ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc)))
11900 {
11901 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11902 "%s: Invalid parameters", __FUNCTION__);
11903 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011904 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011905 }
11906
11907 /*-----------------------------------------------------------------------
11908 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011909 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011910 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011911 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011912 sizeof(exitBmpsReq),
11913 &pSendBuffer, &usDataOffset, &usSendSize))||
11914 ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) )))
11915 {
11916 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11917 "Unable to get send buffer in Exit BMPS req %x %x %x",
11918 pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb);
11919 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011920 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011921 }
11922 exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull;
11923
Jeff Johnsone7245742012-09-05 17:12:55 -070011924 exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx;
11925
Jeff Johnson295189b2012-06-20 16:38:30 -070011926 wpalMemoryCopy( pSendBuffer+usDataOffset,
11927 &exitBmpsReq,
11928 sizeof(exitBmpsReq));
11929
11930 pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011931 pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011932
11933 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011934 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011935 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011936 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11937 wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011938}/*WDI_ProcessExitBmpsReq*/
11939
11940/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011941 @brief Process Enter UAPSD Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011942 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011943
11944 @param pWDICtx: pointer to the WLAN DAL context
11945 pEventData: pointer to the event information structure
11946
Jeff Johnson295189b2012-06-20 16:38:30 -070011947 @see
11948 @return Result of the function call
11949*/
11950WDI_Status
11951WDI_ProcessEnterUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011952(
Jeff Johnson295189b2012-06-20 16:38:30 -070011953 WDI_ControlBlockType* pWDICtx,
11954 WDI_EventInfoType* pEventData
11955)
11956{
11957 WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL;
11958 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011959 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011960 wpt_uint16 usDataOffset = 0;
11961 wpt_uint16 usSendSize = 0;
11962 tUapsdReqParams enterUapsdReq;
11963 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11964
11965 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011966 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011967 -------------------------------------------------------------------------*/
11968 if (( NULL == pEventData ) ||
11969 ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) ||
11970 ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc)))
11971 {
11972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11973 "%s: Invalid parameters", __FUNCTION__);
11974 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011975 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011976 }
11977
11978 /*-----------------------------------------------------------------------
11979 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011980 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011981 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011982 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011983 sizeof(enterUapsdReq),
11984 &pSendBuffer, &usDataOffset, &usSendSize))||
11985 ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) )))
11986 {
11987 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11988 "Unable to get send buffer in Enter UAPSD req %x %x %x",
11989 pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb);
11990 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011991 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011992 }
11993
11994 enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled;
11995 enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled;
11996 enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled;
11997 enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled;
11998 enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled;
11999 enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled;
12000 enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled;
12001 enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070012002 enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070012003
Jeff Johnsone7245742012-09-05 17:12:55 -070012004 wpalMemoryCopy( pSendBuffer+usDataOffset,
12005 &enterUapsdReq,
12006 sizeof(enterUapsdReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012007
12008 pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012009 pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012010
12011 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012012 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012013 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012014 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12015 wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012016}/*WDI_ProcessEnterUapsdReq*/
12017
12018/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012019 @brief Process Exit UAPSD Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012020 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012021
12022 @param pWDICtx: pointer to the WLAN DAL context
12023 pEventData: pointer to the event information structure
12024
Jeff Johnson295189b2012-06-20 16:38:30 -070012025 @see
12026 @return Result of the function call
12027*/
12028WDI_Status
12029WDI_ProcessExitUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012030(
Jeff Johnson295189b2012-06-20 16:38:30 -070012031 WDI_ControlBlockType* pWDICtx,
12032 WDI_EventInfoType* pEventData
12033)
12034{
12035 WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012036 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012037 wpt_uint16 usDataOffset = 0;
12038 wpt_uint16 usSendSize = 0;
12039 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12040
12041 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012042 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012043 -------------------------------------------------------------------------*/
12044 if (( NULL == pEventData ) ||
12045 ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc)))
12046 {
12047 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12048 "%s: Invalid parameters", __FUNCTION__);
12049 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012050 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012051 }
12052
12053 /*-----------------------------------------------------------------------
12054 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012055 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012056 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012057 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012058 0,
12059 &pSendBuffer, &usDataOffset, &usSendSize))||
12060 ( usSendSize < (usDataOffset )))
12061 {
12062 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12063 "Unable to get send buffer in Exit UAPSD req %x %x",
12064 pEventData, wdiExitUapsdRspCb);
12065 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012066 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012067 }
12068
12069 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012070 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012071 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012072 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12073 wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012074}/*WDI_ProcessExitUapsdReq*/
12075
12076/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012077 @brief Process Set UAPSD params Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012078 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012079
12080 @param pWDICtx: pointer to the WLAN DAL context
12081 pEventData: pointer to the event information structure
12082
Jeff Johnson295189b2012-06-20 16:38:30 -070012083 @see
12084 @return Result of the function call
12085*/
12086WDI_Status
12087WDI_ProcessSetUapsdAcParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012088(
Jeff Johnson295189b2012-06-20 16:38:30 -070012089 WDI_ControlBlockType* pWDICtx,
12090 WDI_EventInfoType* pEventData
12091)
12092{
12093 WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL;
12094 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012095 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012096 wpt_uint16 usDataOffset = 0;
12097 wpt_uint16 usSendSize = 0;
12098 tUapsdInfo uapsdAcParamsReq;
12099 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12100
12101 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012102 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012103 -------------------------------------------------------------------------*/
12104 if (( NULL == pEventData ) ||
12105 ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) ||
12106 ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc)))
12107 {
12108 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12109 "%s: Invalid parameters", __FUNCTION__);
12110 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012111 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012112 }
12113
12114 /*-----------------------------------------------------------------------
12115 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012116 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012117 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012118 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012119 sizeof(uapsdAcParamsReq),
12120 &pSendBuffer, &usDataOffset, &usSendSize))||
12121 ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) )))
12122 {
12123 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12124 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12125 pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb);
12126 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012127 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012128 }
12129
12130 uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc;
12131 uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx;
12132 uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp;
12133 uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval;
12134 uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval;
12135 uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval;
12136
Jeff Johnsone7245742012-09-05 17:12:55 -070012137 wpalMemoryCopy( pSendBuffer+usDataOffset,
12138 &uapsdAcParamsReq,
12139 sizeof(uapsdAcParamsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012140
12141 pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012142 pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012143
12144 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012145 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012146 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012147 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12148 wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012149}/*WDI_ProcessSetUapsdAcParamsReq*/
12150
12151/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012152 @brief Process update UAPSD params Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012153 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012154
12155 @param pWDICtx: pointer to the WLAN DAL context
12156 pEventData: pointer to the event information structure
12157
Jeff Johnson295189b2012-06-20 16:38:30 -070012158 @see
12159 @return Result of the function call
12160*/
12161WDI_Status
12162WDI_ProcessUpdateUapsdParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012163(
Jeff Johnson295189b2012-06-20 16:38:30 -070012164 WDI_ControlBlockType* pWDICtx,
12165 WDI_EventInfoType* pEventData
12166)
12167{
12168 WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL;
12169 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012170 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012171 wpt_uint16 usDataOffset = 0;
12172 wpt_uint16 usSendSize = 0;
12173 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12174
12175 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012176 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012177 -------------------------------------------------------------------------*/
12178 if (( NULL == pEventData ) ||
12179 ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) ||
12180 ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc)))
12181 {
12182 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12183 "%s: Invalid parameters", __FUNCTION__);
12184 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012185 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012186 }
12187
12188 /*-----------------------------------------------------------------------
12189 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012190 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012191 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012192 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012193 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo),
12194 &pSendBuffer, &usDataOffset, &usSendSize))||
12195 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) )))
12196 {
12197 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12198 "Unable to get send buffer in Update UAPSD params req %x %x %x",
12199 pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb);
12200 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012201 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012202 }
12203
Jeff Johnsone7245742012-09-05 17:12:55 -070012204 wpalMemoryCopy( pSendBuffer+usDataOffset,
12205 &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo,
12206 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012207
12208 pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012209 pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012210
12211 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012212 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012213 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012214 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12215 wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012216}/*WDI_ProcessUpdateUapsdParamsReq*/
12217
12218/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012219 @brief Process Configure RXP filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012220 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012221
12222 @param pWDICtx: pointer to the WLAN DAL context
12223 pEventData: pointer to the event information structure
12224
Jeff Johnson295189b2012-06-20 16:38:30 -070012225 @see
12226 @return Result of the function call
12227*/
12228WDI_Status
12229WDI_ProcessConfigureRxpFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012230(
Jeff Johnson295189b2012-06-20 16:38:30 -070012231 WDI_ControlBlockType* pWDICtx,
12232 WDI_EventInfoType* pEventData
12233)
12234{
12235 WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL;
12236 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012237 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012238 wpt_uint16 usDataOffset = 0;
12239 wpt_uint16 usSendSize = 0;
12240 tHalConfigureRxpFilterReqParams halRxpFilterParams;
12241
12242 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12243
12244 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012245 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012246 -------------------------------------------------------------------------*/
12247 if (( NULL == pEventData ) ||
12248 ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) ||
12249 ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc)))
12250 {
12251 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12252 "%s: Invalid parameters", __FUNCTION__);
12253 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012254 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012255 }
12256
12257 /*-----------------------------------------------------------------------
12258 Get message buffer
12259 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012260 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012261 sizeof(halRxpFilterParams),
12262 &pSendBuffer, &usDataOffset, &usSendSize))||
12263 ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) )))
12264 {
12265 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12266 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12267 pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb);
12268 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012269 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012270 }
12271
Jeff Johnsone7245742012-09-05 17:12:55 -070012272 halRxpFilterParams.setMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070012273 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070012274 halRxpFilterParams.setMcstBcstFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070012275 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter;
12276
Jeff Johnsone7245742012-09-05 17:12:55 -070012277 wpalMemoryCopy( pSendBuffer+usDataOffset,
12278 &halRxpFilterParams,
12279 sizeof(halRxpFilterParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070012280
12281 pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012282 pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012283
12284 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012285 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012286 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012287 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12288 wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012289}/*WDI_ProcessConfigureRxpFilterReq*/
12290
12291/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012292 @brief Process set beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012293 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012294
12295 @param pWDICtx: pointer to the WLAN DAL context
12296 pEventData: pointer to the event information structure
12297
Jeff Johnson295189b2012-06-20 16:38:30 -070012298 @see
12299 @return Result of the function call
12300*/
12301WDI_Status
12302WDI_ProcessSetBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012303(
Jeff Johnson295189b2012-06-20 16:38:30 -070012304 WDI_ControlBlockType* pWDICtx,
12305 WDI_EventInfoType* pEventData
12306)
12307{
12308 WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12309 WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012310 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012311 wpt_uint16 usDataOffset = 0;
12312 wpt_uint16 usSendSize = 0;
12313 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12314
12315 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012316 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012317 -------------------------------------------------------------------------*/
12318 if (( NULL == pEventData ) ||
12319 ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) ||
12320 ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc)))
12321 {
12322 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12323 "%s: Invalid parameters", __FUNCTION__);
12324 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012325 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012326 }
12327
12328 /*-----------------------------------------------------------------------
12329 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012330 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012331 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012332 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012333 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe),
12334 &pSendBuffer, &usDataOffset, &usSendSize))||
12335 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12336 {
12337 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12338 "Unable to get send buffer in Set beacon filter req %x %x %x",
12339 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12340 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012341 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012342 }
12343
Jeff Johnsone7245742012-09-05 17:12:55 -070012344 wpalMemoryCopy( pSendBuffer+usDataOffset,
12345 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12346 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12347 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12348 &pwdiBeaconFilterParams->aFilters[0],
12349 pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe));
Jeff Johnson295189b2012-06-20 16:38:30 -070012350
12351 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012352 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012353
12354 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012355 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012356 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012357 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12358 wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012359}/*WDI_ProcessSetBeaconFilterReq*/
12360
12361/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012362 @brief Process remove beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012363 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012364
12365 @param pWDICtx: pointer to the WLAN DAL context
12366 pEventData: pointer to the event information structure
12367
Jeff Johnson295189b2012-06-20 16:38:30 -070012368 @see
12369 @return Result of the function call
12370*/
12371WDI_Status
12372WDI_ProcessRemBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012373(
Jeff Johnson295189b2012-06-20 16:38:30 -070012374 WDI_ControlBlockType* pWDICtx,
12375 WDI_EventInfoType* pEventData
12376)
12377{
12378 WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12379 WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012380 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012381 wpt_uint16 usDataOffset = 0;
12382 wpt_uint16 usSendSize = 0;
12383 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12384
12385 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012386 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012387 -------------------------------------------------------------------------*/
12388 if (( NULL == pEventData ) ||
12389 ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) ||
12390 ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc)))
12391 {
12392 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12393 "%s: Invalid parameters", __FUNCTION__);
12394 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012395 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012396 }
12397
12398 /*-----------------------------------------------------------------------
12399 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012400 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012401 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012402 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012403 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12404 &pSendBuffer, &usDataOffset, &usSendSize))||
12405 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12406 {
12407 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12408 "Unable to get send buffer in remove beacon filter req %x %x %x",
12409 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12410 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012411 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012412 }
12413
Jeff Johnsone7245742012-09-05 17:12:55 -070012414 wpalMemoryCopy( pSendBuffer+usDataOffset,
12415 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12416 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012417
12418 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012419 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012420
12421 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012422 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012423 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012424 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12425 wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012426}
12427
12428/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012429 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012430 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012431
12432 @param pWDICtx: pointer to the WLAN DAL context
12433 pEventData: pointer to the event information structure
12434
Jeff Johnson295189b2012-06-20 16:38:30 -070012435 @see
12436 @return Result of the function call
12437*/
12438WDI_Status
12439WDI_ProcessSetRSSIThresholdsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012440(
Jeff Johnson295189b2012-06-20 16:38:30 -070012441 WDI_ControlBlockType* pWDICtx,
12442 WDI_EventInfoType* pEventData
12443)
12444{
12445 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL;
12446 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012447 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012448 wpt_uint16 usDataOffset = 0;
12449 wpt_uint16 usSendSize = 0;
12450 tHalRSSIThresholds rssiThresholdsReq;
12451 WDI_Status ret_status = 0;
12452 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12453
12454 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012455 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012456 -------------------------------------------------------------------------*/
12457 if (( NULL == pEventData ) ||
12458 ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) ||
12459 ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc)))
12460 {
12461 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12462 "%s: Invalid parameters", __FUNCTION__);
12463 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012464 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012465 }
12466
12467 /*-----------------------------------------------------------------------
12468 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012469 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012470 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012471 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012472 sizeof(rssiThresholdsReq),
12473 &pSendBuffer, &usDataOffset, &usSendSize))||
12474 ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) )))
12475 {
12476 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12477 "Unable to get send buffer in remove beacon filter req %x %x %x",
12478 pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb);
12479 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012480 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012481 }
12482
Jeff Johnsone7245742012-09-05 17:12:55 -070012483 rssiThresholdsReq.bReserved10 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012484 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10;
Jeff Johnsone7245742012-09-05 17:12:55 -070012485 rssiThresholdsReq.bRssiThres1NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012486 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012487 rssiThresholdsReq.bRssiThres1PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012488 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012489 rssiThresholdsReq.bRssiThres2NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012490 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012491 rssiThresholdsReq.bRssiThres2PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012492 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012493 rssiThresholdsReq.bRssiThres3NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012494 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012495 rssiThresholdsReq.bRssiThres3PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012496 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012497 rssiThresholdsReq.ucRssiThreshold1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012498 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1;
Jeff Johnsone7245742012-09-05 17:12:55 -070012499 rssiThresholdsReq.ucRssiThreshold2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012500 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2;
Jeff Johnsone7245742012-09-05 17:12:55 -070012501 rssiThresholdsReq.ucRssiThreshold3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012502 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3;
12503
Jeff Johnsone7245742012-09-05 17:12:55 -070012504 wpalMemoryCopy( pSendBuffer+usDataOffset,
12505 &rssiThresholdsReq,
12506 sizeof(rssiThresholdsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012507
12508 pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012509 pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012510
12511 /*-------------------------------------------------------------------------
12512 Send Set threshold req to HAL
12513 -------------------------------------------------------------------------*/
12514 if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12515 wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS)
12516 {
12517 // When we are in idle state WDI_STARTED_ST and we receive indication for threshold
12518 // req. Then as a result of processing the threshold cross ind, we trigger
12519 // a Set threshold req, then we need to indicate to WDI that it needs to
12520 // go to busy state as a result of the indication as we sent a req in the
12521 // same WDI context.
12522 // Hence expected state transition is to busy.
12523 pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST;
12524 }
12525
12526 return ret_status;
12527}
12528
12529/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012530 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012531 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012532
12533 @param pWDICtx: pointer to the WLAN DAL context
12534 pEventData: pointer to the event information structure
12535
Jeff Johnson295189b2012-06-20 16:38:30 -070012536 @see
12537 @return Result of the function call
12538*/
12539WDI_Status
12540WDI_ProcessHostOffloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012541(
Jeff Johnson295189b2012-06-20 16:38:30 -070012542 WDI_ControlBlockType* pWDICtx,
12543 WDI_EventInfoType* pEventData
12544)
12545{
12546 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL;
12547 WDI_HostOffloadCb wdiHostOffloadCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012548 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012549 wpt_uint16 usDataOffset = 0;
12550 wpt_uint16 usSendSize = 0;
12551 tHalHostOffloadReq hostOffloadParams;
12552 tHalNSOffloadParams nsOffloadParams;
12553
12554 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12555
12556 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012557 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012558 -------------------------------------------------------------------------*/
12559 if (( NULL == pEventData ) ||
12560 ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) ||
12561 ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc)))
12562 {
12563 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12564 "%s: Invalid parameters", __FUNCTION__);
12565 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012566 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012567 }
12568
12569 /*-----------------------------------------------------------------------
12570 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012571 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012572 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012573 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012574 sizeof(hostOffloadParams)+sizeof(nsOffloadParams),
12575 &pSendBuffer, &usDataOffset, &usSendSize))||
12576 ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) )))
12577 {
12578 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12579 "Unable to get send buffer in host offload req %x %x %x",
12580 pEventData, pwdiHostOffloadParams, wdiHostOffloadCb);
12581 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012582 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012583 }
12584
12585 hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType;
12586 hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012587
Jeff Johnson295189b2012-06-20 16:38:30 -070012588 if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType )
12589 {
12590 // ARP Offload
12591 wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr,
12592 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr,
12593 4);
12594 }
12595 else
12596 {
12597 // NS Offload
12598 wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr,
12599 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr,
12600 16);
12601
12602#ifdef WLAN_NS_OFFLOAD
12603 // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams
12604 wpalMemoryCopy(nsOffloadParams.srcIPv6Addr,
12605 pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr,
12606 16);
12607 wpalMemoryCopy(nsOffloadParams.selfIPv6Addr,
12608 pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr,
12609 16);
12610 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1,
12611 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1,
12612 16);
12613 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2,
12614 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2,
12615 16);
12616 wpalMemoryCopy(nsOffloadParams.selfMacAddr,
12617 pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr,
12618 6);
12619 nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid;
12620 nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid;
12621 nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid;
Jeff Johnsone7245742012-09-05 17:12:55 -070012622
12623 nsOffloadParams.bssIdx = pwdiHostOffloadParams->wdiNsOffloadParams.bssIdx;
12624
Jeff Johnson295189b2012-06-20 16:38:30 -070012625#endif // WLAN_NS_OFFLOAD
12626 }
12627
12628 // copy hostOffloadParams into pSendBuffer
12629 wpalMemoryCopy( pSendBuffer+usDataOffset,
12630 &hostOffloadParams,
12631 sizeof(hostOffloadParams));
12632
12633#ifdef WLAN_NS_OFFLOAD
12634 if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType )
12635 {
12636 // copy nsOffloadParams into pSendBuffer
12637 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
12638 &nsOffloadParams,
12639 sizeof(nsOffloadParams));
12640 }
12641#endif // WLAN_NS_OFFLOAD
12642
12643 pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012644 pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012645
12646 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012647 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012648 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012649 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12650 wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012651}/*WDI_ProcessHostOffloadReq*/
12652
12653/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012654 @brief Process Keep Alive Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012655 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012656
12657 @param pWDICtx: pointer to the WLAN DAL context
12658 pEventData: pointer to the event information structure
12659
Jeff Johnson295189b2012-06-20 16:38:30 -070012660 @see
12661 @return Result of the function call
12662*/
12663WDI_Status
12664WDI_ProcessKeepAliveReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012665(
Jeff Johnson295189b2012-06-20 16:38:30 -070012666 WDI_ControlBlockType* pWDICtx,
12667 WDI_EventInfoType* pEventData
12668)
12669{
12670 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL;
12671 WDI_KeepAliveCb wdiKeepAliveCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012672 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012673 wpt_uint16 usDataOffset = 0;
12674 wpt_uint16 usSendSize = 0;
12675 tHalKeepAliveReq keepAliveReq;
12676 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12677
12678 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012679 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012680 -------------------------------------------------------------------------*/
12681 if (( NULL == pEventData ) ||
12682 ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) ||
12683 ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc)))
12684 {
12685 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12686 "Invalid parameters in Keep Alive req");
12687 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012688 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012689 }
12690
12691 /*-----------------------------------------------------------------------
12692 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012693 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012694 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012695 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012696 sizeof(keepAliveReq),
12697 &pSendBuffer, &usDataOffset, &usSendSize))||
12698 ( usSendSize < (usDataOffset + sizeof(keepAliveReq) )))
12699 {
12700 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12701 "Unable to get send buffer in keep alive req %x %x %x",
12702 pEventData, pwdiKeepAliveParams, wdiKeepAliveCb);
12703 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012704 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012705 }
12706
12707 keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType;
12708 keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod;
12709
Jeff Johnsone7245742012-09-05 17:12:55 -070012710 keepAliveReq.bssIdx = pwdiKeepAliveParams->wdiKeepAliveInfo.bssIdx;
12711
Jeff Johnson295189b2012-06-20 16:38:30 -070012712 if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2)
12713 {
12714 wpalMemoryCopy(keepAliveReq.hostIpv4Addr,
12715 pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr,
12716 HAL_IPV4_ADDR_LEN);
12717 wpalMemoryCopy(keepAliveReq.destIpv4Addr,
12718 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr,
Jeff Johnsone7245742012-09-05 17:12:55 -070012719 HAL_IPV4_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070012720 wpalMemoryCopy(keepAliveReq.destMacAddr,
12721 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr,
12722 HAL_MAC_ADDR_LEN);
12723 }
Jeff Johnsone7245742012-09-05 17:12:55 -070012724
12725 wpalMemoryCopy( pSendBuffer+usDataOffset,
12726 &keepAliveReq,
12727 sizeof(keepAliveReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012728
12729 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12730 "Process keep alive req %d",sizeof(keepAliveReq));
12731
12732 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12733 "Process keep alive req time period %d",keepAliveReq.timePeriod);
12734
12735 pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012736 pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012737
12738 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12739 "Sending keep alive req to HAL");
12740
12741 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012742 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012743 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012744 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12745 wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012746}/*WDI_ProcessKeepAliveReq*/
12747
12748
12749/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012750 @brief Process Wowl add bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012751 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012752
12753 @param pWDICtx: pointer to the WLAN DAL context
12754 pEventData: pointer to the event information structure
12755
Jeff Johnson295189b2012-06-20 16:38:30 -070012756 @see
12757 @return Result of the function call
12758*/
12759WDI_Status
12760WDI_ProcessWowlAddBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012761(
Jeff Johnson295189b2012-06-20 16:38:30 -070012762 WDI_ControlBlockType* pWDICtx,
12763 WDI_EventInfoType* pEventData
12764)
12765{
12766 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL;
12767 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012768 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012769 wpt_uint16 usDataOffset = 0;
12770 wpt_uint16 usSendSize = 0;
12771 tHalWowlAddBcastPtrn wowlAddBcPtrnReq;
12772 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12773
12774 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012775 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012776 -------------------------------------------------------------------------*/
12777 if (( NULL == pEventData ) ||
12778 ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) ||
12779 ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc)))
12780 {
12781 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12782 "%s: Invalid parameters", __FUNCTION__);
12783 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012784 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012785 }
12786
12787 /*-----------------------------------------------------------------------
12788 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012789 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012790 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012791 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012792 sizeof(wowlAddBcPtrnReq),
12793 &pSendBuffer, &usDataOffset, &usSendSize))||
12794 ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) )))
12795 {
12796 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12797 "Unable to get send buffer in Wowl add bc ptrn req %x %x %x",
12798 pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb);
12799 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012800 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012801 }
12802
Jeff Johnsone7245742012-09-05 17:12:55 -070012803 wowlAddBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012804 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId;
Jeff Johnsone7245742012-09-05 17:12:55 -070012805 wowlAddBcPtrnReq.ucPatternByteOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070012806 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070012807 wowlAddBcPtrnReq.ucPatternMaskSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012808 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize;
Jeff Johnsone7245742012-09-05 17:12:55 -070012809 wowlAddBcPtrnReq.ucPatternSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012810 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize;
12811
12812 if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE)
12813 {
12814 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12815 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12816 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize);
12817 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12818 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12819 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize);
12820 }
12821 else
12822 {
12823 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12824 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12825 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12826 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12827 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12828 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12829
12830 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12831 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12832 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12833 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12834 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12835 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12836 }
12837
12838 wpalMemoryCopy( pSendBuffer+usDataOffset,
12839 &wowlAddBcPtrnReq,
12840 sizeof(wowlAddBcPtrnReq));
12841
12842 pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012843 pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012844
12845 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012846 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012847 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012848 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12849 wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012850}/*WDI_ProcessWowlAddBcPtrnReq*/
12851
12852/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012853 @brief Process Wowl delete bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012854 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012855
12856 @param pWDICtx: pointer to the WLAN DAL context
12857 pEventData: pointer to the event information structure
12858
Jeff Johnson295189b2012-06-20 16:38:30 -070012859 @see
12860 @return Result of the function call
12861*/
12862WDI_Status
12863WDI_ProcessWowlDelBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012864(
Jeff Johnson295189b2012-06-20 16:38:30 -070012865 WDI_ControlBlockType* pWDICtx,
12866 WDI_EventInfoType* pEventData
12867)
12868{
12869 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL;
12870 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012871 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012872 wpt_uint16 usDataOffset = 0;
12873 wpt_uint16 usSendSize = 0;
12874 tHalWowlDelBcastPtrn wowlDelBcPtrnReq;
12875 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12876
12877 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012878 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012879 -------------------------------------------------------------------------*/
12880 if (( NULL == pEventData ) ||
12881 ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) ||
12882 ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc)))
12883 {
12884 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12885 "%s: Invalid parameters", __FUNCTION__);
12886 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012887 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012888 }
12889
12890 /*-----------------------------------------------------------------------
12891 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012892 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012893 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012894 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012895 sizeof(wowlDelBcPtrnReq),
12896 &pSendBuffer, &usDataOffset, &usSendSize))||
12897 ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) )))
12898 {
12899 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12900 "Unable to get send buffer in Wowl del bc ptrn req %x %x %x",
12901 pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb);
12902 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012903 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012904 }
12905
Jeff Johnsone7245742012-09-05 17:12:55 -070012906 wowlDelBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012907 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId;
Jeff Johnsone7245742012-09-05 17:12:55 -070012908 wpalMemoryCopy( pSendBuffer+usDataOffset,
12909 &wowlDelBcPtrnReq,
12910 sizeof(wowlDelBcPtrnReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012911
12912 pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012913 pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012914
12915 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012916 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012917 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012918 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12919 wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012920}/*WDI_ProcessWowlDelBcPtrnReq*/
12921
12922/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012923 @brief Process Wowl enter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012924 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012925
12926 @param pWDICtx: pointer to the WLAN DAL context
12927 pEventData: pointer to the event information structure
12928
Jeff Johnson295189b2012-06-20 16:38:30 -070012929 @see
12930 @return Result of the function call
12931*/
12932WDI_Status
12933WDI_ProcessWowlEnterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012934(
Jeff Johnson295189b2012-06-20 16:38:30 -070012935 WDI_ControlBlockType* pWDICtx,
12936 WDI_EventInfoType* pEventData
12937)
12938{
12939 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL;
12940 WDI_WowlEnterReqCb wdiWowlEnterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012941 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012942 wpt_uint16 usDataOffset = 0;
12943 wpt_uint16 usSendSize = 0;
12944 tHalWowlEnterParams wowlEnterReq;
12945 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12946
12947 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012948 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012949 -------------------------------------------------------------------------*/
12950 if (( NULL == pEventData ) ||
12951 ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) ||
12952 ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc)))
12953 {
12954 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12955 "%s: Invalid parameters", __FUNCTION__);
12956 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012957 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012958 }
12959
12960 /*-----------------------------------------------------------------------
12961 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012962 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012963 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012964 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012965 sizeof(wowlEnterReq),
12966 &pSendBuffer, &usDataOffset, &usSendSize))||
12967 ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) )))
12968 {
12969 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12970 "Unable to get send buffer in Wowl enter req %x %x %x",
12971 pEventData, pwdiWowlEnterParams, wdiWowlEnterCb);
12972 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012973 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012974 }
12975
Jeff Johnsone7245742012-09-05 17:12:55 -070012976 wowlEnterReq.ucMagicPktEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070012977 pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012978 wowlEnterReq.ucPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070012979 pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012980 wowlEnterReq.ucUcastPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070012981 pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012982 wowlEnterReq.ucWowChnlSwitchRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070012983 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070012984 wowlEnterReq.ucWowDeauthRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070012985 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070012986 wowlEnterReq.ucWowDisassocRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070012987 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070012988 wowlEnterReq.ucWowMaxMissedBeacons =
Jeff Johnson295189b2012-06-20 16:38:30 -070012989 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons;
Jeff Johnsone7245742012-09-05 17:12:55 -070012990 wowlEnterReq.ucWowMaxSleepUsec =
Jeff Johnson295189b2012-06-20 16:38:30 -070012991 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec;
12992
12993#ifdef WLAN_WAKEUP_EVENTS
12994 wowlEnterReq.ucWoWEAPIDRequestEnable =
12995 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable;
12996
12997 wowlEnterReq.ucWoWEAPOL4WayEnable =
12998 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable;
12999
13000 wowlEnterReq.ucWowNetScanOffloadMatch =
13001 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch;
13002
13003 wowlEnterReq.ucWowGTKRekeyError =
13004 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError;
13005
13006 wowlEnterReq.ucWoWBSSConnLoss =
13007 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss;
13008#endif // WLAN_WAKEUP_EVENTS
13009
13010 wpalMemoryCopy(wowlEnterReq.magicPtrn,
13011 pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn,
13012 sizeof(tSirMacAddr));
13013
Jeff Johnsone7245742012-09-05 17:12:55 -070013014 wpalMemoryCopy( pSendBuffer+usDataOffset,
13015 &wowlEnterReq,
13016 sizeof(wowlEnterReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013017
13018 pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013019 pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013020
13021 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013022 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013023 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013024 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13025 wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013026}/*WDI_ProcessWowlEnterReq*/
13027
13028/**
13029 @brief Process Wowl exit Request function (called when Main FSM
13030 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013031
13032 @param pWDICtx: pointer to the WLAN DAL context
13033 pEventData: pointer to the event information structure
13034
Jeff Johnson295189b2012-06-20 16:38:30 -070013035 @see
13036 @return Result of the function call
13037*/
13038WDI_Status
13039WDI_ProcessWowlExitReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013040(
Jeff Johnson295189b2012-06-20 16:38:30 -070013041 WDI_ControlBlockType* pWDICtx,
13042 WDI_EventInfoType* pEventData
13043)
13044{
13045 WDI_WowlExitReqCb wdiWowlExitCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013046 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013047 wpt_uint16 usDataOffset = 0;
13048 wpt_uint16 usSendSize = 0;
13049 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13050
13051 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013052 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013053 -------------------------------------------------------------------------*/
13054 if (( NULL == pEventData ) ||
13055 ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc)))
13056 {
13057 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13058 "%s: Invalid parameters", __FUNCTION__);
13059 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013060 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013061 }
13062
13063 /*-----------------------------------------------------------------------
13064 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013065 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013066 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013067 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013068 0,
13069 &pSendBuffer, &usDataOffset, &usSendSize))||
13070 ( usSendSize < (usDataOffset )))
13071 {
13072 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13073 "Unable to get send buffer in Wowl Exit req %x %x",
13074 pEventData, wdiWowlExitCb);
13075 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013076 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013077 }
13078
13079 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013080 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013081 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013082 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13083 wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013084}/*WDI_ProcessWowlExitReq*/
13085
13086/**
13087 @brief Process Configure Apps Cpu Wakeup State Request function
13088 (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013089
13090 @param pWDICtx: pointer to the WLAN DAL context
13091 pEventData: pointer to the event information structure
13092
Jeff Johnson295189b2012-06-20 16:38:30 -070013093 @see
13094 @return Result of the function call
13095*/
13096WDI_Status
13097WDI_ProcessConfigureAppsCpuWakeupStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013098(
Jeff Johnson295189b2012-06-20 16:38:30 -070013099 WDI_ControlBlockType* pWDICtx,
13100 WDI_EventInfoType* pEventData
13101)
13102{
13103 WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL;
13104 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013105 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013106 wpt_uint16 usDataOffset = 0;
13107 wpt_uint16 usSendSize = 0;
13108 tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams;
13109 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13110
13111 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013112 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013113 -------------------------------------------------------------------------*/
13114 if (( NULL == pEventData ) ||
13115 ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) ||
13116 ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc)))
13117 {
13118 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13119 "%s: Invalid parameters", __FUNCTION__);
13120 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013121 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013122 }
13123
13124 /*-----------------------------------------------------------------------
13125 Get message buffer
13126 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013127 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013128 sizeof(halCfgAppsCpuWakeupStateReqParams),
13129 &pSendBuffer, &usDataOffset, &usSendSize))||
13130 ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) )))
13131 {
13132 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13133 "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x",
13134 pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb);
13135 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013136 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013137 }
13138
Jeff Johnsone7245742012-09-05 17:12:55 -070013139 halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake =
Jeff Johnson295189b2012-06-20 16:38:30 -070013140 pwdiAppsCpuWakeupStateParams->bIsAppsAwake;
13141
Jeff Johnsone7245742012-09-05 17:12:55 -070013142 wpalMemoryCopy( pSendBuffer+usDataOffset,
13143 &halCfgAppsCpuWakeupStateReqParams,
13144 sizeof(halCfgAppsCpuWakeupStateReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070013145
13146 pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013147 pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013148
13149 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013150 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013151 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013152 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13153 wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData,
13154 WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013155}/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/
13156
13157#ifdef WLAN_FEATURE_VOWIFI_11R
13158/**
13159 @brief Process Aggregated Add TSpec Request function (called when Main FSM
13160 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013161
13162 @param pWDICtx: pointer to the WLAN DAL context
13163 pEventData: pointer to the event information structure
13164
Jeff Johnson295189b2012-06-20 16:38:30 -070013165 @see
13166 @return Result of the function call
13167*/
13168WDI_Status
13169WDI_ProcessAggrAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013170(
Jeff Johnson295189b2012-06-20 16:38:30 -070013171 WDI_ControlBlockType* pWDICtx,
13172 WDI_EventInfoType* pEventData
13173)
13174{
13175 WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams;
13176 WDI_AggrAddTsRspCb wdiAggrAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013177 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070013178 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013179 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013180 wpt_uint16 usDataOffset = 0;
13181 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070013182 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013183 wpt_macAddr macBSSID;
13184 tAggrAddTsReq halAggrAddTsReq;
13185 int i;
13186 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13187
13188 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013189 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013190 -------------------------------------------------------------------------*/
13191 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
13192 ( NULL == pEventData->pCBfnc ))
13193 {
13194 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13195 "%s: Invalid parameters", __FUNCTION__);
13196 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013197 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013198 }
13199 wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 );
13200 pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData;
13201 wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc;
13202 /*-------------------------------------------------------------------------
13203 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070013204 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070013205 -------------------------------------------------------------------------*/
13206 wpalMutexAcquire(&pWDICtx->wptMutex);
13207
13208 /*------------------------------------------------------------------------
13209 Find the BSS for which the request is made and identify WDI session
13210 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013211 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
13212 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070013213 &macBSSID))
13214 {
13215 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13216 "This station does not exist in the WDI Station Table %d");
13217 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013218 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013219 }
13220
Jeff Johnsone7245742012-09-05 17:12:55 -070013221 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
13222 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070013223 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013224 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13225 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
13226 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013227
13228 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013229 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070013230 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013231
Jeff Johnson295189b2012-06-20 16:38:30 -070013232 /*------------------------------------------------------------------------
13233 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070013234 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070013235 ------------------------------------------------------------------------*/
13236 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
13237 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013238 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13239 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
13240 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013241
Jeff Johnsone7245742012-09-05 17:12:55 -070013242 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070013243 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013244 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070013245 }
13246
13247 wpalMutexRelease(&pWDICtx->wptMutex);
13248 /*-----------------------------------------------------------------------
13249 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013250 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013251 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013252 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013253 sizeof(tAggrAddTsParams),
13254 &pSendBuffer, &usDataOffset, &usSendSize))||
13255 ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) )))
13256 {
13257 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13258 "Unable to get send buffer in set bss key req %x %x %x",
13259 pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb);
13260 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013261 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013262 }
13263
Jeff Johnsone7245742012-09-05 17:12:55 -070013264 halAggrAddTsReq.aggrAddTsParam.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013265 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070013266 halAggrAddTsReq.aggrAddTsParam.tspecIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013267 pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx;
13268
13269 for( i = 0; i < WLAN_HAL_MAX_AC; i++ )
13270 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013271 halAggrAddTsReq.aggrAddTsParam.tspec[i].type =
Jeff Johnson295189b2012-06-20 16:38:30 -070013272 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013273 halAggrAddTsReq.aggrAddTsParam.tspec[i].length =
Jeff Johnson295189b2012-06-20 16:38:30 -070013274 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -070013275 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013276 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13277 ackPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013278 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013279 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13280 accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013281 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -070013282 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13283 userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -070013284 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -070013285 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13286 psb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013287 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -070013288 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13289 aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -070013290 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -070013291 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13292 direction;
Jeff Johnsone7245742012-09-05 17:12:55 -070013293 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013294 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13295 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013296 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013297 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13298 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013299 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -070013300 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -070013301 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -070013302 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule;
Jeff Johnsone7245742012-09-05 17:12:55 -070013303
13304
13305 halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013306 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013307 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013308 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013309 halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013310 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013311 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013312 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013313 halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013314 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013315 halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013316 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013317 halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013318 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070013319 halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013320 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013321 halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013322 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013323 halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013324 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013325 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013326 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013327 halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -070013328 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -070013329 halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013330 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013331 halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -070013332 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -070013333 halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013334 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime;
13335 }
13336
Jeff Johnsone7245742012-09-05 17:12:55 -070013337 wpalMemoryCopy( pSendBuffer+usDataOffset,
13338 &halAggrAddTsReq,
13339 sizeof(halAggrAddTsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013340
13341 pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013342 pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013343
13344 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013345 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013346 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013347 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070013348 wdiAggrAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070013349 WDI_AGGR_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013350}/*WDI_ProcessAggrAddTSpecReq*/
13351#endif /* WLAN_FEATURE_VOWIFI_11R */
13352
13353/**
13354 @brief Process Shutdown Request function (called when Main FSM
13355 allows it)
13356
13357 @param pWDICtx: pointer to the WLAN DAL context
13358 pEventData: pointer to the event information structure
13359
13360 @see
13361 @return Result of the function call
13362*/
13363WDI_Status
13364WDI_ProcessShutdownReq
13365(
13366 WDI_ControlBlockType* pWDICtx,
13367 WDI_EventInfoType* pEventData
13368 )
13369{
13370 wpt_status wptStatus;
13371
13372
13373 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13374
13375 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013376 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013377 -------------------------------------------------------------------------*/
13378 if ( NULL == pEventData )
13379 {
13380 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13381 "%s: Invalid parameters", __FUNCTION__);
13382 WDI_ASSERT(0);
13383 return WDI_STATUS_E_FAILURE;
13384 }
13385
13386 wpalMutexAcquire(&pWDICtx->wptMutex);
13387
13388
13389 gWDIInitialized = eWLAN_PAL_FALSE;
13390 /*! TO DO: stop the data services */
13391 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13392 {
13393 /*Stop the STA Table !UT- check this logic again
13394 It is safer to do it here than on the response - because a stop is imminent*/
13395 WDI_STATableStop(pWDICtx);
13396
13397 /* Stop Transport Driver, DXE */
13398 WDTS_Stop(pWDICtx);
13399 }
13400
13401 /*Clear all pending request*/
13402 WDI_ClearPendingRequests(pWDICtx);
13403 /* Close Data transport*/
13404 /* FTM mode does not open Data Path */
13405 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13406 {
13407 WDTS_Close(pWDICtx);
13408 }
13409 /*Close the STA Table !UT- check this logic again*/
13410 WDI_STATableClose(pWDICtx);
13411 /*close the PAL */
13412 wptStatus = wpalClose(pWDICtx->pPALContext);
13413 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
13414 {
13415 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13416 "Failed to wpal Close %d", wptStatus);
13417 WDI_ASSERT(0);
13418 }
13419
13420 /*Transition back to init state*/
13421 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
13422
13423 wpalMutexRelease(&pWDICtx->wptMutex);
13424
13425 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013426 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070013427
13428
Jeff Johnsone7245742012-09-05 17:12:55 -070013429 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013430}/*WDI_ProcessShutdownReq*/
13431
13432/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013433 Main DAL Control Path Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070013434========================================================================*/
13435
13436/**
13437 @brief Process Start Response function (called when a response
13438 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013439
13440 @param pWDICtx: pointer to the WLAN DAL context
13441 pEventData: pointer to the event information structure
13442
Jeff Johnson295189b2012-06-20 16:38:30 -070013443 @see
13444 @return Result of the function call
13445*/
13446WDI_Status
13447WDI_ProcessStartRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013448(
Jeff Johnson295189b2012-06-20 16:38:30 -070013449 WDI_ControlBlockType* pWDICtx,
13450 WDI_EventInfoType* pEventData
13451)
13452{
13453 WDI_StartRspParamsType wdiRspParams;
13454 WDI_StartRspCb wdiStartRspCb = NULL;
13455
13456 tHalMacStartRspParams* startRspParams;
13457
13458#ifndef HAL_SELF_STA_PER_BSS
13459 WDI_AddStaParams wdiAddSTAParam = {0};
13460#endif
13461 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13462
Jeff Johnsone7245742012-09-05 17:12:55 -070013463 wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013464 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013465 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013466 -------------------------------------------------------------------------*/
13467 if (( NULL == pEventData ) ||
13468 ( NULL == pEventData->pEventData) ||
13469 ( NULL == wdiStartRspCb ))
13470 {
13471 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13472 "%s: Invalid parameters", __FUNCTION__);
13473 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013474 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013475 }
13476
13477 /*-------------------------------------------------------------------------
13478 Extract response and send it to UMAC
13479 -------------------------------------------------------------------------*/
13480 if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize )
13481 {
13482 // not enough data was received
13483 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13484 "Invalid response length in Start Resp Expect %x Rcvd %x",
13485 sizeof(tHalMacStartRspParams), pEventData->uEventDataSize);
13486 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013487 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013488 }
13489
13490 /*-------------------------------------------------------------------------
13491 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013492 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013493 -------------------------------------------------------------------------*/
13494 startRspParams = (tHalMacStartRspParams *) pEventData->pEventData;
13495
13496 wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids;
13497 wdiRspParams.ucMaxStations = startRspParams->ucMaxStations;
13498 wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR;
13499 wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR;
13500 wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION;
13501 wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION;
13502 wdiRspParams.wlanReportedVersion.major =
13503 startRspParams->wcnssWlanVersion.major;
13504 wdiRspParams.wlanReportedVersion.minor =
13505 startRspParams->wcnssWlanVersion.minor;
13506 wdiRspParams.wlanReportedVersion.version =
13507 startRspParams->wcnssWlanVersion.version;
13508 wdiRspParams.wlanReportedVersion.revision =
13509 startRspParams->wcnssWlanVersion.revision;
13510 wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion,
13511 startRspParams->wcnssCrmVersionString,
13512 sizeof(wdiRspParams.wcnssSoftwareVersion));
13513 wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion,
13514 startRspParams->wcnssWlanVersionString,
13515 sizeof(wdiRspParams.wcnssHardwareVersion));
13516 wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status);
13517
13518 wpalMutexAcquire(&pWDICtx->wptMutex);
13519 if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus )
13520 {
13521 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
13522
13523 /*Cache the start response for further use*/
13524 wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams ,
Jeff Johnsone7245742012-09-05 17:12:55 -070013525 &wdiRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070013526 sizeof(pWDICtx->wdiCachedStartRspParams));
13527
13528 }
13529 else
13530 {
13531 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13532 "Failed to start device with status %s(%d)",
13533 WDI_getHALStatusMsgString(startRspParams->status),
13534 startRspParams->status);
13535
13536 /*Set the expected state transition to stopped - because the start has
13537 failed*/
13538 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13539
13540 wpalMutexRelease(&pWDICtx->wptMutex);
13541
13542 /*Notify UMAC*/
13543 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
Jeff Johnsone7245742012-09-05 17:12:55 -070013544
Jeff Johnson295189b2012-06-20 16:38:30 -070013545 WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus);
13546
13547 /*Although the response is an error - it was processed by our function
13548 so as far as the caller is concerned this is a succesful reponse processing*/
13549 return WDI_STATUS_SUCCESS;
13550 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013551
Jeff Johnson295189b2012-06-20 16:38:30 -070013552 wpalMutexRelease(&pWDICtx->wptMutex);
13553
13554 if(eDRIVER_TYPE_MFG == pWDICtx->driverMode)
13555 {
13556 /* FTM mode does not need to execute below */
13557 /* Notify UMAC */
13558 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13559 return WDI_STATUS_SUCCESS;
13560 }
13561
13562 /* START the Data transport */
13563 WDTS_startTransport(pWDICtx);
13564
13565 /*Start the STA Table !- check this logic again*/
13566 WDI_STATableStart(pWDICtx);
13567
13568#ifndef HAL_SELF_STA_PER_BSS
13569 /* Store the Self STA Index */
13570 pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx;
13571
13572 pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId;
13573 wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta,
13574 WDI_MAC_ADDR_LEN);
13575
13576 /* At this point add the self-STA */
13577
13578 /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */
13579 /* !TO DO: wdiAddSTAParam.bcastDpuSignature */
13580 /*! TO DO: wdiAddSTAParam.dpuSig */
13581 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
13582 /*! TO DO: wdiAddSTAParam.ucHTCapable */
13583 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
13584
13585 //all DPU indices are the same for self STA
13586 wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId;
13587 wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId;
13588 wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;;
13589 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta,
13590 WDI_MAC_ADDR_LEN);
13591 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
13592 wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx;
13593
13594 /* Note: Since we don't get an explicit config STA request for self STA, we
13595 add the self STA upon receiving the Start response message. But the
13596 self STA entry in the table is deleted when WDI gets an explicit delete STA
13597 request */
13598 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
13599#endif
13600
13601 /*Notify UMAC*/
13602 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13603
Jeff Johnsone7245742012-09-05 17:12:55 -070013604 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013605}/*WDI_ProcessStartRsp*/
13606
13607
13608/**
13609 @brief Process Stop Response function (called when a response
13610 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013611
13612 @param pWDICtx: pointer to the WLAN DAL context
13613 pEventData: pointer to the event information structure
13614
Jeff Johnson295189b2012-06-20 16:38:30 -070013615 @see
13616 @return Result of the function call
13617*/
13618WDI_Status
13619WDI_ProcessStopRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013620(
Jeff Johnson295189b2012-06-20 16:38:30 -070013621 WDI_ControlBlockType* pWDICtx,
13622 WDI_EventInfoType* pEventData
13623)
13624{
13625 WDI_Status wdiStatus;
13626 WDI_StopRspCb wdiStopRspCb = NULL;
13627
Jeff Johnsone7245742012-09-05 17:12:55 -070013628 tHalMacStopRspMsg halMacStopRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013629 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13630
Jeff Johnsone7245742012-09-05 17:12:55 -070013631 wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013632 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013633 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013634 -------------------------------------------------------------------------*/
13635 if (( NULL == pEventData ) ||
13636 ( NULL == pEventData->pEventData) ||
13637 ( NULL == wdiStopRspCb ))
13638 {
13639 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13640 "%s: Invalid parameters", __FUNCTION__);
13641 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013642 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013643 }
13644
13645 /*-------------------------------------------------------------------------
13646 Extract response and send it to UMAC
13647 -------------------------------------------------------------------------*/
13648 if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize )
13649 {
13650 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13651 "Invalid response length in Stop Resp %x %x",
13652 pEventData->uEventDataSize);
13653 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013654 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013655 }
13656
13657 /*-------------------------------------------------------------------------
13658 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013659 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013660 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013661 wpalMemoryCopy( &halMacStopRspMsg.stopRspParams,
13662 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013663 sizeof(halMacStopRspMsg.stopRspParams));
13664
Jeff Johnsone7245742012-09-05 17:12:55 -070013665 wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013666
13667 wpalMutexAcquire(&pWDICtx->wptMutex);
13668
13669 /*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013670 Check to see if the stop went OK
Jeff Johnson295189b2012-06-20 16:38:30 -070013671 --------------------------------------------------------------------------*/
13672 if ( WDI_STATUS_SUCCESS != wdiStatus )
13673 {
13674 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13675 "Failed to stop the device with status %s (%d)",
13676 WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status),
13677 halMacStopRspMsg.stopRspParams.status);
13678
Jeff Johnsone7245742012-09-05 17:12:55 -070013679 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13680
Jeff Johnson295189b2012-06-20 16:38:30 -070013681 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013682 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013683 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013684
Jeff Johnson295189b2012-06-20 16:38:30 -070013685 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13686
13687 /*Transition now as WDI may get preempted imediately after it sends
13688 up the Stop Response and it will not get to process the state transition
13689 from Main Rsp function*/
13690 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
13691 wpalMutexRelease(&pWDICtx->wptMutex);
13692
13693 /*! TO DO: - STOP the Data transport */
13694
13695 /*Notify UMAC*/
13696 wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13697
Jeff Johnsone7245742012-09-05 17:12:55 -070013698 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013699}/*WDI_ProcessStopRsp*/
13700
13701/**
13702 @brief Process Close Rsp function (called when a response
13703 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013704
13705 @param pWDICtx: pointer to the WLAN DAL context
13706 pEventData: pointer to the event information structure
13707
Jeff Johnson295189b2012-06-20 16:38:30 -070013708 @see
13709 @return Result of the function call
13710*/
13711WDI_Status
13712WDI_ProcessCloseRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013713(
Jeff Johnson295189b2012-06-20 16:38:30 -070013714 WDI_ControlBlockType* pWDICtx,
13715 WDI_EventInfoType* pEventData
13716)
13717{
13718 /*There is no close response comming from HAL - function just kept for
13719 simmetry */
13720 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013721 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013722}/*WDI_ProcessCloseRsp*/
13723
13724
13725/*============================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013726 SCAN RESPONSE PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -070013727============================================================================*/
13728
13729/**
13730 @brief Process Init Scan Rsp function (called when a response
13731 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013732
13733 @param pWDICtx: pointer to the WLAN DAL context
13734 pEventData: pointer to the event information structure
13735
Jeff Johnson295189b2012-06-20 16:38:30 -070013736 @see
13737 @return Result of the function call
13738*/
13739WDI_Status
13740WDI_ProcessInitScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013741(
Jeff Johnson295189b2012-06-20 16:38:30 -070013742 WDI_ControlBlockType* pWDICtx,
13743 WDI_EventInfoType* pEventData
13744)
13745{
13746 WDI_Status wdiStatus;
13747 WDI_InitScanRspCb wdiInitScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013748 tHalInitScanRspMsg halInitScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013749 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13750
13751 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013752 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013753 -------------------------------------------------------------------------*/
13754 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13755 ( NULL == pEventData->pEventData))
13756 {
13757 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13758 "%s: Invalid parameters", __FUNCTION__);
13759 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013760 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013761 }
13762
13763 wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB;
13764 if( NULL == wdiInitScanRspCb)
13765 {
13766 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13767 "%s: call back function is NULL", __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 /*-------------------------------------------------------------------------
13773 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013774 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013775 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013776 wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams,
13777 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013778 sizeof(halInitScanRspMsg.initScanRspParams));
13779
Jeff Johnsone7245742012-09-05 17:12:55 -070013780 wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013781
13782 if ( pWDICtx->bInBmps )
13783 {
13784 // notify DTS that we are entering Full power
13785 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
13786 }
13787
13788 /*Notify UMAC*/
13789 wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13790
Jeff Johnsone7245742012-09-05 17:12:55 -070013791 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013792}/*WDI_ProcessInitScanRsp*/
13793
13794
13795/**
13796 @brief Process Start Scan Rsp function (called when a response
13797 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013798
13799 @param pWDICtx: pointer to the WLAN DAL context
13800 pEventData: pointer to the event information structure
13801
Jeff Johnson295189b2012-06-20 16:38:30 -070013802 @see
13803 @return Result of the function call
13804*/
13805WDI_Status
13806WDI_ProcessStartScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013807(
Jeff Johnson295189b2012-06-20 16:38:30 -070013808 WDI_ControlBlockType* pWDICtx,
13809 WDI_EventInfoType* pEventData
13810)
13811{
13812 WDI_StartScanRspParamsType wdiStartScanParams;
13813 WDI_StartScanRspCb wdiStartScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013814
13815 tHalStartScanRspMsg halStartScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013816 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13817
13818 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013819 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013820 -------------------------------------------------------------------------*/
13821 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13822 ( NULL == pEventData->pEventData))
13823 {
13824 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13825 "%s: Invalid parameters", __FUNCTION__);
13826 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013827 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013828 }
13829
13830 wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB;
13831 if( NULL == wdiStartScanRspCb)
13832 {
13833 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13834 "%s: call back function is NULL", __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 /*-------------------------------------------------------------------------
13840 Extract response and send it to UMAC
13841 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013842 wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams,
13843 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013844 sizeof(halStartScanRspMsg.startScanRspParams));
13845
13846 wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13847 halStartScanRspMsg.startScanRspParams.status);
13848#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070013849 wdiStartScanParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070013850 halStartScanRspMsg.startScanRspParams.txMgmtPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070013851 wpalMemoryCopy( wdiStartScanParams.aStartTSF,
Jeff Johnson295189b2012-06-20 16:38:30 -070013852 halStartScanRspMsg.startScanRspParams.startTSF,
13853 2);
Jeff Johnsone7245742012-09-05 17:12:55 -070013854#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070013855
13856 if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status )
13857 {
13858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13859 "Start scan failed with status %s (%d)",
13860 WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status),
13861 halStartScanRspMsg.startScanRspParams.status);
13862 /* send the status to UMAC, don't return from here*/
13863 }
13864
13865 /*Notify UMAC*/
13866 wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData);
13867
Jeff Johnsone7245742012-09-05 17:12:55 -070013868 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013869
13870}/*WDI_ProcessStartScanRsp*/
13871
13872
13873/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013874 @brief Process End Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070013875 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013876
13877 @param pWDICtx: pointer to the WLAN DAL context
13878 pEventData: pointer to the event information structure
13879
Jeff Johnson295189b2012-06-20 16:38:30 -070013880 @see
13881 @return Result of the function call
13882*/
13883WDI_Status
13884WDI_ProcessEndScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013885(
Jeff Johnson295189b2012-06-20 16:38:30 -070013886 WDI_ControlBlockType* pWDICtx,
13887 WDI_EventInfoType* pEventData
13888)
13889{
13890 WDI_Status wdiStatus;
13891 tHalEndScanRspMsg halEndScanRspMsg;
13892 WDI_EndScanRspCb wdiEndScanRspCb;
13893 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13894
13895 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013896 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013897 -------------------------------------------------------------------------*/
13898 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13899 ( NULL == pEventData->pEventData))
13900 {
13901 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13902 "%s: Invalid parameters", __FUNCTION__);
13903 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013904 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013905 }
13906
13907 wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB;
13908
13909 /*-------------------------------------------------------------------------
13910 Extract response and send it to UMAC
13911 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013912 wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams,
13913 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013914 sizeof(halEndScanRspMsg.endScanRspParams));
13915
Jeff Johnsone7245742012-09-05 17:12:55 -070013916 wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013917
13918 if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status )
13919 {
13920 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13921 "End Scan failed with status %s (%d )",
13922 WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status),
13923 halEndScanRspMsg.endScanRspParams.status);
13924 /* send the status to UMAC, don't return from here*/
13925 }
13926
13927 /*Notify UMAC*/
13928 wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13929
Jeff Johnsone7245742012-09-05 17:12:55 -070013930 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013931}/*WDI_ProcessEndScanRsp*/
13932
13933
13934/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013935 @brief Process Finish Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070013936 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013937
13938 @param pWDICtx: pointer to the WLAN DAL context
13939 pEventData: pointer to the event information structure
13940
Jeff Johnson295189b2012-06-20 16:38:30 -070013941 @see
13942 @return Result of the function call
13943*/
13944WDI_Status
13945WDI_ProcessFinishScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013946(
Jeff Johnson295189b2012-06-20 16:38:30 -070013947 WDI_ControlBlockType* pWDICtx,
13948 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -070013949)
Jeff Johnson295189b2012-06-20 16:38:30 -070013950{
13951 WDI_Status wdiStatus;
13952 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013953
13954 tHalFinishScanRspMsg halFinishScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013955 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13956
13957 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013958 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013959 -------------------------------------------------------------------------*/
13960 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13961 ( NULL == pEventData->pEventData))
13962 {
13963 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13964 "%s: Invalid parameters", __FUNCTION__);
13965 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013966 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013967 }
13968
13969 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB;
13970
13971 /*-------------------------------------------------------------------------
13972 Extract response and send it to UMAC
13973 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013974 wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status,
13975 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013976 sizeof(halFinishScanRspMsg.finishScanRspParams.status));
13977
Jeff Johnsone7245742012-09-05 17:12:55 -070013978 wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013979
13980 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
Jeff Johnsone7245742012-09-05 17:12:55 -070013981 "Finish scan response reported status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070013982 halFinishScanRspMsg.finishScanRspParams.status);
13983
13984 if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&&
13985 ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status ))
13986 {
13987 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13988 "Finish Scan failed with status %s (%d)",
13989 WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status),
13990 halFinishScanRspMsg.finishScanRspParams.status);
13991 /* send the status to UMAC, don't return from here*/
13992 }
13993
13994 /*Notify UMAC*/
13995 wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13996
Jeff Johnsone7245742012-09-05 17:12:55 -070013997 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013998}/*WDI_ProcessFinishScanRsp*/
13999
14000/**
14001 @brief Process Join Response function (called when a response
14002 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014003
14004 @param pWDICtx: pointer to the WLAN DAL context
14005 pEventData: pointer to the event information structure
14006
Jeff Johnson295189b2012-06-20 16:38:30 -070014007 @see
14008 @return Result of the function call
14009*/
14010WDI_Status
14011WDI_ProcessJoinRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014012(
Jeff Johnson295189b2012-06-20 16:38:30 -070014013 WDI_ControlBlockType* pWDICtx,
14014 WDI_EventInfoType* pEventData
14015)
14016{
14017 WDI_Status wdiStatus;
14018 WDI_JoinRspCb wdiJoinRspCb;
14019 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014020
14021 tHalJoinRspMsg halJoinRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014022 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14023
14024 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014025 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014026 -------------------------------------------------------------------------*/
14027 if (( NULL == pWDICtx ) ||
14028 ( NULL == pWDICtx->pfncRspCB ) ||
14029 ( NULL == pEventData ) ||
14030 ( NULL == pEventData->pEventData))
14031 {
14032 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14033 "%s: Invalid parameters", __FUNCTION__);
14034 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014035 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014036 }
14037
14038 wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB;
14039
14040 /*-------------------------------------------------------------------------
14041 Extract response and send it to UMAC
14042 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014043 wpalMemoryCopy( &halJoinRspMsg.joinRspParams,
14044 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014045 sizeof(halJoinRspMsg.joinRspParams));
14046
Jeff Johnsone7245742012-09-05 17:12:55 -070014047 wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014048
14049 wpalMutexAcquire(&pWDICtx->wptMutex);
14050
14051 /*-----------------------------------------------------------------------
14052 Join response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014053 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014054 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014055 if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014056 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14057 {
14058 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070014059 "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or "
14060 "association no longer in progress %d - mysterious HAL response",
14061 __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress);
Jeff Johnson295189b2012-06-20 16:38:30 -070014062
Jeff Johnsone7245742012-09-05 17:12:55 -070014063 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
Jeff Johnson295189b2012-06-20 16:38:30 -070014064 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014065 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014066 }
14067
14068 pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx];
14069
14070 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014071 Join Response is only allowed in init state
Jeff Johnson295189b2012-06-20 16:38:30 -070014072 -----------------------------------------------------------------------*/
14073 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14074 {
14075 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14076 "Join only allowed in Joining state - failure state is %d "
14077 "strange HAL response", pBSSSes->wdiAssocState);
14078
Jeff Johnsone7245742012-09-05 17:12:55 -070014079 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14080
Jeff Johnson295189b2012-06-20 16:38:30 -070014081 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014082 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014083 }
14084
14085
14086 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014087 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014088 -----------------------------------------------------------------------*/
14089 if ( WDI_STATUS_SUCCESS != wdiStatus )
14090 {
14091 /*Association was failed by HAL - remove session*/
14092 WDI_DeleteSession(pWDICtx, pBSSSes);
14093
14094 /*Association no longer in progress */
14095 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14096
14097 /*Association no longer in progress - prepare pending assoc for processing*/
14098 WDI_DequeueAssocRequest(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014099
Jeff Johnson295189b2012-06-20 16:38:30 -070014100 }
14101 else
14102 {
14103 /*Transition to state Joining - this may be redundant as we are supposed
14104 to be in this state already - but just to be safe*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014105 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014106 }
14107
14108 wpalMutexRelease(&pWDICtx->wptMutex);
14109
14110 /*Notify UMAC*/
14111 wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14112
Jeff Johnsone7245742012-09-05 17:12:55 -070014113 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014114}/*WDI_ProcessJoinRsp*/
14115
14116
14117/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014118 @brief Process Config BSS Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014119 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014120
14121 @param pWDICtx: pointer to the WLAN DAL context
14122 pEventData: pointer to the event information structure
14123
Jeff Johnson295189b2012-06-20 16:38:30 -070014124 @see
14125 @return Result of the function call
14126*/
14127WDI_Status
14128WDI_ProcessConfigBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014129(
Jeff Johnson295189b2012-06-20 16:38:30 -070014130 WDI_ControlBlockType* pWDICtx,
14131 WDI_EventInfoType* pEventData
14132)
14133{
14134 WDI_ConfigBSSRspParamsType wdiConfigBSSParams;
14135 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014136 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014137 WDI_BSSSessionType* pBSSSes = NULL;
14138
Jeff Johnsone7245742012-09-05 17:12:55 -070014139 tConfigBssRspMsg halConfigBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014140 WDI_AddStaParams wdiBcastAddSTAParam = {0};
14141 WDI_AddStaParams wdiAddSTAParam = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -070014142
Jeff Johnson295189b2012-06-20 16:38:30 -070014143 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14144
14145 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014146 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014147 -------------------------------------------------------------------------*/
14148 if (( NULL == pEventData ) ||
14149 ( NULL == pEventData->pEventData))
14150 {
14151 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14152 "%s: Invalid parameters", __FUNCTION__);
14153 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014154 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014155 }
14156
14157 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB;
14158
14159 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014160 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014161 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014162 wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams,
14163 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014164 sizeof(halConfigBssRspMsg.configBssRspParams));
14165
14166 wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
14167 halConfigBssRspMsg.configBssRspParams.status);
14168 if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus)
14169 {
Jeff Johnsone7245742012-09-05 17:12:55 -070014170 wpalMemoryCopy( wdiConfigBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014171 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID,
14172 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014173
Jeff Johnson295189b2012-06-20 16:38:30 -070014174 wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014175
14176 wdiConfigBSSParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014177 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014178
14179 wdiConfigBSSParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014180 halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014181
Jeff Johnson295189b2012-06-20 16:38:30 -070014182 wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014183
Jeff Johnson295189b2012-06-20 16:38:30 -070014184 #ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070014185 wdiConfigBSSParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070014186 halConfigBssRspMsg.configBssRspParams.txMgmtPower;
14187 #endif
14188 wpalMemoryCopy( wdiConfigBSSParams.macSTA,
14189 halConfigBssRspMsg.configBssRspParams.staMac,
14190 WDI_MAC_ADDR_LEN );
Jeff Johnsone7245742012-09-05 17:12:55 -070014191
Jeff Johnson295189b2012-06-20 16:38:30 -070014192 wpalMutexAcquire(&pWDICtx->wptMutex);
14193 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014194 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014195 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014196 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
14197 wdiConfigBSSParams.macBSSID,
14198 &pBSSSes);
14199
Jeff Johnson295189b2012-06-20 16:38:30 -070014200 /*-----------------------------------------------------------------------
14201 Config BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014202 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014203 -----------------------------------------------------------------------*/
14204 if ( NULL == pBSSSes )
14205 {
14206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14207 "Association sequence for this BSS does not yet exist "
14208 "- mysterious HAL response");
Jeff Johnsone7245742012-09-05 17:12:55 -070014209
14210 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14211
Jeff Johnson295189b2012-06-20 16:38:30 -070014212 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014213 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014214 }
Jeff Johnsone7245742012-09-05 17:12:55 -070014215
Jeff Johnson295189b2012-06-20 16:38:30 -070014216 /*Save data for this BSS*/
14217 pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType;
14218 pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014219 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014220 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014221 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014222 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014223 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014224 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014225 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014226 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014227 pBSSSes->ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014228 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14229 pBSSSes->bcastStaIdx =
14230 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014231
Jeff Johnson295189b2012-06-20 16:38:30 -070014232 /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */
Jeff Johnsone7245742012-09-05 17:12:55 -070014233
Jeff Johnson295189b2012-06-20 16:38:30 -070014234 /*-------------------------------------------------------------------------
14235 Add Peer STA
14236 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014237 wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070014238 wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx;
14239 wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014240
Jeff Johnson295189b2012-06-20 16:38:30 -070014241 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014242 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014243 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014244 wdiAddSTAParam.ucHTCapable =
14245 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable;
14246 wdiAddSTAParam.ucStaType =
14247 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType;
14248
Jeff Johnson295189b2012-06-20 16:38:30 -070014249 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070014250 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
14251 halConfigBssRspMsg.configBssRspParams.staMac,
Jeff Johnson295189b2012-06-20 16:38:30 -070014252 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014253
14254 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
14255 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID ,
14256 WDI_MAC_ADDR_LEN);
14257
Jeff Johnson295189b2012-06-20 16:38:30 -070014258 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014259 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014260 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014261 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014262 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014263 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014264 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014265 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014266 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014267 wdiAddSTAParam.ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014268 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014269 wdiAddSTAParam.ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014270 halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014271
Jeff Johnson295189b2012-06-20 16:38:30 -070014272 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14273 "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014274
Jeff Johnson295189b2012-06-20 16:38:30 -070014275 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
14276 /*-------------------------------------------------------------------------
14277 Add Broadcast STA only in AP mode
14278 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014279 if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode ==
Jeff Johnson295189b2012-06-20 16:38:30 -070014280 WDI_BSS_OPERATIONAL_MODE_AP )
14281 {
14282 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14283 "Add BCAST STA to table for index: %d",
14284 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014285
14286 wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070014287 sizeof(WDI_AddStaParams) );
Jeff Johnsone7245742012-09-05 17:12:55 -070014288
Jeff Johnson295189b2012-06-20 16:38:30 -070014289 WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam,
14290 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14291 }
14292 wpalMutexRelease(&pWDICtx->wptMutex);
14293 }
14294 else
14295 {
14296 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14297 "Config BSS RSP failed with status : %s(%d)",
14298 WDI_getHALStatusMsgString(
Jeff Johnsone7245742012-09-05 17:12:55 -070014299 halConfigBssRspMsg.configBssRspParams.status),
Jeff Johnson295189b2012-06-20 16:38:30 -070014300 halConfigBssRspMsg.configBssRspParams.status);
14301
Jeff Johnsone7245742012-09-05 17:12:55 -070014302
Jeff Johnson295189b2012-06-20 16:38:30 -070014303 /*Association was failed by HAL - remove session*/
14304 WDI_DeleteSession(pWDICtx, pBSSSes);
14305
14306 /*Association no longer in progress */
14307 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14308
14309 /*Association no longer in progress - prepare pending assoc for processing*/
14310 WDI_DequeueAssocRequest(pWDICtx);
14311
14312 }
14313
14314 /*Notify UMAC*/
14315 wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData);
14316
Jeff Johnsone7245742012-09-05 17:12:55 -070014317 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014318}/*WDI_ProcessConfigBSSRsp*/
14319
14320
14321/**
14322 @brief Process Del BSS Response function (called when a response
14323 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014324
14325 @param pWDICtx: pointer to the WLAN DAL context
14326 pEventData: pointer to the event information structure
14327
Jeff Johnson295189b2012-06-20 16:38:30 -070014328 @see
14329 @return Result of the function call
14330*/
14331WDI_Status
14332WDI_ProcessDelBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014333(
Jeff Johnson295189b2012-06-20 16:38:30 -070014334 WDI_ControlBlockType* pWDICtx,
14335 WDI_EventInfoType* pEventData
14336)
14337{
14338 WDI_DelBSSRspParamsType wdiDelBSSParams;
14339 WDI_DelBSSRspCb wdiDelBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014340 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014341 WDI_BSSSessionType* pBSSSes = NULL;
14342
Jeff Johnsone7245742012-09-05 17:12:55 -070014343 tDeleteBssRspMsg halDelBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014344 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14345
14346 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014347 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014348 -------------------------------------------------------------------------*/
14349 if (( NULL == pEventData ) ||
14350 ( NULL == pEventData->pEventData))
14351 {
14352 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14353 "%s: Invalid parameters", __FUNCTION__);
14354 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014355 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014356 }
14357
14358 wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB;
14359
14360 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014361 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014362 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014363 wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams,
14364 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014365 sizeof(halDelBssRspMsg.deleteBssRspParams));
14366
14367
14368 wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
Jeff Johnsone7245742012-09-05 17:12:55 -070014369 halDelBssRspMsg.deleteBssRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014370
14371 wpalMutexAcquire(&pWDICtx->wptMutex);
14372
14373 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014374 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014375 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014376 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
14377 halDelBssRspMsg.deleteBssRspParams.bssIdx,
14378 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014379
14380 /*-----------------------------------------------------------------------
14381 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014382 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014383 -----------------------------------------------------------------------*/
14384 if ( NULL == pBSSSes )
14385 {
14386 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14387 "Association sequence for this BSS does not yet exist or "
14388 "association no longer in progress - mysterious HAL response");
14389
Jeff Johnsone7245742012-09-05 17:12:55 -070014390 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14391
Jeff Johnson295189b2012-06-20 16:38:30 -070014392 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014393 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014394 }
14395
14396 /*Extract BSSID for the response to UMAC*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014397 wpalMemoryCopy(wdiDelBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014398 pBSSSes->macBSSID, WDI_MAC_ADDR_LEN);
14399
14400 wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx;
14401
14402 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014403 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014404 -----------------------------------------------------------------------*/
14405 WDI_DeleteSession(pWDICtx, pBSSSes);
14406
Jeff Johnsone7245742012-09-05 17:12:55 -070014407
Jeff Johnson295189b2012-06-20 16:38:30 -070014408 /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */
14409 if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType)
14410 {
14411 (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx );
14412 }
14413
14414 /* Delete the STA's in this BSS */
14415 WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014416
Jeff Johnson295189b2012-06-20 16:38:30 -070014417 wpalMutexRelease(&pWDICtx->wptMutex);
14418
14419 /*Notify UMAC*/
14420 wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData);
14421
Jeff Johnsone7245742012-09-05 17:12:55 -070014422 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014423}/*WDI_ProcessDelBSSRsp*/
14424
14425/**
14426 @brief Process Post Assoc Rsp function (called when a response
14427 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014428
14429 @param pWDICtx: pointer to the WLAN DAL context
14430 pEventData: pointer to the event information structure
14431
Jeff Johnson295189b2012-06-20 16:38:30 -070014432 @see
14433 @return Result of the function call
14434*/
14435WDI_Status
14436WDI_ProcessPostAssocRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014437(
Jeff Johnson295189b2012-06-20 16:38:30 -070014438 WDI_ControlBlockType* pWDICtx,
14439 WDI_EventInfoType* pEventData
14440)
14441{
14442 WDI_PostAssocRspParamsType wdiPostAssocParams;
14443 WDI_PostAssocRspCb wdiPostAssocRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014444 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014445 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014446 tPostAssocRspMsg halPostAssocRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014447 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14448
14449 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014450 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014451 -------------------------------------------------------------------------*/
14452 if (( NULL == pEventData ) ||
14453 ( NULL == pEventData->pEventData))
14454 {
14455 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14456 "%s: Invalid parameters", __FUNCTION__);
14457 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014458 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014459 }
14460
14461 wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB;
14462
14463 /*-------------------------------------------------------------------------
14464 Extract response and send it to UMAC
14465 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014466 wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams,
14467 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014468 sizeof(halPostAssocRspMsg.postAssocRspParams));
14469
14470 /*Extract the Post Assoc STA Params */
14471
Jeff Johnsone7245742012-09-05 17:12:55 -070014472 wdiPostAssocParams.staParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014473 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014474 wdiPostAssocParams.staParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014475 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070014476 wdiPostAssocParams.staParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014477 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14478
Jeff Johnsone7245742012-09-05 17:12:55 -070014479 wdiPostAssocParams.wdiStatus =
14480 WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014481
14482 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14483 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014484 wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA,
14485 pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014486 WDI_MAC_ADDR_LEN);
14487
14488 /* Extract Post Assoc BSS Params */
14489
Jeff Johnsone7245742012-09-05 17:12:55 -070014490 wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID,
14491 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID,
14492 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070014493
14494 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14495 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014496 wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014497 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext
14498 .macSTA, WDI_MAC_ADDR_LEN);
14499
Jeff Johnsone7245742012-09-05 17:12:55 -070014500 wdiPostAssocParams.bssParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014501 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14502
Jeff Johnsone7245742012-09-05 17:12:55 -070014503 wdiPostAssocParams.bssParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014504 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14505
14506 wdiPostAssocParams.bssParams.ucBSSIdx =
14507 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14508
Jeff Johnsone7245742012-09-05 17:12:55 -070014509 wdiPostAssocParams.bssParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014510 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx;
14511
14512 wpalMutexAcquire(&pWDICtx->wptMutex);
14513
14514 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014515 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014516 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014517 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070014518 wdiPostAssocParams.bssParams.
Jeff Johnsone7245742012-09-05 17:12:55 -070014519 macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014520
14521 /*-----------------------------------------------------------------------
14522 Post assoc response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014523 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014524 -----------------------------------------------------------------------*/
14525 if (( NULL == pBSSSes ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070014526 ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014527 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14528 {
14529 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14530 "Association sequence for this BSS does not yet exist or "
14531 "association no longer in progress - mysterious HAL response");
14532
Jeff Johnsone7245742012-09-05 17:12:55 -070014533 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14534
Jeff Johnson295189b2012-06-20 16:38:30 -070014535 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014536 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014537 }
14538
14539 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014540 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -070014541 -----------------------------------------------------------------------*/
14542 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14543 {
14544 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14545 "Post Assoc not allowed before JOIN - failing request "
14546 "strange HAL response");
14547
Jeff Johnsone7245742012-09-05 17:12:55 -070014548 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14549
Jeff Johnson295189b2012-06-20 16:38:30 -070014550 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014551 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014552 }
14553
14554 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014555 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014556 -----------------------------------------------------------------------*/
14557 if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus )
14558 {
14559 /*Association was failed by HAL - remove session*/
14560 WDI_DeleteSession(pWDICtx, pBSSSes);
14561 }
14562 else
14563 {
14564 /*Transition to state POST Assoc*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014565 pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014566
14567 /*Save DPU Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014568 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014569 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014570 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014571 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014572 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014573 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014574 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014575 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature;
14576
Jeff Johnsone7245742012-09-05 17:12:55 -070014577 pBSSSes->ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014578 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14579 }
14580
14581 /*Association no longer in progress */
14582 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14583
14584 /*Association no longer in progress - prepare pending assoc for processing*/
14585 WDI_DequeueAssocRequest(pWDICtx);
14586
14587 wpalMutexRelease(&pWDICtx->wptMutex);
14588
14589 /*Notify UMAC*/
14590 wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData);
14591
Jeff Johnsone7245742012-09-05 17:12:55 -070014592 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014593}/*WDI_ProcessPostAssocRsp*/
14594
14595/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014596 @brief Process Del STA Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070014597 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014598
14599 @param pWDICtx: pointer to the WLAN DAL context
14600 pEventData: pointer to the event information structure
14601
Jeff Johnson295189b2012-06-20 16:38:30 -070014602 @see
14603 @return Result of the function call
14604*/
14605WDI_Status
14606WDI_ProcessDelSTARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014607(
Jeff Johnson295189b2012-06-20 16:38:30 -070014608 WDI_ControlBlockType* pWDICtx,
14609 WDI_EventInfoType* pEventData
14610)
14611{
14612 WDI_DelSTARspParamsType wdiDelSTARsp;
14613 WDI_DelSTARspCb wdiDelSTARspCb;
14614 wpt_uint8 staType;
Jeff Johnsone7245742012-09-05 17:12:55 -070014615 tDeleteStaRspMsg halDelStaRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014616 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14617
14618 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014619 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014620 -------------------------------------------------------------------------*/
14621 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14622 ( NULL == pEventData->pEventData))
14623 {
14624 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14625 "%s: Invalid parameters", __FUNCTION__);
14626 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014627 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014628 }
14629
14630 wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB;
14631
14632 /*-------------------------------------------------------------------------
14633 Extract response and send it to UMAC
14634 -------------------------------------------------------------------------*/
14635 wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070014636 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014637 sizeof(halDelStaRspMsg.delStaRspParams));
14638
14639 wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070014640 wdiDelSTARsp.wdiStatus =
14641 WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014642
14643 WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType);
14644
14645 /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */
14646 if(staType == WDI_STA_ENTRY_SELF)
14647 {
14648 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
14649
14650 /* At this point add the self-STA */
14651
14652 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
14653 /*! TO DO: wdiAddSTAParam.ucHTCapable */
14654 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
14655
14656#define WDI_DPU_SELF_STA_DEFAULT_IDX 0
14657#define WDI_DPU_SELF_STA_DEFAULT_SIG 0
14658
14659 //all DPU indices are the same for self STA
14660 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14661 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14662 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14663 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14664 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14665 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG;
Madan Mohan Koyyalamudi2f11c2e2012-09-24 12:15:05 -070014666
14667 pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070014668 }
14669 else
14670 {
14671 //Delete the station in the table
14672 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14673 }
14674
14675 /*Notify UMAC*/
14676 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14677
Jeff Johnsone7245742012-09-05 17:12:55 -070014678 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014679}/*WDI_ProcessDelSTARsp*/
14680
14681
14682/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070014683 Security Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070014684==========================================================================*/
14685
14686/**
14687 @brief Process Set BSS Key Rsp function (called when a response
14688 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014689
14690 @param pWDICtx: pointer to the WLAN DAL context
14691 pEventData: pointer to the event information structure
14692
Jeff Johnson295189b2012-06-20 16:38:30 -070014693 @see
14694 @return Result of the function call
14695*/
14696WDI_Status
14697WDI_ProcessSetBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014698(
Jeff Johnson295189b2012-06-20 16:38:30 -070014699 WDI_ControlBlockType* pWDICtx,
14700 WDI_EventInfoType* pEventData
14701)
14702{
14703 WDI_Status wdiStatus;
14704 eHalStatus halStatus;
14705 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14706 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14707
14708 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014709 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014710 -------------------------------------------------------------------------*/
14711 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14712 ( NULL == pEventData->pEventData))
14713 {
14714 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14715 "%s: Invalid parameters", __FUNCTION__);
14716 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014717 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014718 }
14719
14720 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14721
14722 /*-------------------------------------------------------------------------
14723 Extract response and send it to UMAC
14724 -------------------------------------------------------------------------*/
14725 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014726 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014727
14728 if ( eHAL_STATUS_SUCCESS != halStatus )
14729 {
14730 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14731 "Set BSS Key failed with status %s (%d)",
14732 WDI_getHALStatusMsgString(halStatus),
14733 halStatus);
14734 /* send the status to UMAC, don't return from here*/
14735 }
14736
14737 /*Notify UMAC*/
14738 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14739
Jeff Johnsone7245742012-09-05 17:12:55 -070014740 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014741}/*WDI_ProcessSetBssKeyRsp*/
14742
14743/**
14744 @brief Process Remove BSS Key Rsp function (called when a response
14745 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014746
14747 @param pWDICtx: pointer to the WLAN DAL context
14748 pEventData: pointer to the event information structure
14749
Jeff Johnson295189b2012-06-20 16:38:30 -070014750 @see
14751 @return Result of the function call
14752*/
14753WDI_Status
14754WDI_ProcessRemoveBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014755(
Jeff Johnson295189b2012-06-20 16:38:30 -070014756 WDI_ControlBlockType* pWDICtx,
14757 WDI_EventInfoType* pEventData
14758)
14759{
14760 WDI_Status wdiStatus;
14761 eHalStatus halStatus;
14762 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14763 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14764
14765 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014766 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014767 -------------------------------------------------------------------------*/
14768 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14769 ( NULL == pEventData->pEventData))
14770 {
14771 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14772 "%s: Invalid parameters", __FUNCTION__);
14773 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014774 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014775 }
14776
14777 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14778
14779 /*-------------------------------------------------------------------------
14780 Extract response and send it to UMAC
14781 -------------------------------------------------------------------------*/
14782 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014783 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014784
14785 if ( eHAL_STATUS_SUCCESS != halStatus )
14786 {
14787 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14788 "Remove BSS Key failed with status %s (%d )",
14789 WDI_getHALStatusMsgString(halStatus),
14790 halStatus);
14791 /* send the status to UMAC, don't return from here*/
14792 }
14793
14794 /*Notify UMAC*/
14795 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14796
Jeff Johnsone7245742012-09-05 17:12:55 -070014797 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014798}/*WDI_ProcessSetBssKeyRsp*/
14799
14800
14801/**
14802 @brief Process Set STA Key Rsp function (called when a response
14803 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014804
14805 @param pWDICtx: pointer to the WLAN DAL context
14806 pEventData: pointer to the event information structure
14807
Jeff Johnson295189b2012-06-20 16:38:30 -070014808 @see
14809 @return Result of the function call
14810*/
14811WDI_Status
14812WDI_ProcessSetStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014813(
Jeff Johnson295189b2012-06-20 16:38:30 -070014814 WDI_ControlBlockType* pWDICtx,
14815 WDI_EventInfoType* pEventData
14816)
14817{
14818 WDI_Status wdiStatus;
14819 eHalStatus halStatus;
14820 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14821 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14822
14823 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014824 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014825 -------------------------------------------------------------------------*/
14826 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14827 ( NULL == pEventData->pEventData))
14828 {
14829 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14830 "%s: Invalid parameters", __FUNCTION__);
14831 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014832 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014833 }
14834
14835 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14836
14837 /*-------------------------------------------------------------------------
14838 Extract response and send it to UMAC
14839 -------------------------------------------------------------------------*/
14840 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014841 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014842
14843 if ( eHAL_STATUS_SUCCESS != halStatus )
14844 {
14845 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14846 "Set STA Key failed with status %s (%d)",
14847 WDI_getHALStatusMsgString(halStatus),
14848 halStatus);
14849 /* send the status to UMAC, don't return from here*/
14850 }
14851
14852 /*Notify UMAC*/
14853 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14854
Jeff Johnsone7245742012-09-05 17:12:55 -070014855 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014856}/*WDI_ProcessSetSTAKeyRsp*/
14857
14858/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014859 @brief Process Remove STA Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014860 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014861
14862 @param pWDICtx: pointer to the WLAN DAL context
14863 pEventData: pointer to the event information structure
14864
Jeff Johnson295189b2012-06-20 16:38:30 -070014865 @see
14866 @return Result of the function call
14867*/
14868WDI_Status
14869WDI_ProcessRemoveStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014870(
Jeff Johnson295189b2012-06-20 16:38:30 -070014871 WDI_ControlBlockType* pWDICtx,
14872 WDI_EventInfoType* pEventData
14873)
14874{
14875 WDI_Status wdiStatus;
14876 eHalStatus halStatus;
14877 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14878 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14879
14880 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014881 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014882 -------------------------------------------------------------------------*/
14883 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14884 ( NULL == pEventData->pEventData))
14885 {
14886 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14887 "%s: Invalid parameters", __FUNCTION__);
14888 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014889 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014890 }
14891
14892 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14893
14894 /*-------------------------------------------------------------------------
14895 Extract response and send it to UMAC
14896 -------------------------------------------------------------------------*/
14897 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014898 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014899
14900 if ( eHAL_STATUS_SUCCESS != halStatus )
14901 {
14902 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14903 "Remove STA Key failed with status %s (%d)",
14904 WDI_getHALStatusMsgString(halStatus),
14905 halStatus);
14906 /* send the status to UMAC, don't return from here*/
14907 }
14908
14909 /*Notify UMAC*/
14910 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14911
Jeff Johnsone7245742012-09-05 17:12:55 -070014912 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014913}/*WDI_ProcessRemoveStaKeyRsp*/
14914
14915/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014916 @brief Process Set STA Bcast Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014917 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014918
14919 @param pWDICtx: pointer to the WLAN DAL context
14920 pEventData: pointer to the event information structure
14921
Jeff Johnson295189b2012-06-20 16:38:30 -070014922 @see
14923 @return Result of the function call
14924*/
14925WDI_Status
14926WDI_ProcessSetStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014927(
Jeff Johnson295189b2012-06-20 16:38:30 -070014928 WDI_ControlBlockType* pWDICtx,
14929 WDI_EventInfoType* pEventData
14930)
14931{
14932 WDI_Status wdiStatus;
14933 eHalStatus halStatus;
14934 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
14935 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14936
14937 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014938 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014939 -------------------------------------------------------------------------*/
14940 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14941 ( NULL == pEventData->pEventData))
14942 {
14943 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14944 "%s: Invalid parameters", __FUNCTION__);
14945 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014946 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014947 }
14948
14949 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14950
14951 /*-------------------------------------------------------------------------
14952 Extract response and send it to UMAC
14953 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014954 wpalMemoryCopy( &halStatus,
14955 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014956 sizeof(halStatus));
14957
Jeff Johnsone7245742012-09-05 17:12:55 -070014958 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014959
14960 if ( eHAL_STATUS_SUCCESS != halStatus )
14961 {
14962 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14963 "Set STA Key failed with status %s (%d)",
14964 WDI_getHALStatusMsgString(halStatus),
14965 halStatus);
14966 /* send the status to UMAC, don't return from here*/
14967 }
14968
14969 /*Notify UMAC*/
14970 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14971
Jeff Johnsone7245742012-09-05 17:12:55 -070014972 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014973}/*WDI_ProcessSetSTABcastKeyRsp*/
14974
14975/**
14976 @brief Process Remove STA Bcast Key Rsp function (called when a
14977 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014978
14979 @param pWDICtx: pointer to the WLAN DAL context
14980 pEventData: pointer to the event information structure
14981
Jeff Johnson295189b2012-06-20 16:38:30 -070014982 @see
14983 @return Result of the function call
14984*/
14985WDI_Status
14986WDI_ProcessRemoveStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014987(
Jeff Johnson295189b2012-06-20 16:38:30 -070014988 WDI_ControlBlockType* pWDICtx,
14989 WDI_EventInfoType* pEventData
14990)
14991{
14992 WDI_Status wdiStatus;
14993 eHalStatus halStatus;
14994 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
14995 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14996
14997 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014998 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014999 -------------------------------------------------------------------------*/
15000 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15001 ( NULL == pEventData->pEventData))
15002 {
15003 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15004 "%s: Invalid parameters", __FUNCTION__);
15005 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015006 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015007 }
15008
15009 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
15010
15011 /*-------------------------------------------------------------------------
15012 Extract response and send it to UMAC
15013 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015014 wpalMemoryCopy( &halStatus,
15015 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015016 sizeof(halStatus));
15017
Jeff Johnsone7245742012-09-05 17:12:55 -070015018 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015019
15020 if ( eHAL_STATUS_SUCCESS != halStatus )
15021 {
15022 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15023 "Remove STA Key failed with status %s (%d)",
15024 WDI_getHALStatusMsgString(halStatus),
15025 halStatus);
15026 /* send the status to UMAC, don't return from here*/
15027 }
15028
15029 /*Notify UMAC*/
15030 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15031
Jeff Johnsone7245742012-09-05 17:12:55 -070015032 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015033}/*WDI_ProcessRemoveStaBcastKeyRsp*/
15034
15035
15036/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015037 QoS and BA Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070015038==========================================================================*/
15039
15040/**
15041 @brief Process Add TSpec Rsp function (called when a response
15042 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015043
15044 @param pWDICtx: pointer to the WLAN DAL context
15045 pEventData: pointer to the event information structure
15046
Jeff Johnson295189b2012-06-20 16:38:30 -070015047 @see
15048 @return Result of the function call
15049*/
15050WDI_Status
15051WDI_ProcessAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015052(
Jeff Johnson295189b2012-06-20 16:38:30 -070015053 WDI_ControlBlockType* pWDICtx,
15054 WDI_EventInfoType* pEventData
15055)
15056{
15057 WDI_Status wdiStatus;
15058 eHalStatus halStatus;
15059 WDI_AddTsRspCb wdiAddTsRspCb;
15060 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15061
15062 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015063 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015064 -------------------------------------------------------------------------*/
15065 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15066 ( NULL == pEventData->pEventData))
15067 {
15068 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15069 "%s: Invalid parameters", __FUNCTION__);
15070 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015071 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015072 }
15073
15074 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
15075
15076 /*-------------------------------------------------------------------------
15077 Extract response and send it to UMAC
15078 -------------------------------------------------------------------------*/
15079 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015080 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015081
15082 /*Notify UMAC*/
15083 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15084
Jeff Johnsone7245742012-09-05 17:12:55 -070015085 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015086}/*WDI_ProcessAddTSpecRsp*/
15087
15088
15089/**
15090 @brief Process Del TSpec Rsp function (called when a response
15091 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015092
15093 @param pWDICtx: pointer to the WLAN DAL context
15094 pEventData: pointer to the event information structure
15095
Jeff Johnson295189b2012-06-20 16:38:30 -070015096 @see
15097 @return Result of the function call
15098*/
15099WDI_Status
15100WDI_ProcessDelTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015101(
Jeff Johnson295189b2012-06-20 16:38:30 -070015102 WDI_ControlBlockType* pWDICtx,
15103 WDI_EventInfoType* pEventData
15104)
15105{
15106 WDI_Status wdiStatus;
15107 eHalStatus halStatus;
15108 WDI_DelTsRspCb wdiDelTsRspCb;
15109 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15110
15111 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015112 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015113 -------------------------------------------------------------------------*/
15114 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15115 ( NULL == pEventData->pEventData))
15116 {
15117 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15118 "%s: Invalid parameters", __FUNCTION__);
15119 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015120 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015121 }
15122
15123 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
15124
15125 /*-------------------------------------------------------------------------
15126 Extract response and send it to UMAC
15127 -------------------------------------------------------------------------*/
15128 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015129 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015130
15131 /*Notify UMAC*/
15132 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15133
Jeff Johnsone7245742012-09-05 17:12:55 -070015134 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015135}/*WDI_ProcessDelTSpecRsp*/
15136
15137/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015138 @brief Process Update EDCA Parameters Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015139 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015140
15141 @param pWDICtx: pointer to the WLAN DAL context
15142 pEventData: pointer to the event information structure
15143
Jeff Johnson295189b2012-06-20 16:38:30 -070015144 @see
15145 @return Result of the function call
15146*/
15147WDI_Status
15148WDI_ProcessUpdateEDCAParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015149(
Jeff Johnson295189b2012-06-20 16:38:30 -070015150 WDI_ControlBlockType* pWDICtx,
15151 WDI_EventInfoType* pEventData
15152)
15153{
15154 WDI_Status wdiStatus;
15155 eHalStatus halStatus;
15156 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
15157 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15158
15159 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015160 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015161 -------------------------------------------------------------------------*/
15162 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15163 ( NULL == pEventData->pEventData))
15164 {
15165 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15166 "%s: Invalid parameters", __FUNCTION__);
15167 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015168 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015169 }
15170
15171 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
15172
15173 /*-------------------------------------------------------------------------
15174 Extract response and send it to UMAC
15175 -------------------------------------------------------------------------*/
15176 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015177 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015178
15179 /*Notify UMAC*/
15180 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15181
Jeff Johnsone7245742012-09-05 17:12:55 -070015182 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015183}/*WDI_ProcessUpdateEDCAParamsRsp*/
15184
15185
15186/**
15187 @brief Process Add BA Rsp function (called when a response
15188 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015189
15190 @param pWDICtx: pointer to the WLAN DAL context
15191 pEventData: pointer to the event information structure
15192
Jeff Johnson295189b2012-06-20 16:38:30 -070015193 @see
15194 @return Result of the function call
15195*/
15196WDI_Status
15197WDI_ProcessAddBASessionRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015198(
Jeff Johnson295189b2012-06-20 16:38:30 -070015199 WDI_ControlBlockType* pWDICtx,
15200 WDI_EventInfoType* pEventData
15201)
15202{
15203 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
15204
15205 tAddBASessionRspParams halBASessionRsp;
15206 WDI_AddBASessionRspParamsType wdiBASessionRsp;
15207
Jeff Johnsone7245742012-09-05 17:12:55 -070015208
Jeff Johnson295189b2012-06-20 16:38:30 -070015209 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15210
15211 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015212 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015213 -------------------------------------------------------------------------*/
15214 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15215 ( NULL == pEventData->pEventData))
15216 {
15217 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15218 "%s: Invalid parameters", __FUNCTION__);
15219 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015220 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015221 }
15222
15223 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
15224
15225 /*-------------------------------------------------------------------------
15226 Extract response and send it to UMAC
15227 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015228 wpalMemoryCopy( &halBASessionRsp,
15229 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015230 sizeof(halBASessionRsp));
15231
15232 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
15233
Jeff Johnson43971f52012-07-17 12:26:56 -070015234 if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015235 {
15236 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
15237 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
15238 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
15239 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
15240 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
15241 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
15242 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
15243 }
15244
15245 /*Notify UMAC*/
15246 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
15247
Jeff Johnsone7245742012-09-05 17:12:55 -070015248 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015249}/*WDI_ProcessAddSessionBARsp*/
15250
15251
15252/**
15253 @brief Process Del BA Rsp function (called when a response
15254 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015255
15256 @param pWDICtx: pointer to the WLAN DAL context
15257 pEventData: pointer to the event information structure
15258
Jeff Johnson295189b2012-06-20 16:38:30 -070015259 @see
15260 @return Result of the function call
15261*/
15262WDI_Status
15263WDI_ProcessDelBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015264(
Jeff Johnson295189b2012-06-20 16:38:30 -070015265 WDI_ControlBlockType* pWDICtx,
15266 WDI_EventInfoType* pEventData
15267)
15268{
15269 WDI_Status wdiStatus;
15270 eHalStatus halStatus;
15271 WDI_DelBARspCb wdiDelBARspCb;
15272 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15273
15274 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015275 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015276 -------------------------------------------------------------------------*/
15277 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15278 ( NULL == pEventData->pEventData))
15279 {
15280 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15281 "%s: Invalid parameters", __FUNCTION__);
15282 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015283 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015284 }
15285
15286 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15287
15288 /*-------------------------------------------------------------------------
15289 Extract response and send it to UMAC
15290 -------------------------------------------------------------------------*/
15291 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015292 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015293
15294 if ( eHAL_STATUS_SUCCESS == halStatus )
15295 {
15296 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15297 }
15298
15299 /*Notify UMAC*/
15300 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15301
Jeff Johnsone7245742012-09-05 17:12:55 -070015302 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015303}/*WDI_ProcessDelBARsp*/
15304
15305#ifdef FEATURE_WLAN_CCX
15306/**
15307 @brief Process TSM Stats Rsp function (called when a response
15308 is being received over the bus from HAL)
15309
15310 @param pWDICtx: pointer to the WLAN DAL context
15311 pEventData: pointer to the event information structure
15312
15313 @see
15314 @return Result of the function call
15315*/
15316WDI_Status
15317WDI_ProcessTsmStatsRsp
15318(
15319 WDI_ControlBlockType* pWDICtx,
15320 WDI_EventInfoType* pEventData
15321)
15322{
15323 WDI_TsmRspCb wdiTsmStatsRspCb;
15324 tTsmStatsRspMsg halTsmStatsRspMsg;
15325 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15326 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15327
15328 /*-------------------------------------------------------------------------
15329 Sanity check
15330 -------------------------------------------------------------------------*/
15331 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15332 ( NULL == pEventData->pEventData))
15333 {
15334 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15335 "%s: Invalid parameters", __FUNCTION__);
15336 WDI_ASSERT(0);
15337 return WDI_STATUS_E_FAILURE;
15338 }
15339
15340 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15341
15342 /*-------------------------------------------------------------------------
15343 Unpack HAL Response Message - the header was already extracted by the
15344 main Response Handling procedure
15345 -------------------------------------------------------------------------*/
15346 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15347 pEventData->pEventData,
15348 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15349
15350 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15351 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15352 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15353 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15354 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15355 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15356 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15357 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15358 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15359 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15360 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15361 halTsmStatsRspMsg.tsmStatsRspParams.status);
15362
15363 /*Notify UMAC*/
15364 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15365
15366 return WDI_STATUS_SUCCESS;
15367}/*WDI_ProcessTsmStatsRsp*/
15368
15369#endif
15370
15371
15372
15373/**
15374 @brief Process Flush AC Rsp function (called when a response
15375 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015376
15377 @param pWDICtx: pointer to the WLAN DAL context
15378 pEventData: pointer to the event information structure
15379
Jeff Johnson295189b2012-06-20 16:38:30 -070015380 @see
15381 @return Result of the function call
15382*/
15383WDI_Status
15384WDI_ProcessFlushAcRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015385(
Jeff Johnson295189b2012-06-20 16:38:30 -070015386 WDI_ControlBlockType* pWDICtx,
15387 WDI_EventInfoType* pEventData
15388)
15389{
15390 WDI_Status wdiStatus;
15391 eHalStatus halStatus;
15392 WDI_FlushAcRspCb wdiFlushAcRspCb;
15393 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15394
15395 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015396 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015397 -------------------------------------------------------------------------*/
15398 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15399 ( NULL == pEventData->pEventData))
15400 {
15401 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15402 "%s: Invalid parameters", __FUNCTION__);
15403 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015404 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015405 }
15406
15407 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15408
15409 /*-------------------------------------------------------------------------
15410 Extract response and send it to UMAC
15411 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015412 wpalMemoryCopy( &halStatus,
15413 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015414 sizeof(halStatus));
15415
Jeff Johnsone7245742012-09-05 17:12:55 -070015416 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015417
15418 /*Notify UMAC*/
15419 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15420
Jeff Johnsone7245742012-09-05 17:12:55 -070015421 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015422}/*WDI_ProcessFlushAcRsp*/
15423
15424/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015425 @brief Process BT AMP event Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015426 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015427
15428 @param pWDICtx: pointer to the WLAN DAL context
15429 pEventData: pointer to the event information structure
15430
Jeff Johnson295189b2012-06-20 16:38:30 -070015431 @see
15432 @return Result of the function call
15433*/
15434WDI_Status
15435WDI_ProcessBtAmpEventRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015436(
Jeff Johnson295189b2012-06-20 16:38:30 -070015437 WDI_ControlBlockType* pWDICtx,
15438 WDI_EventInfoType* pEventData
15439)
15440{
15441 WDI_Status wdiStatus;
15442 eHalStatus halStatus;
15443 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15444 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15445
15446 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015447 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015448 -------------------------------------------------------------------------*/
15449 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15450 ( NULL == pEventData->pEventData))
15451 {
15452 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15453 "%s: Invalid parameters", __FUNCTION__);
15454 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015455 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015456 }
15457
15458 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15459
15460 /*-------------------------------------------------------------------------
15461 Extract response and send it to UMAC
15462 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015463 wpalMemoryCopy( &halStatus,
15464 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015465 sizeof(halStatus));
15466
Jeff Johnsone7245742012-09-05 17:12:55 -070015467 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015468
15469 /*Notify UMAC*/
15470 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15471
Jeff Johnsone7245742012-09-05 17:12:55 -070015472 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015473}/*WDI_ProcessBtAmpEventRsp*/
15474
15475
15476/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015477 @brief Process ADD STA SELF Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070015478 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015479
15480 @param pWDICtx: pointer to the WLAN DAL context
15481 pEventData: pointer to the event information structure
15482
Jeff Johnson295189b2012-06-20 16:38:30 -070015483 @see
15484 @return Result of the function call
15485*/
15486WDI_Status
15487WDI_ProcessAddSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015488(
Jeff Johnson295189b2012-06-20 16:38:30 -070015489 WDI_ControlBlockType* pWDICtx,
15490 WDI_EventInfoType* pEventData
15491)
15492{
15493 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15494 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15495 tAddStaSelfRspMsg halAddStaSelfRsp;
15496 WDI_AddStaParams wdiAddSTAParam = {0};
15497 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15498
15499 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015500 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015501 -------------------------------------------------------------------------*/
15502 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15503 ( NULL == pEventData->pEventData))
15504 {
15505 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15506 "%s: Invalid parameters", __FUNCTION__);
15507 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015508 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015509 }
15510
Jeff Johnsone7245742012-09-05 17:12:55 -070015511 wdiAddSTASelfReqParamsRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070015512 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15513
15514 /*-------------------------------------------------------------------------
15515 Extract response and send it to UMAC
15516 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015517 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15518 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015519 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15520
15521
Jeff Johnsone7245742012-09-05 17:12:55 -070015522 wdiAddSTASelfParams.wdiStatus =
15523 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015524
Jeff Johnsone7245742012-09-05 17:12:55 -070015525 wdiAddSTASelfParams.ucSTASelfIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015526 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015527 wdiAddSTASelfParams.dpuIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015528 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015529 wdiAddSTASelfParams.dpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015530 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15531
15532 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15533 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15534 WDI_MAC_ADDR_LEN);
15535
15536
15537#ifdef HAL_SELF_STA_PER_BSS
15538
15539 /* At this point add the self-STA */
15540
15541 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15542 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15543 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15544
15545 //all DPU indices are the same for self STA
15546
15547 /*DPU Information*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015548 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015549 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15550 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15551 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15552 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15553 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15554
15555 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15556 WDI_MAC_ADDR_LEN);
15557
15558 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15559 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15560
Jeff Johnsone7245742012-09-05 17:12:55 -070015561 if(halAddStaSelfRsp.addStaSelfRspParams.status
Jeff Johnson295189b2012-06-20 16:38:30 -070015562 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15563 {
15564 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15565 }
15566#endif
15567
15568 /*Notify UMAC*/
15569 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15570
Jeff Johnsone7245742012-09-05 17:12:55 -070015571 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015572}/*WDI_ProcessAddSTASelfRsp*/
15573
15574
15575
15576/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015577 @brief WDI_ProcessDelSTASelfRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015578 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015579
15580 @param pWDICtx: pointer to the WLAN DAL context
15581 pEventData: pointer to the event information structure
15582
Jeff Johnson295189b2012-06-20 16:38:30 -070015583 @see
15584 @return Result of the function call
15585*/
15586WDI_Status
15587WDI_ProcessDelSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015588(
Jeff Johnson295189b2012-06-20 16:38:30 -070015589 WDI_ControlBlockType* pWDICtx,
15590 WDI_EventInfoType* pEventData
15591)
15592{
15593 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15594 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15595 tDelStaSelfRspParams delStaSelfRspParams;
15596 wpt_uint8 ucStaIdx;
15597
15598 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15599
15600 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015601 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015602 -------------------------------------------------------------------------*/
15603 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15604 ( NULL == pEventData->pEventData))
15605 {
15606 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15607 "%s: Invalid parameters", __FUNCTION__);
15608 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015609 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015610 }
15611
15612 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15613
15614 /*-------------------------------------------------------------------------
15615 Extract response and send it to UMAC
15616 -------------------------------------------------------------------------*/
15617
Jeff Johnsone7245742012-09-05 17:12:55 -070015618 wpalMemoryCopy( &delStaSelfRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070015619 (wpt_uint8*)pEventData->pEventData,
15620 sizeof(tDelStaSelfRspParams));
15621
Jeff Johnsone7245742012-09-05 17:12:55 -070015622 wdiDelStaSelfRspParams.wdiStatus =
15623 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015624
Jeff Johnsone7245742012-09-05 17:12:55 -070015625 /* delStaSelfRspParams.status is not
Jeff Johnson295189b2012-06-20 16:38:30 -070015626 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15627 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15628 {
15629 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070015630 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070015631 delStaSelfRspParams.selfMacAddr,
15632 &ucStaIdx);
15633 if(WDI_STATUS_E_FAILURE == wdiStatus)
15634 {
15635 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15636 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15637 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015638 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015639 }
15640 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15641 }
15642
15643 /*Notify UMAC*/
15644 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15645
15646 return WDI_STATUS_SUCCESS;
15647}
15648
Jeff Johnsone7245742012-09-05 17:12:55 -070015649#ifdef FEATURE_OEM_DATA_SUPPORT
15650/**
15651 @brief Start Oem Data Rsp function (called when a
15652 response is being received over the bus from HAL)
Jeff Johnson295189b2012-06-20 16:38:30 -070015653
Jeff Johnsone7245742012-09-05 17:12:55 -070015654 @param pWDICtx: pointer to the WLAN DAL context
15655 pEventData: pointer to the event information structure
15656
15657 @see
15658 @return Result of the function call
15659*/
15660#define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName)
15661
15662WDI_Status
15663WDI_ProcessStartOemDataRsp
15664(
15665 WDI_ControlBlockType* pWDICtx,
15666 WDI_EventInfoType* pEventData
15667)
15668{
15669 WDI_oemDataRspCb wdiOemDataRspCb;
15670 WDI_oemDataRspParamsType* wdiOemDataRspParams;
15671 tStartOemDataRspParams* halStartOemDataRspParams;
15672
15673 /*-------------------------------------------------------------------------
15674 Sanity check
15675 -------------------------------------------------------------------------*/
15676 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15677 ( NULL == pEventData->pEventData))
15678 {
15679 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15680 "%s: Invalid parameters", __FUNCTION__);
15681 WDI_ASSERT(0);
15682 return WDI_STATUS_E_FAILURE;
15683 }
15684
15685 wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB;
15686
15687 /*-------------------------------------------------------------------------
15688 Extract response and send it to UMAC
15689 -------------------------------------------------------------------------*/
15690 halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData;
15691
15692
15693 //It is the responsibility of the application code to check for failure
15694 //conditions!
15695
15696 //Allocate memory for WDI OEM DATA RSP structure
15697 wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ;
15698
15699 if(NULL == wdiOemDataRspParams)
15700 {
15701 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15702 "Failed to allocate memory in OEM DATA Response %x %x %x ",
15703 pWDICtx, pEventData, pEventData->pEventData);
15704 WDI_ASSERT(0);
15705 return WDI_STATUS_E_FAILURE;
15706 }
15707
15708 /* Populate WDI structure members */
15709 wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE);
15710
15711 /*Notify UMAC*/
15712 wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData);
15713
15714 //Free memory allocated for WDI OEM_DATA MEAS RSP structure
15715 wpalMemoryFree(wdiOemDataRspParams);
15716
15717 return WDI_STATUS_SUCCESS;
15718}/*WDI_PrcoessStartOemDataRsp*/
15719#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070015720
15721/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015722 Miscellaneous Control Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070015723===========================================================================*/
15724
15725/**
15726 @brief Process Channel Switch Rsp function (called when a response
15727 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015728
15729 @param pWDICtx: pointer to the WLAN DAL context
15730 pEventData: pointer to the event information structure
15731
Jeff Johnson295189b2012-06-20 16:38:30 -070015732 @see
15733 @return Result of the function call
15734*/
15735WDI_Status
15736WDI_ProcessChannelSwitchRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015737(
Jeff Johnson295189b2012-06-20 16:38:30 -070015738 WDI_ControlBlockType* pWDICtx,
15739 WDI_EventInfoType* pEventData
15740)
15741{
15742 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15743 WDI_SwitchChRspCb wdiChSwitchRspCb;
15744 tSwitchChannelRspParams halSwitchChannelRsp;
15745 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15746
15747 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015748 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015749 -------------------------------------------------------------------------*/
15750 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15751 ( NULL == pEventData->pEventData))
15752 {
15753 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15754 "%s: Invalid parameters", __FUNCTION__);
15755 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015756 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015757 }
15758
15759 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15760
15761 /*-------------------------------------------------------------------------
15762 Extract response and send it to UMAC
15763 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015764 wpalMemoryCopy( &halSwitchChannelRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -070015765 (wpt_uint8*)pEventData->pEventData,
15766 sizeof(halSwitchChannelRsp));
15767
Jeff Johnsone7245742012-09-05 17:12:55 -070015768 wdiSwitchChRsp.wdiStatus =
15769 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015770 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15771
15772#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070015773 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070015774#endif
15775
15776 /*Notify UMAC*/
15777 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15778
Jeff Johnsone7245742012-09-05 17:12:55 -070015779 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015780}/*WDI_ProcessChannelSwitchRsp*/
15781
15782
15783/**
15784 @brief Process Config STA Rsp function (called when a response
15785 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015786
15787 @param pWDICtx: pointer to the WLAN DAL context
15788 pEventData: pointer to the event information structure
15789
Jeff Johnson295189b2012-06-20 16:38:30 -070015790 @see
15791 @return Result of the function call
15792*/
15793WDI_Status
15794WDI_ProcessConfigStaRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015795(
Jeff Johnson295189b2012-06-20 16:38:30 -070015796 WDI_ControlBlockType* pWDICtx,
15797 WDI_EventInfoType* pEventData
15798)
15799{
15800 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15801 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15802 WDI_AddStaParams wdiAddSTAParam;
15803
15804 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015805 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015806
Jeff Johnsone7245742012-09-05 17:12:55 -070015807 tConfigStaRspMsg halConfigStaRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070015808 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15809
15810 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015811 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015812 -------------------------------------------------------------------------*/
15813 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15814 ( NULL == pEventData->pEventData))
15815 {
15816 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15817 "%s: Invalid parameters", __FUNCTION__);
15818 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015819 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015820 }
15821
15822 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15823
15824 /*-------------------------------------------------------------------------
15825 Extract response and send it to UMAC
15826 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015827 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15828 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015829 sizeof(halConfigStaRsp.configStaRspParams));
15830
15831
15832 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15833 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15834 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15835 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15836 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15837
15838 /* MAC Address of STA - take from cache as it does not come back in the
15839 response*/
15840 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070015841 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015842 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015843
15844 wdiCfgSTAParams.wdiStatus =
15845 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015846
15847 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15848 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15849 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15850
15851 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15852 {
15853 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15854 {
15855 /* ADD STA to table */
Jeff Johnsone7245742012-09-05 17:12:55 -070015856 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015857 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15858 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015859
Jeff Johnson295189b2012-06-20 16:38:30 -070015860 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015861 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070015862 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070015863 wdiAddSTAParam.ucHTCapable =
15864 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15865 wdiAddSTAParam.ucStaType =
15866 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15867
Jeff Johnson295189b2012-06-20 16:38:30 -070015868 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070015869 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15870 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015871 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015872
15873 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15874 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15875 WDI_MAC_ADDR_LEN);
15876
15877 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15878 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15879 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070015880
15881 if ( NULL == pBSSSes )
15882 {
15883 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15884 "Association for this BSSID is not in place");
Jeff Johnsone7245742012-09-05 17:12:55 -070015885
Jeff Johnson295189b2012-06-20 16:38:30 -070015886 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015887 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070015888 }
15889
15890 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015891 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015892 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015893 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015894 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015895 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015896 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015897 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015898 halConfigStaRsp.configStaRspParams.ucBcastSig;
15899 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
15900 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015901
Jeff Johnson295189b2012-06-20 16:38:30 -070015902 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15903 }
15904 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15905 {
15906 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
15907
Jeff Johnsone7245742012-09-05 17:12:55 -070015908 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015909 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015910 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015911 halConfigStaRsp.configStaRspParams.ucBcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015912 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015913 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015914 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015915 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015916 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015917 halConfigStaRsp.configStaRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015918 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015919 halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015920 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070015921 halConfigStaRsp.configStaRspParams.ucUcastSig;
15922 }
15923 }
15924
15925 /*Notify UMAC*/
15926 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
15927
Jeff Johnsone7245742012-09-05 17:12:55 -070015928 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015929}/*WDI_ProcessConfigStaRsp*/
15930
15931
15932/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015933 @brief Process Set Link State Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015934 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015935
15936 @param pWDICtx: pointer to the WLAN DAL context
15937 pEventData: pointer to the event information structure
15938
Jeff Johnson295189b2012-06-20 16:38:30 -070015939 @see
15940 @return Result of the function call
15941*/
15942WDI_Status
15943WDI_ProcessSetLinkStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015944(
Jeff Johnson295189b2012-06-20 16:38:30 -070015945 WDI_ControlBlockType* pWDICtx,
15946 WDI_EventInfoType* pEventData
15947)
15948{
15949 WDI_Status wdiStatus;
15950 eHalStatus halStatus;
15951 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
15952
15953 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015954 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015955 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15956
15957 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015958 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015959 -------------------------------------------------------------------------*/
15960 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15961 ( NULL == pEventData->pEventData))
15962 {
15963 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15964 "%s: Invalid parameters", __FUNCTION__);
15965 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015966 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015967 }
15968
15969 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
15970
15971 wpalMutexAcquire(&pWDICtx->wptMutex);
15972
15973 /*If the link is being transitioned to idle - the BSS is to be deleted
15974 - this type of ending a session is possible when UMAC has failed an
15975 - association session during Join*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015976 if ( WDI_LINK_IDLE_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070015977 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
15978 {
15979 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015980 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070015981 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015982 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15983 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
15984 &pBSSSes);
15985
Jeff Johnson295189b2012-06-20 16:38:30 -070015986 /*-----------------------------------------------------------------------
15987 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070015988 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070015989 -----------------------------------------------------------------------*/
15990 if ( NULL == pBSSSes )
15991 {
15992 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
15993 "Set link response received outside association session");
15994 }
15995 else
15996 {
15997 /* For BT AMP roles no need to delete the sessions if assoc fails. There
15998 will be del BSS coming after this to stop the beaconing & cleaning up the
15999 sessions*/
16000 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
16001 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
16002 {
16003 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016004 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070016005 -----------------------------------------------------------------------*/
16006 WDI_DeleteSession(pWDICtx, pBSSSes);
16007
16008 /*-----------------------------------------------------------------------
16009 Check to see if this association is in progress - if so disable the
16010 flag as this has ended
16011 -----------------------------------------------------------------------*/
16012 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
Jeff Johnsone7245742012-09-05 17:12:55 -070016013 {
Jeff Johnson295189b2012-06-20 16:38:30 -070016014 /*Association no longer in progress */
16015 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16016 /*Association no longer in progress - prepare pending assoc for processing*/
16017 WDI_DequeueAssocRequest(pWDICtx);
16018 }
16019 }
16020 }
16021 }
16022 /* If the link state has been set to POST ASSOC, reset the "association in
16023 progress" flag */
Jeff Johnsone7245742012-09-05 17:12:55 -070016024 if ( WDI_LINK_POSTASSOC_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016025 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16026 {
16027 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16028 WDI_DequeueAssocRequest(pWDICtx);
16029 }
16030
16031 wpalMutexRelease(&pWDICtx->wptMutex);
16032
16033 /*-------------------------------------------------------------------------
16034 Extract response and send it to UMAC
16035 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016036 wpalMemoryCopy( &halStatus,
16037 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016038 sizeof(halStatus));
16039
Jeff Johnsone7245742012-09-05 17:12:55 -070016040 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016041
16042 /*Notify UMAC*/
16043 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16044
Jeff Johnsone7245742012-09-05 17:12:55 -070016045 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016046}/*WDI_ProcessSetLinkStateRsp*/
16047
16048/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016049 @brief Process Get Stats Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016050 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016051
16052 @param pWDICtx: pointer to the WLAN DAL context
16053 pEventData: pointer to the event information structure
16054
Jeff Johnson295189b2012-06-20 16:38:30 -070016055 @see
16056 @return Result of the function call
16057*/
16058WDI_Status
16059WDI_ProcessGetStatsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016060(
Jeff Johnson295189b2012-06-20 16:38:30 -070016061 WDI_ControlBlockType* pWDICtx,
16062 WDI_EventInfoType* pEventData
16063)
16064{
16065 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
16066 WDI_GetStatsRspCb wdiGetStatsRspCb;
16067 tHalStatsRspParams* pHalStatsRspParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070016068
Jeff Johnson295189b2012-06-20 16:38:30 -070016069 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16070
16071 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016072 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016073 -------------------------------------------------------------------------*/
16074 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16075 ( NULL == pEventData->pEventData))
16076 {
16077 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16078 "%s: Invalid parameters", __FUNCTION__);
16079 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016080 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016081 }
16082
16083 /*-------------------------------------------------------------------------
16084 Extract response and send it to UMAC
16085 -------------------------------------------------------------------------*/
16086 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
16087
16088 /*allocate the stats response buffer */
16089 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
16090 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
16091 + sizeof(WDI_GetStatsRspParamsType));
16092
16093 if(NULL == wdiGetStatsRsp)
16094 {
16095 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16096 "Failed to allocate memory in Get Stats Response %x %x %x ",
16097 pWDICtx, pEventData, pEventData->pEventData);
16098 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016099 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016100 }
16101
16102 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
16103
16104 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
16105 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
16106 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
16107 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
16108 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
16109 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
16110
16111 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
16112 wpalMemoryCopy(wdiGetStatsRsp + 1,
16113 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
16114 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
16115
16116 /*Notify UMAC*/
16117 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
16118
16119 wpalMemoryFree(wdiGetStatsRsp);
16120
Jeff Johnsone7245742012-09-05 17:12:55 -070016121 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016122}/*WDI_ProcessGetStatsRsp*/
16123
16124
16125/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016126 @brief Process Update Cfg Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016127 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016128
16129 @param pWDICtx: pointer to the WLAN DAL context
16130 pEventData: pointer to the event information structure
16131
Jeff Johnson295189b2012-06-20 16:38:30 -070016132 @see
16133 @return Result of the function call
16134*/
16135WDI_Status
16136WDI_ProcessUpdateCfgRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016137(
Jeff Johnson295189b2012-06-20 16:38:30 -070016138 WDI_ControlBlockType* pWDICtx,
16139 WDI_EventInfoType* pEventData
16140)
16141{
16142 WDI_Status wdiStatus;
16143 eHalStatus halStatus;
16144 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
16145 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16146
16147 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016148 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016149 -------------------------------------------------------------------------*/
16150 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16151 ( NULL == pEventData->pEventData))
16152 {
16153 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16154 "%s: Invalid parameters", __FUNCTION__);
16155 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016156 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016157 }
16158
16159 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
16160
16161 /*-------------------------------------------------------------------------
16162 Extract response and send it to UMAC
16163 -------------------------------------------------------------------------*/
16164 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016165 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016166
16167 /*Notify UMAC*/
16168 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16169
Jeff Johnsone7245742012-09-05 17:12:55 -070016170 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016171}/*WDI_ProcessUpdateCfgRsp*/
16172
16173
16174
16175/**
16176 @brief Process Add BA Rsp function (called when a response
16177 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016178
16179 @param pWDICtx: pointer to the WLAN DAL context
16180 pEventData: pointer to the event information structure
16181
Jeff Johnson295189b2012-06-20 16:38:30 -070016182 @see
16183 @return Result of the function call
16184*/
16185WDI_Status
16186WDI_ProcessAddBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016187(
Jeff Johnson295189b2012-06-20 16:38:30 -070016188 WDI_ControlBlockType* pWDICtx,
16189 WDI_EventInfoType* pEventData
16190)
16191{
16192 WDI_AddBARspCb wdiAddBARspCb;
16193
16194 tAddBARspParams halAddBARsp;
16195 WDI_AddBARspinfoType wdiAddBARsp;
16196
16197 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16198
16199 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016200 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016201 -------------------------------------------------------------------------*/
16202 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16203 ( NULL == pEventData->pEventData))
16204 {
16205 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16206 "%s: Invalid parameters", __FUNCTION__);
16207 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016208 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016209 }
16210
16211 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
16212
16213 /*-------------------------------------------------------------------------
16214 Extract response and send it to UMAC
16215 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016216 wpalMemoryCopy( &halAddBARsp,
16217 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016218 sizeof(halAddBARsp));
16219
16220 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
16221
Jeff Johnson43971f52012-07-17 12:26:56 -070016222 if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070016223 {
16224 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
16225 }
16226
16227 /*Notify UMAC*/
16228 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
16229
Jeff Johnsone7245742012-09-05 17:12:55 -070016230 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016231}/*WDI_ProcessAddSessionBARsp*/
16232
16233/**
16234 @brief Process Add BA Rsp function (called when a response
16235 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016236
16237 @param pWDICtx: pointer to the WLAN DAL context
16238 pEventData: pointer to the event information structure
16239
Jeff Johnson295189b2012-06-20 16:38:30 -070016240 @see
16241 @return Result of the function call
16242*/
16243WDI_Status
16244WDI_ProcessTriggerBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016245(
Jeff Johnson295189b2012-06-20 16:38:30 -070016246 WDI_ControlBlockType* pWDICtx,
16247 WDI_EventInfoType* pEventData
16248)
16249{
16250 WDI_TriggerBARspCb wdiTriggerBARspCb;
16251
16252 tTriggerBARspParams* halTriggerBARsp;
16253 tTriggerBaRspCandidate* halBaCandidate;
16254 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
16255 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
16256 wpt_uint16 index;
16257 wpt_uint16 TidIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016258
Jeff Johnson295189b2012-06-20 16:38:30 -070016259 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16260
16261 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016262 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016263 -------------------------------------------------------------------------*/
16264 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16265 ( NULL == pEventData->pEventData))
16266 {
16267 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16268 "%s: Invalid parameters", __FUNCTION__);
16269 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016270 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016271 }
16272
16273 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
16274
16275 /*-------------------------------------------------------------------------
16276 Extract response and send it to UMAC
16277 -------------------------------------------------------------------------*/
16278 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
16279
Jeff Johnsone7245742012-09-05 17:12:55 -070016280 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
16281 halTriggerBARsp->baCandidateCnt *
Jeff Johnson295189b2012-06-20 16:38:30 -070016282 sizeof(WDI_TriggerBARspCandidateType));
16283 if(NULL == wdiTriggerBARsp)
16284 {
16285 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16286 "Failed to allocate memory in Trigger BA Response %x %x %x ",
16287 pWDICtx, pEventData, pEventData->pEventData);
16288 wpalMemoryFree(halTriggerBARsp);
16289 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016290 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016291 }
16292
16293 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
16294
16295 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
16296 {
16297 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
Jeff Johnsone7245742012-09-05 17:12:55 -070016298 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070016299 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
16300
16301 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
16302 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
16303
16304 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
16305 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016306 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070016307 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
16308 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
16309 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016310 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070016311 halBaCandidate->baInfo[TidIndex].fBaEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070016312 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
Jeff Johnson295189b2012-06-20 16:38:30 -070016313 halBaCandidate->baInfo[TidIndex].startingSeqNum;
16314 }
16315 wdiTriggerBARspCandidate++;
16316 halBaCandidate++;
16317 }
16318 }
16319
16320 /*Notify UMAC*/
16321 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16322
16323 wpalMemoryFree(wdiTriggerBARsp);
Jeff Johnsone7245742012-09-05 17:12:55 -070016324 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016325}/*WDI_ProcessAddSessionBARsp*/
16326
16327/**
16328 @brief Process Update Beacon Params Rsp function (called when a response
16329 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016330
16331 @param pWDICtx: pointer to the WLAN DAL context
16332 pEventData: pointer to the event information structure
16333
Jeff Johnson295189b2012-06-20 16:38:30 -070016334 @see
16335 @return Result of the function call
16336*/
16337WDI_Status
16338WDI_ProcessUpdateBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016339(
Jeff Johnson295189b2012-06-20 16:38:30 -070016340 WDI_ControlBlockType* pWDICtx,
16341 WDI_EventInfoType* pEventData
16342)
16343{
16344 WDI_Status wdiStatus;
16345 eHalStatus halStatus;
16346 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16347 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16348
16349 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016350 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016351 -------------------------------------------------------------------------*/
16352 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16353 ( NULL == pEventData->pEventData))
16354 {
16355 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16356 "%s: Invalid parameters", __FUNCTION__);
16357 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016358 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016359 }
16360
16361 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16362
16363 /*-------------------------------------------------------------------------
16364 Extract response and send it to UMAC
16365 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016366 wpalMemoryCopy( &halStatus,
16367 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016368 sizeof(halStatus));
16369
Jeff Johnsone7245742012-09-05 17:12:55 -070016370 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016371
16372 /*Notify UMAC*/
16373 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16374
Jeff Johnsone7245742012-09-05 17:12:55 -070016375 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016376}/*WDI_ProcessUpdateBeaconParamsRsp*/
16377
16378/**
16379 @brief Process Send Beacon template Rsp function (called when a response
16380 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016381
16382 @param pWDICtx: pointer to the WLAN DAL context
16383 pEventData: pointer to the event information structure
16384
Jeff Johnson295189b2012-06-20 16:38:30 -070016385 @see
16386 @return Result of the function call
16387*/
16388WDI_Status
16389WDI_ProcessSendBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016390(
Jeff Johnson295189b2012-06-20 16:38:30 -070016391 WDI_ControlBlockType* pWDICtx,
16392 WDI_EventInfoType* pEventData
16393)
16394{
16395 WDI_Status wdiStatus;
16396 eHalStatus halStatus;
16397 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16398 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16399
16400 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016401 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016402 -------------------------------------------------------------------------*/
16403 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16404 ( NULL == pEventData->pEventData))
16405 {
16406 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16407 "%s: Invalid parameters", __FUNCTION__);
16408 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016409 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016410 }
16411
16412 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16413
16414 /*-------------------------------------------------------------------------
16415 Extract response and send it to UMAC
16416 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016417 wpalMemoryCopy( &halStatus,
16418 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016419 sizeof(halStatus));
16420
Jeff Johnsone7245742012-09-05 17:12:55 -070016421 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016422
16423 /*Notify UMAC*/
16424 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16425
Jeff Johnsone7245742012-09-05 17:12:55 -070016426 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016427}/*WDI_ProcessSendBeaconParamsRsp*/
16428
Jeff Johnsone7245742012-09-05 17:12:55 -070016429
Jeff Johnson295189b2012-06-20 16:38:30 -070016430/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016431 @brief Process Update Probe Resp Template Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016432 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016433
16434 @param pWDICtx: pointer to the WLAN DAL context
16435 pEventData: pointer to the event information structure
16436
Jeff Johnson295189b2012-06-20 16:38:30 -070016437 @see
16438 @return Result of the function call
16439*/
16440WDI_Status
16441WDI_ProcessUpdateProbeRspTemplateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016442(
Jeff Johnson295189b2012-06-20 16:38:30 -070016443 WDI_ControlBlockType* pWDICtx,
16444 WDI_EventInfoType* pEventData
16445)
16446{
16447 WDI_Status wdiStatus;
16448 eHalStatus halStatus;
16449 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16450 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16451
16452 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016453 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016454 -------------------------------------------------------------------------*/
16455 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16456 ( NULL == pEventData->pEventData))
16457 {
16458 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16459 "%s: Invalid parameters", __FUNCTION__);
16460 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016461 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016462 }
16463
16464 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16465
16466 /*-------------------------------------------------------------------------
16467 Extract response and send it to UMAC
16468 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016469 wpalMemoryCopy( &halStatus,
16470 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016471 sizeof(halStatus));
16472
Jeff Johnsone7245742012-09-05 17:12:55 -070016473 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016474
16475 /*Notify UMAC*/
16476 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16477
Jeff Johnsone7245742012-09-05 17:12:55 -070016478 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016479}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16480
16481 /**
16482 @brief Process Set Max Tx Power Rsp function (called when a response
16483 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016484
16485 @param pWDICtx: pointer to the WLAN DAL context
16486 pEventData: pointer to the event information structure
16487
Jeff Johnson295189b2012-06-20 16:38:30 -070016488 @see
16489 @return Result of the function call
16490*/
16491WDI_Status
16492WDI_ProcessSetMaxTxPowerRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016493(
Jeff Johnson295189b2012-06-20 16:38:30 -070016494 WDI_ControlBlockType* pWDICtx,
16495 WDI_EventInfoType* pEventData
16496)
16497{
16498 tSetMaxTxPwrRspMsg halTxpowerrsp;
Jeff Johnsone7245742012-09-05 17:12:55 -070016499
Jeff Johnson295189b2012-06-20 16:38:30 -070016500 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070016501
Jeff Johnson295189b2012-06-20 16:38:30 -070016502 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16503 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16504
16505 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016506 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016507 -------------------------------------------------------------------------*/
16508 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16509 ( NULL == pEventData->pEventData))
16510 {
16511 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16512 "%s: Invalid parameters", __FUNCTION__);
16513 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016514 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016515 }
16516
16517 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16518
16519 /*-------------------------------------------------------------------------
16520 Extract response and send it to UMAC
16521 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016522 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16523 pEventData->pEventData,
16524 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070016525
16526 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16527 {
16528 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16529 "Error status returned in Set Max Tx Power Response ");
Jeff Johnsone7245742012-09-05 17:12:55 -070016530 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16531 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016532 }
16533
Jeff Johnsone7245742012-09-05 17:12:55 -070016534 wdiSetMaxTxPowerRspMsg.wdiStatus =
Jeff Johnson295189b2012-06-20 16:38:30 -070016535 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
Jeff Johnsone7245742012-09-05 17:12:55 -070016536 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
Jeff Johnson295189b2012-06-20 16:38:30 -070016537
16538 /*Notify UMAC*/
16539 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16540
Jeff Johnsone7245742012-09-05 17:12:55 -070016541 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016542}
16543
16544#ifdef WLAN_FEATURE_P2P
16545/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016546 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016547 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016548
16549 @param pWDICtx: pointer to the WLAN DAL context
16550 pEventData: pointer to the event information structure
16551
Jeff Johnson295189b2012-06-20 16:38:30 -070016552 @see
16553 @return Result of the function call
16554*/
16555WDI_Status
16556WDI_ProcessP2PGONOARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016557(
Jeff Johnson295189b2012-06-20 16:38:30 -070016558 WDI_ControlBlockType* pWDICtx,
16559 WDI_EventInfoType* pEventData
16560)
16561{
16562 WDI_Status wdiStatus;
16563 eHalStatus halStatus;
16564 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16565 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16566
16567 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016568 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016569 -------------------------------------------------------------------------*/
16570 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16571 ( NULL == pEventData->pEventData))
16572 {
16573 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16574 "%s: Invalid parameters", __FUNCTION__);
16575 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016576 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016577 }
16578
16579 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16580
16581 /*-------------------------------------------------------------------------
16582 Extract response and send it to UMAC
16583 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016584 wpalMemoryCopy( &halStatus,
16585 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016586 sizeof(halStatus));
16587
Jeff Johnsone7245742012-09-05 17:12:55 -070016588 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016589
16590 /*Notify UMAC*/
16591 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16592
Jeff Johnsone7245742012-09-05 17:12:55 -070016593 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016594}/*WDI_ProcessP2PGONOARsp*/
16595#endif
16596/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016597 @brief Process Enter IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016598 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016599
16600 @param pWDICtx: pointer to the WLAN DAL context
16601 pEventData: pointer to the event information structure
16602
Jeff Johnson295189b2012-06-20 16:38:30 -070016603 @see
16604 @return Result of the function call
16605*/
16606WDI_Status
16607WDI_ProcessEnterImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016608(
Jeff Johnson295189b2012-06-20 16:38:30 -070016609 WDI_ControlBlockType* pWDICtx,
16610 WDI_EventInfoType* pEventData
16611)
16612{
16613 WDI_Status wdiStatus;
16614 eHalStatus halStatus;
16615 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16616 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16617
16618 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016619 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016620 -------------------------------------------------------------------------*/
16621 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16622 ( NULL == pEventData->pEventData))
16623 {
16624 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16625 "%s: Invalid parameters", __FUNCTION__);
16626 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016627 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016628 }
16629
16630 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16631
16632 /*-------------------------------------------------------------------------
16633 Extract response and send it to UMAC
16634 -------------------------------------------------------------------------*/
16635 halStatus = *((eHalStatus*)pEventData->pEventData);
16636
Jeff Johnsone7245742012-09-05 17:12:55 -070016637 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016638
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016639 /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state.
16640 * Other module states are taken care by PMC.
16641 * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails??
16642 */
16643 if (wdiStatus != WDI_STATUS_SUCCESS) {
16644
16645 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16646 "WDI PRocess Enter IMPS RSP failed With HAL Status Code: %d",halStatus);
16647 /* Call Back is not required as we are putting the DXE in FULL
16648 * and riva is already in full (IMPS RSP Failed)*/
16649 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16650 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016651 /*Notify UMAC*/
16652 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16653
Jeff Johnsone7245742012-09-05 17:12:55 -070016654 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016655}/*WDI_ProcessEnterImpsRsp*/
16656
16657/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016658 @brief Process Exit IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016659 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016660
16661 @param pWDICtx: pointer to the WLAN DAL context
16662 pEventData: pointer to the event information structure
16663
Jeff Johnson295189b2012-06-20 16:38:30 -070016664 @see
16665 @return Result of the function call
16666*/
16667WDI_Status
16668WDI_ProcessExitImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016669(
Jeff Johnson295189b2012-06-20 16:38:30 -070016670 WDI_ControlBlockType* pWDICtx,
16671 WDI_EventInfoType* pEventData
16672)
16673{
16674 WDI_Status wdiStatus;
16675 eHalStatus halStatus;
16676 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16677 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16678
16679 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016680 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016681 -------------------------------------------------------------------------*/
16682 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16683 ( NULL == pEventData->pEventData))
16684 {
16685 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16686 "%s: Invalid parameters", __FUNCTION__);
16687 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016688 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016689 }
16690
16691 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16692
16693 /*-------------------------------------------------------------------------
16694 Extract response and send it to UMAC
16695 -------------------------------------------------------------------------*/
16696 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016697 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016698
16699 // notify DTS that we are entering Full power
16700 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16701
16702 /*Notify UMAC*/
16703 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16704
Jeff Johnsone7245742012-09-05 17:12:55 -070016705 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016706}/*WDI_ProcessExitImpsRsp*/
16707
16708/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016709 @brief Process Enter BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016710 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016711
16712 @param pWDICtx: pointer to the WLAN DAL context
16713 pEventData: pointer to the event information structure
16714
Jeff Johnson295189b2012-06-20 16:38:30 -070016715 @see
16716 @return Result of the function call
16717*/
16718WDI_Status
16719WDI_ProcessEnterBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016720(
Jeff Johnson295189b2012-06-20 16:38:30 -070016721 WDI_ControlBlockType* pWDICtx,
16722 WDI_EventInfoType* pEventData
16723)
16724{
16725 WDI_Status wdiStatus;
16726 eHalStatus halStatus;
16727 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16728 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16729
16730 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016731 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016732 -------------------------------------------------------------------------*/
16733 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16734 ( NULL == pEventData->pEventData))
16735 {
16736 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16737 "%s: Invalid parameters", __FUNCTION__);
16738 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016739 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016740 }
16741
16742 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
16743
16744 /*-------------------------------------------------------------------------
16745 Extract response and send it to UMAC
16746 -------------------------------------------------------------------------*/
16747 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016748 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016749
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016750 /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state.
16751 * Other module states are taken care by PMC.
16752 * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails??
16753 */
16754 if (wdiStatus != WDI_STATUS_SUCCESS) {
16755
16756 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16757 "WDI PRocess Enter BMPS RSP failed With HAL Status Code: %d",halStatus);
16758 /* Call Back is not required as we are putting the DXE in FULL
16759 * and riva is already in FULL (BMPS RSP Failed)*/
16760 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16761 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16762 }
16763
Jeff Johnson295189b2012-06-20 16:38:30 -070016764 /*Notify UMAC*/
16765 wdiEnterBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16766
Jeff Johnsone7245742012-09-05 17:12:55 -070016767 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016768}/*WDI_ProcessEnterBmpsRsp*/
16769
16770/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016771 @brief Process Exit BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016772 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016773
16774 @param pWDICtx: pointer to the WLAN DAL context
16775 pEventData: pointer to the event information structure
16776
Jeff Johnson295189b2012-06-20 16:38:30 -070016777 @see
16778 @return Result of the function call
16779*/
16780WDI_Status
16781WDI_ProcessExitBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016782(
Jeff Johnson295189b2012-06-20 16:38:30 -070016783 WDI_ControlBlockType* pWDICtx,
16784 WDI_EventInfoType* pEventData
16785)
16786{
16787 WDI_Status wdiStatus;
16788 eHalStatus halStatus;
16789 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
16790 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16791
16792 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016793 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016794 -------------------------------------------------------------------------*/
16795 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16796 ( NULL == pEventData->pEventData))
16797 {
16798 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16799 "%s: Invalid parameters", __FUNCTION__);
16800 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016801 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016802 }
16803
16804 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16805
16806 /*-------------------------------------------------------------------------
16807 Extract response and send it to UMAC
16808 -------------------------------------------------------------------------*/
16809 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016810 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016811
16812 // notify DTS that we are entering Full power
16813 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16814
16815 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16816
16817 /*Notify UMAC*/
16818 wdiExitBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16819
Jeff Johnsone7245742012-09-05 17:12:55 -070016820 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016821}/*WDI_ProcessExitBmpsRsp*/
16822
16823/**
16824 @brief Process Enter UAPSD Rsp function (called when a response
16825 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016826
16827 @param pWDICtx: pointer to the WLAN DAL context
16828 pEventData: pointer to the event information structure
16829
Jeff Johnson295189b2012-06-20 16:38:30 -070016830 @see
16831 @return Result of the function call
16832*/
16833WDI_Status
16834WDI_ProcessEnterUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016835(
Jeff Johnson295189b2012-06-20 16:38:30 -070016836 WDI_ControlBlockType* pWDICtx,
16837 WDI_EventInfoType* pEventData
16838)
16839{
16840 WDI_Status wdiStatus;
16841 eHalStatus halStatus;
16842 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
16843 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16844
16845 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016846 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016847 -------------------------------------------------------------------------*/
16848 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16849 ( NULL == pEventData->pEventData))
16850 {
16851 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16852 "%s: Invalid parameters", __FUNCTION__);
16853 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016854 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016855 }
16856
16857 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16858
16859 /*-------------------------------------------------------------------------
16860 Extract response and send it to UMAC
16861 -------------------------------------------------------------------------*/
16862 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016863 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016864
16865 if(WDI_STATUS_SUCCESS == wdiStatus)
16866 {
16867 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
16868 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
16869 // the traffic to decide when to suspend the trigger frames when there is no traffic
16870 // activity on the trigger enabled ACs
16871 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
16872
16873#ifdef WLAN_PERF
16874 // Increment the BD signature to refresh the fast path BD utilization
16875 pWDICtx->uBdSigSerialNum++;
16876#endif
16877 }
16878
16879 /*Notify UMAC*/
16880 wdiEnterUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16881
Jeff Johnsone7245742012-09-05 17:12:55 -070016882 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016883}/*WDI_ProcessEnterUapsdRsp*/
16884
16885/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016886 @brief Process Exit UAPSD Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016887 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016888
16889 @param pWDICtx: pointer to the WLAN DAL context
16890 pEventData: pointer to the event information structure
16891
Jeff Johnson295189b2012-06-20 16:38:30 -070016892 @see
16893 @return Result of the function call
16894*/
16895WDI_Status
16896WDI_ProcessExitUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016897(
Jeff Johnson295189b2012-06-20 16:38:30 -070016898 WDI_ControlBlockType* pWDICtx,
16899 WDI_EventInfoType* pEventData
16900)
16901{
16902 WDI_Status wdiStatus;
16903 eHalStatus halStatus;
16904 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
16905 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16906
16907 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016908 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016909 -------------------------------------------------------------------------*/
16910 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16911 ( NULL == pEventData->pEventData))
16912 {
16913 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16914 "%s: Invalid parameters", __FUNCTION__);
16915 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016916 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016917 }
16918
16919 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
16920
16921 /*-------------------------------------------------------------------------
16922 Extract response and send it to UMAC
16923 -------------------------------------------------------------------------*/
16924 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016925 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016926
16927 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
16928 // directly instead of the FW WQ.
16929 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
16930
16931#ifdef WLAN_PERF
16932 // Increment the BD signature to refresh the fast path BD utilization
16933 pWDICtx->uBdSigSerialNum++;
16934#endif
16935
16936 /*Notify UMAC*/
16937 wdiExitUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16938
Jeff Johnsone7245742012-09-05 17:12:55 -070016939 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016940}/*WDI_ProcessExitUapsdRsp*/
16941
16942/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016943 @brief Process set UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016944 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016945
16946 @param pWDICtx: pointer to the WLAN DAL context
16947 pEventData: pointer to the event information structure
16948
Jeff Johnson295189b2012-06-20 16:38:30 -070016949 @see
16950 @return Result of the function call
16951*/
16952WDI_Status
16953WDI_ProcessSetUapsdAcParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016954(
Jeff Johnson295189b2012-06-20 16:38:30 -070016955 WDI_ControlBlockType* pWDICtx,
16956 WDI_EventInfoType* pEventData
16957)
16958{
16959 WDI_Status wdiStatus;
16960 eHalStatus halStatus;
16961 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
16962 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16963
16964 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016965 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016966 -------------------------------------------------------------------------*/
16967 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16968 ( NULL == pEventData->pEventData))
16969 {
16970 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16971 "%s: Invalid parameters", __FUNCTION__);
16972 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016973 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016974 }
16975
16976 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
16977
16978 /*-------------------------------------------------------------------------
16979 Extract response and send it to UMAC
16980 -------------------------------------------------------------------------*/
16981 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016982 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016983
16984 /*Notify UMAC*/
16985 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
16986
Jeff Johnsone7245742012-09-05 17:12:55 -070016987 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016988}/*WDI_ProcessSetUapsdAcParamsRsp*/
16989
16990/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016991 @brief Process update UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016992 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016993
16994 @param pWDICtx: pointer to the WLAN DAL context
16995 pEventData: pointer to the event information structure
16996
Jeff Johnson295189b2012-06-20 16:38:30 -070016997 @see
16998 @return Result of the function call
16999*/
17000WDI_Status
17001WDI_ProcessUpdateUapsdParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017002(
Jeff Johnson295189b2012-06-20 16:38:30 -070017003 WDI_ControlBlockType* pWDICtx,
17004 WDI_EventInfoType* pEventData
17005)
17006{
17007 WDI_Status wdiStatus;
17008 eHalStatus halStatus;
17009 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
17010 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17011
17012 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017013 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017014 -------------------------------------------------------------------------*/
17015 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17016 ( NULL == pEventData->pEventData))
17017 {
17018 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17019 "%s: Invalid parameters", __FUNCTION__);
17020 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017021 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017022 }
17023
17024 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
17025
17026 /*-------------------------------------------------------------------------
17027 Extract response and send it to UMAC
17028 -------------------------------------------------------------------------*/
17029 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017030 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017031
17032 /*Notify UMAC*/
17033 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17034
Jeff Johnsone7245742012-09-05 17:12:55 -070017035 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017036}/*WDI_ProcessUpdateUapsdParamsRsp*/
17037
17038/**
17039 @brief Process Configure RXP filter Rsp function (called when a
17040 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017041
17042 @param pWDICtx: pointer to the WLAN DAL context
17043 pEventData: pointer to the event information structure
17044
Jeff Johnson295189b2012-06-20 16:38:30 -070017045 @see
17046 @return Result of the function call
17047*/
17048WDI_Status
17049WDI_ProcessConfigureRxpFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017050(
Jeff Johnson295189b2012-06-20 16:38:30 -070017051 WDI_ControlBlockType* pWDICtx,
17052 WDI_EventInfoType* pEventData
17053)
17054{
17055 WDI_Status wdiStatus;
17056 eHalStatus halStatus;
17057 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
17058 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17059
17060 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017061 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017062 -------------------------------------------------------------------------*/
17063 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17064 ( NULL == pEventData->pEventData))
17065 {
17066 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17067 "%s: Invalid parameters", __FUNCTION__);
17068 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017069 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017070 }
17071
17072 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
17073
17074 /*-------------------------------------------------------------------------
17075 Extract response and send it to UMAC
17076 -------------------------------------------------------------------------*/
17077 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017078 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017079
17080 /*Notify UMAC*/
17081 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17082
Jeff Johnsone7245742012-09-05 17:12:55 -070017083 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017084}/*WDI_ProcessConfigureRxpFilterRsp*/
17085
17086/**
17087 @brief Process Set beacon filter Rsp function (called when a
17088 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017089
17090 @param pWDICtx: pointer to the WLAN DAL context
17091 pEventData: pointer to the event information structure
17092
Jeff Johnson295189b2012-06-20 16:38:30 -070017093 @see
17094 @return Result of the function call
17095*/
17096WDI_Status
17097WDI_ProcessSetBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017098(
Jeff Johnson295189b2012-06-20 16:38:30 -070017099 WDI_ControlBlockType* pWDICtx,
17100 WDI_EventInfoType* pEventData
17101)
17102{
17103 WDI_Status wdiStatus;
17104 eHalStatus halStatus;
17105 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
17106 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17107
17108 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017109 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017110 -------------------------------------------------------------------------*/
17111 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17112 ( NULL == pEventData->pEventData))
17113 {
17114 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17115 "%s: Invalid parameters", __FUNCTION__);
17116 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017117 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017118 }
17119
17120 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
17121
17122 /*-------------------------------------------------------------------------
17123 Extract response and send it to UMAC
17124 -------------------------------------------------------------------------*/
17125 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017126 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017127
17128 /*Notify UMAC*/
17129 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17130
Jeff Johnsone7245742012-09-05 17:12:55 -070017131 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017132}/*WDI_ProcessSetBeaconFilterRsp*/
17133
17134/**
17135 @brief Process remove beacon filter Rsp function (called when a
17136 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017137
17138 @param pWDICtx: pointer to the WLAN DAL context
17139 pEventData: pointer to the event information structure
17140
Jeff Johnson295189b2012-06-20 16:38:30 -070017141 @see
17142 @return Result of the function call
17143*/
17144WDI_Status
17145WDI_ProcessRemBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017146(
Jeff Johnson295189b2012-06-20 16:38:30 -070017147 WDI_ControlBlockType* pWDICtx,
17148 WDI_EventInfoType* pEventData
17149)
17150{
17151 WDI_Status wdiStatus;
17152 eHalStatus halStatus;
17153 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
17154 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17155
17156 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017157 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017158 -------------------------------------------------------------------------*/
17159 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17160 ( NULL == pEventData->pEventData))
17161 {
17162 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17163 "%s: Invalid parameters", __FUNCTION__);
17164 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017165 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017166 }
17167
17168 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
17169
17170 /*-------------------------------------------------------------------------
17171 Extract response and send it to UMAC
17172 -------------------------------------------------------------------------*/
17173 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017174 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017175
17176 /*Notify UMAC*/
17177 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17178
Jeff Johnsone7245742012-09-05 17:12:55 -070017179 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017180}/*WDI_ProcessRemBeaconFilterRsp*/
17181
17182/**
17183 @brief Process set RSSI thresholds Rsp function (called when a
17184 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017185
17186 @param pWDICtx: pointer to the WLAN DAL context
17187 pEventData: pointer to the event information structure
17188
Jeff Johnson295189b2012-06-20 16:38:30 -070017189 @see
17190 @return Result of the function call
17191*/
17192WDI_Status
17193WDI_ProcessSetRSSIThresoldsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017194(
Jeff Johnson295189b2012-06-20 16:38:30 -070017195 WDI_ControlBlockType* pWDICtx,
17196 WDI_EventInfoType* pEventData
17197)
17198{
17199 WDI_Status wdiStatus;
17200 eHalStatus halStatus;
17201 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
17202 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17203
17204 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017205 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017206 -------------------------------------------------------------------------*/
17207 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17208 ( NULL == pEventData->pEventData))
17209 {
17210 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17211 "%s: Invalid parameters", __FUNCTION__);
17212 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017213 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017214 }
17215
17216 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
17217
17218 /*-------------------------------------------------------------------------
17219 Extract response and send it to UMAC
17220 -------------------------------------------------------------------------*/
17221 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017222 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017223
17224 /*Notify UMAC*/
17225 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
17226
Jeff Johnsone7245742012-09-05 17:12:55 -070017227 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017228}/*WDI_ProcessSetRSSIThresoldsRsp*/
17229
17230/**
17231 @brief Process host offload Rsp function (called when a
17232 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017233
17234 @param pWDICtx: pointer to the WLAN DAL context
17235 pEventData: pointer to the event information structure
17236
Jeff Johnson295189b2012-06-20 16:38:30 -070017237 @see
17238 @return Result of the function call
17239*/
17240WDI_Status
17241WDI_ProcessHostOffloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017242(
Jeff Johnson295189b2012-06-20 16:38:30 -070017243 WDI_ControlBlockType* pWDICtx,
17244 WDI_EventInfoType* pEventData
17245)
17246{
17247 WDI_Status wdiStatus;
17248 eHalStatus halStatus;
17249 WDI_HostOffloadCb wdiHostOffloadCb;
17250 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17251
17252 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017253 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017254 -------------------------------------------------------------------------*/
17255 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17256 ( NULL == pEventData->pEventData))
17257 {
17258 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17259 "%s: Invalid parameters", __FUNCTION__);
17260 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017261 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017262 }
17263
17264 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
17265
17266 /*-------------------------------------------------------------------------
17267 Extract response and send it to UMAC
17268 -------------------------------------------------------------------------*/
17269 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017270 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017271
17272 /*Notify UMAC*/
17273 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
17274
Jeff Johnsone7245742012-09-05 17:12:55 -070017275 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017276}/*WDI_ProcessHostOffloadRsp*/
17277
17278/**
17279 @brief Process keep alive Rsp function (called when a
17280 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017281
17282 @param pWDICtx: pointer to the WLAN DAL context
17283 pEventData: pointer to the event information structure
17284
Jeff Johnson295189b2012-06-20 16:38:30 -070017285 @see
17286 @return Result of the function call
17287*/
17288WDI_Status
17289WDI_ProcessKeepAliveRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017290(
Jeff Johnson295189b2012-06-20 16:38:30 -070017291 WDI_ControlBlockType* pWDICtx,
17292 WDI_EventInfoType* pEventData
17293)
17294{
17295 WDI_Status wdiStatus;
17296 eHalStatus halStatus;
17297 WDI_KeepAliveCb wdiKeepAliveCb;
17298 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17299 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17300 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
17301
17302
17303 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017304 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017305 -------------------------------------------------------------------------*/
17306 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17307 ( NULL == pEventData->pEventData))
17308 {
17309 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17310 "%s: Invalid parameters", __FUNCTION__);
17311 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017312 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017313 }
17314
Jeff Johnsone7245742012-09-05 17:12:55 -070017315 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
17316
Jeff Johnson295189b2012-06-20 16:38:30 -070017317 /*-------------------------------------------------------------------------
17318 Extract response and send it to UMAC
17319 -------------------------------------------------------------------------*/
17320 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017321 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017322
17323 /*Notify UMAC*/
17324 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
17325
Jeff Johnsone7245742012-09-05 17:12:55 -070017326 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017327}/*WDI_ProcessKeepAliveRsp*/
17328
17329/**
17330 @brief Process wowl add ptrn Rsp function (called when a
17331 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017332
17333 @param pWDICtx: pointer to the WLAN DAL context
17334 pEventData: pointer to the event information structure
17335
Jeff Johnson295189b2012-06-20 16:38:30 -070017336 @see
17337 @return Result of the function call
17338*/
17339WDI_Status
17340WDI_ProcessWowlAddBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017341(
Jeff Johnson295189b2012-06-20 16:38:30 -070017342 WDI_ControlBlockType* pWDICtx,
17343 WDI_EventInfoType* pEventData
17344)
17345{
17346 WDI_Status wdiStatus;
17347 eHalStatus halStatus;
17348 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
17349 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17350
17351 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017352 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017353 -------------------------------------------------------------------------*/
17354 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17355 ( NULL == pEventData->pEventData))
17356 {
17357 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17358 "%s: Invalid parameters", __FUNCTION__);
17359 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017360 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017361 }
17362
17363 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17364
17365 /*-------------------------------------------------------------------------
17366 Extract response and send it to UMAC
17367 -------------------------------------------------------------------------*/
17368 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017369 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017370
17371 /*Notify UMAC*/
17372 wdiWowlAddBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17373
Jeff Johnsone7245742012-09-05 17:12:55 -070017374 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017375}/*WDI_ProcessWowlAddBcPtrnRsp*/
17376
17377/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017378 @brief Process wowl delete ptrn Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017379 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017380
17381 @param pWDICtx: pointer to the WLAN DAL context
17382 pEventData: pointer to the event information structure
17383
Jeff Johnson295189b2012-06-20 16:38:30 -070017384 @see
17385 @return Result of the function call
17386*/
17387WDI_Status
17388WDI_ProcessWowlDelBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017389(
Jeff Johnson295189b2012-06-20 16:38:30 -070017390 WDI_ControlBlockType* pWDICtx,
17391 WDI_EventInfoType* pEventData
17392)
17393{
17394 WDI_Status wdiStatus;
17395 eHalStatus halStatus;
17396 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
17397 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17398
17399 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017400 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017401 -------------------------------------------------------------------------*/
17402 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17403 ( NULL == pEventData->pEventData))
17404 {
17405 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17406 "%s: Invalid parameters", __FUNCTION__);
17407 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017408 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017409 }
17410
17411 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17412
17413 /*-------------------------------------------------------------------------
17414 Extract response and send it to UMAC
17415 -------------------------------------------------------------------------*/
17416 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017417 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017418
17419 /*Notify UMAC*/
17420 wdiWowlDelBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData);
17421
Jeff Johnsone7245742012-09-05 17:12:55 -070017422 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017423}/*WDI_ProcessWowlDelBcPtrnRsp*/
17424
17425/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017426 @brief Process wowl enter Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017427 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017428
17429 @param pWDICtx: pointer to the WLAN DAL context
17430 pEventData: pointer to the event information structure
17431
Jeff Johnson295189b2012-06-20 16:38:30 -070017432 @see
17433 @return Result of the function call
17434*/
17435WDI_Status
17436WDI_ProcessWowlEnterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017437(
Jeff Johnson295189b2012-06-20 16:38:30 -070017438 WDI_ControlBlockType* pWDICtx,
17439 WDI_EventInfoType* pEventData
17440)
17441{
17442 WDI_Status wdiStatus;
17443 eHalStatus halStatus;
17444 WDI_WowlEnterReqCb wdiWowlEnterCb;
17445 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17446
17447 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017448 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017449 -------------------------------------------------------------------------*/
17450 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17451 ( NULL == pEventData->pEventData))
17452 {
17453 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17454 "%s: Invalid parameters", __FUNCTION__);
17455 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017456 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017457 }
17458
17459 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17460
17461 /*-------------------------------------------------------------------------
17462 Extract response and send it to UMAC
17463 -------------------------------------------------------------------------*/
17464 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017465 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017466
17467 /*Notify UMAC*/
17468 wdiWowlEnterCb( wdiStatus, pWDICtx->pRspCBUserData);
17469
Jeff Johnsone7245742012-09-05 17:12:55 -070017470 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017471}/*WDI_ProcessWowlEnterRsp*/
17472
17473/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017474 @brief Process wowl exit Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017475 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017476
17477 @param pWDICtx: pointer to the WLAN DAL context
17478 pEventData: pointer to the event information structure
17479
Jeff Johnson295189b2012-06-20 16:38:30 -070017480 @see
17481 @return Result of the function call
17482*/
17483WDI_Status
17484WDI_ProcessWowlExitRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017485(
Jeff Johnson295189b2012-06-20 16:38:30 -070017486 WDI_ControlBlockType* pWDICtx,
17487 WDI_EventInfoType* pEventData
17488)
17489{
17490 WDI_Status wdiStatus;
17491 eHalStatus halStatus;
17492 WDI_WowlExitReqCb wdiWowlExitCb;
17493 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17494
17495 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017496 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017497 -------------------------------------------------------------------------*/
17498 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17499 ( NULL == pEventData->pEventData))
17500 {
17501 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17502 "%s: Invalid parameters", __FUNCTION__);
17503 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017504 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017505 }
17506
17507 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17508
17509 /*-------------------------------------------------------------------------
17510 Extract response and send it to UMAC
17511 -------------------------------------------------------------------------*/
17512 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017513 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017514
17515 /*Notify UMAC*/
17516 wdiWowlExitCb( wdiStatus, pWDICtx->pRspCBUserData);
17517
Jeff Johnsone7245742012-09-05 17:12:55 -070017518 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017519}/*WDI_ProcessWowlExitRsp*/
17520
17521/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017522 @brief Process Configure Apps CPU wakeup State Rsp function
Jeff Johnson295189b2012-06-20 16:38:30 -070017523 (called when a response is being received over the bus
17524 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017525
17526 @param pWDICtx: pointer to the WLAN DAL context
17527 pEventData: pointer to the event information structure
17528
Jeff Johnson295189b2012-06-20 16:38:30 -070017529 @see
17530 @return Result of the function call
17531*/
17532WDI_Status
17533WDI_ProcessConfigureAppsCpuWakeupStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017534(
Jeff Johnson295189b2012-06-20 16:38:30 -070017535 WDI_ControlBlockType* pWDICtx,
17536 WDI_EventInfoType* pEventData
17537)
17538{
17539 WDI_Status wdiStatus;
17540 eHalStatus halStatus;
17541 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17542 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17543
17544 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017545 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017546 -------------------------------------------------------------------------*/
17547 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17548 ( NULL == pEventData->pEventData))
17549 {
17550 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17551 "%s: Invalid parameters", __FUNCTION__);
17552 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017553 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017554 }
17555
17556 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17557
17558 /*-------------------------------------------------------------------------
17559 Extract response and send it to UMAC
17560 -------------------------------------------------------------------------*/
17561 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017562 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017563
17564 /*Notify UMAC*/
17565 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17566
Jeff Johnsone7245742012-09-05 17:12:55 -070017567 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017568}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17569
17570
17571/**
17572 @brief Process Nv download(called when a response
17573 is being received over the bus from HAL,will check if the responce is )
Jeff Johnsone7245742012-09-05 17:12:55 -070017574
17575 @param pWDICtx: pointer to the WLAN DAL context
17576 pEventData: pointer to the event information structure
17577
Jeff Johnson295189b2012-06-20 16:38:30 -070017578 @see
17579 @return Result of the function call
17580*/
17581WDI_Status
17582WDI_ProcessNvDownloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017583(
Jeff Johnson295189b2012-06-20 16:38:30 -070017584 WDI_ControlBlockType* pWDICtx,
17585 WDI_EventInfoType* pEventData
17586)
17587{
17588
17589 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17590 tHalNvImgDownloadRspParams halNvDownloadRsp;
17591 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17592
17593 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017594 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017595 -------------------------------------------------------------------------*/
17596 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17597 ( NULL == pEventData->pEventData))
17598 {
17599 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17600 "%s: Invalid parameters", __FUNCTION__);
17601 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017602 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017603 }
17604
17605 /*-------------------------------------------------------------------------
17606 Extract response and send it to UMAC
17607 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017608 wpalMemoryCopy( &halNvDownloadRsp,
17609 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017610 sizeof(halNvDownloadRsp));
17611
17612 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17613
17614 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
Jeff Johnsone7245742012-09-05 17:12:55 -070017615 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17616 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
Jeff Johnson295189b2012-06-20 16:38:30 -070017617 {
17618 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
Jeff Johnsone7245742012-09-05 17:12:55 -070017619 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017620 }
17621 else
17622 {
17623 /*Reset the Nv related global information in WDI context information */
17624 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17625 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17626 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17627 /*call WDA callback function for last fragment */
17628 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17629 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17630 }
17631
Jeff Johnsone7245742012-09-05 17:12:55 -070017632 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017633}
17634#ifdef WLAN_FEATURE_VOWIFI_11R
17635/**
17636 @brief Process Add TSpec Rsp function (called when a response
17637 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017638
17639 @param pWDICtx: pointer to the WLAN DAL context
17640 pEventData: pointer to the event information structure
17641
Jeff Johnson295189b2012-06-20 16:38:30 -070017642 @see
17643 @return Result of the function call
17644*/
17645WDI_Status
17646WDI_ProcessAggrAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017647(
Jeff Johnson295189b2012-06-20 16:38:30 -070017648 WDI_ControlBlockType* pWDICtx,
17649 WDI_EventInfoType* pEventData
17650)
17651{
17652 WDI_Status wdiStatus;
17653 tAggrAddTsRspParams aggrAddTsRsp;
17654 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17655 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17656
17657 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017658 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017659 -------------------------------------------------------------------------*/
17660 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17661 ( NULL == pEventData->pEventData))
17662 {
17663 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17664 "%s: Invalid parameters", __FUNCTION__);
17665 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017666 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017667 }
17668
17669 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17670
17671 /*-------------------------------------------------------------------------
17672 Extract response and send it to UMAC
17673 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017674 wpalMemoryCopy( &aggrAddTsRsp,
17675 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017676 sizeof(aggrAddTsRsp));
17677
17678 /* What is the difference between status0 and status1? */
Jeff Johnsone7245742012-09-05 17:12:55 -070017679 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
Jeff Johnson295189b2012-06-20 16:38:30 -070017680
17681 /*Notify UMAC*/
17682 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17683
Jeff Johnsone7245742012-09-05 17:12:55 -070017684 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017685}/*WDI_ProcessAddTSpecRsp*/
17686#endif /* WLAN_FEATURE_VOWIFI_11R */
17687
17688/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017689 @brief WDI_ProcessHostResumeRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017690 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017691
17692 @param pWDICtx: pointer to the WLAN DAL context
17693 pEventData: pointer to the event information structure
17694
Jeff Johnson295189b2012-06-20 16:38:30 -070017695 @see
17696 @return Result of the function call
17697*/
17698WDI_Status
17699WDI_ProcessHostResumeRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017700(
Jeff Johnson295189b2012-06-20 16:38:30 -070017701 WDI_ControlBlockType* pWDICtx,
17702 WDI_EventInfoType* pEventData
17703)
17704{
17705 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17706 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17707 tHalHostResumeRspParams hostResumeRspMsg;
17708 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17709
17710 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017711 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017712 -------------------------------------------------------------------------*/
17713 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17714 ( NULL == pEventData->pEventData))
17715 {
17716 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17717 "%s: Invalid parameters", __FUNCTION__);
17718 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017719 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017720 }
17721
17722 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17723
17724 /*-------------------------------------------------------------------------
17725 Extract response and send it to UMAC
17726 -------------------------------------------------------------------------*/
17727
Jeff Johnsone7245742012-09-05 17:12:55 -070017728 wpalMemoryCopy( &hostResumeRspMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -070017729 (wpt_uint8*)pEventData->pEventData,
17730 sizeof(hostResumeRspMsg));
17731
Jeff Johnsone7245742012-09-05 17:12:55 -070017732 wdiResumeRspParams.wdiStatus =
17733 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070017734
17735 /*Notify UMAC*/
17736 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17737
17738 return WDI_STATUS_SUCCESS;
17739}
17740
17741/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017742 @brief Process Set Tx PER Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017743 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017744
17745 @param pWDICtx: pointer to the WLAN DAL context
17746 pEventData: pointer to the event information structure
17747
Jeff Johnson295189b2012-06-20 16:38:30 -070017748 @see
17749 @return Result of the function call
17750*/
17751WDI_Status
17752WDI_ProcessSetTxPerTrackingRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017753(
Jeff Johnson295189b2012-06-20 16:38:30 -070017754 WDI_ControlBlockType* pWDICtx,
17755 WDI_EventInfoType* pEventData
17756)
17757{
17758 WDI_Status wdiStatus;
17759 eHalStatus halStatus;
17760 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17761 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17762
17763 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017764 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017765 -------------------------------------------------------------------------*/
17766 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17767 ( NULL == pEventData->pEventData))
17768 {
17769 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17770 "%s: Invalid parameters", __FUNCTION__);
17771 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017772 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017773 }
Jeff Johnsone7245742012-09-05 17:12:55 -070017774
17775 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070017776
17777 /*-------------------------------------------------------------------------
17778 Extract response and send it to UMAC
17779 -------------------------------------------------------------------------*/
17780 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017781 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017782
17783 /*Notify UMAC*/
17784 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17785
Jeff Johnsone7245742012-09-05 17:12:55 -070017786 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017787}/*WDI_ProcessSetTxPerTrackingRsp*/
17788
17789/*==========================================================================
17790 Indications from HAL
17791 ==========================================================================*/
17792/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017793 @brief Process Low RSSI Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070017794 indication of this kind is being received over the bus
17795 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017796
17797 @param pWDICtx: pointer to the WLAN DAL context
17798 pEventData: pointer to the event information structure
17799
Jeff Johnson295189b2012-06-20 16:38:30 -070017800 @see
17801 @return Result of the function call
17802*/
17803WDI_Status
17804WDI_ProcessLowRSSIInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017805(
Jeff Johnson295189b2012-06-20 16:38:30 -070017806 WDI_ControlBlockType* pWDICtx,
17807 WDI_EventInfoType* pEventData
17808)
17809{
17810 WDI_LowLevelIndType wdiInd;
17811 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
17812 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17813
17814 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017815 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017816 -------------------------------------------------------------------------*/
17817 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17818 ( NULL == pEventData->pEventData))
17819 {
17820 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17821 "%s: Invalid parameters", __FUNCTION__);
17822 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017823 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017824 }
17825
17826 /*-------------------------------------------------------------------------
17827 Extract indication and send it to UMAC
17828 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017829 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
17830 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017831 sizeof(tHalRSSINotification));
17832
17833 /*Fill in the indication parameters*/
17834 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
17835 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
17836 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
17837 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
17838 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
17839 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
17840 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
17841 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
17842 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
17843 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
17844 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
17845 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
17846 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
17847
17848 /*Notify UMAC*/
17849 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017850
17851 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017852}/*WDI_ProcessLowRSSIInd*/
17853
17854
17855/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017856 @brief Process Missed Beacon Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070017857 an indication of this kind is being received over the
17858 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017859
17860 @param pWDICtx: pointer to the WLAN DAL context
17861 pEventData: pointer to the event information structure
17862
Jeff Johnson295189b2012-06-20 16:38:30 -070017863 @see
17864 @return Result of the function call
17865*/
17866WDI_Status
17867WDI_ProcessMissedBeaconInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017868(
Jeff Johnson295189b2012-06-20 16:38:30 -070017869 WDI_ControlBlockType* pWDICtx,
17870 WDI_EventInfoType* pEventData
17871)
17872{
17873 WDI_Status wdiStatus;
17874 eHalStatus halStatus;
17875 WDI_LowLevelIndType wdiInd;
17876 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17877
17878 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017879 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017880 -------------------------------------------------------------------------*/
17881 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17882 ( NULL == pEventData->pEventData))
17883 {
17884 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17885 "%s: Invalid parameters", __FUNCTION__);
17886 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017887 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017888 }
17889
17890 /*-------------------------------------------------------------------------
17891 Extract indication and send it to UMAC
17892 -------------------------------------------------------------------------*/
17893 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17894 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017895 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017896
17897 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017898 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
17899
Jeff Johnson295189b2012-06-20 16:38:30 -070017900 /*Notify UMAC*/
17901 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017902
17903 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017904}/*WDI_ProcessMissedBeaconInd*/
17905
17906
17907/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017908 @brief Process Unk Addr Frame Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070017909 an indication of this kind is being received over the
17910 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017911
17912 @param pWDICtx: pointer to the WLAN DAL context
17913 pEventData: pointer to the event information structure
17914
Jeff Johnson295189b2012-06-20 16:38:30 -070017915 @see
17916 @return Result of the function call
17917*/
17918WDI_Status
17919WDI_ProcessUnkAddrFrameInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017920(
Jeff Johnson295189b2012-06-20 16:38:30 -070017921 WDI_ControlBlockType* pWDICtx,
17922 WDI_EventInfoType* pEventData
17923)
17924{
17925 WDI_Status wdiStatus;
17926 eHalStatus halStatus;
17927 WDI_LowLevelIndType wdiInd;
17928 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17929
17930 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017931 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017932 -------------------------------------------------------------------------*/
17933 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17934 ( NULL == pEventData->pEventData))
17935 {
17936 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17937 "%s: Invalid parameters", __FUNCTION__);
17938 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017939 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017940 }
17941
17942 /*-------------------------------------------------------------------------
17943 Extract indication and send it to UMAC
17944 -------------------------------------------------------------------------*/
17945 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
17946 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017947 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017948
17949 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017950 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070017951 /* ! TO DO - fill in from HAL struct:
17952 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
17953
17954 /*Notify UMAC*/
17955 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070017956
17957 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017958}/*WDI_ProcessUnkAddrFrameInd*/
17959
17960
17961/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017962 @brief Process MIC Failure Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070017963 indication of this kind is being received over the bus
17964 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017965
17966 @param pWDICtx: pointer to the WLAN DAL context
17967 pEventData: pointer to the event information structure
17968
Jeff Johnson295189b2012-06-20 16:38:30 -070017969 @see
17970 @return Result of the function call
17971*/
17972WDI_Status
17973WDI_ProcessMicFailureInd
Jeff Johnsone7245742012-09-05 17:12:55 -070017974(
Jeff Johnson295189b2012-06-20 16:38:30 -070017975 WDI_ControlBlockType* pWDICtx,
17976 WDI_EventInfoType* pEventData
17977)
17978{
17979 WDI_LowLevelIndType wdiInd;
17980 tpSirMicFailureInd pHalMicFailureInd;
17981
17982 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17983
17984 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017985 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017986 -------------------------------------------------------------------------*/
17987 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17988 ( NULL == pEventData->pEventData))
17989 {
17990 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17991 "%s: Invalid parameters", __FUNCTION__);
17992 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017993 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017994 }
Jeff Johnsone7245742012-09-05 17:12:55 -070017995
Jeff Johnson295189b2012-06-20 16:38:30 -070017996 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
17997 /*-------------------------------------------------------------------------
17998 Extract indication and send it to UMAC
17999 -------------------------------------------------------------------------*/
18000
18001 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018002 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018003 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
18004 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
18005 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
18006 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
18007 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
18008 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
18009 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
18010 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070018011 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
Jeff Johnson295189b2012-06-20 16:38:30 -070018012 pHalMicFailureInd->info.multicast;
Jeff Johnsone7245742012-09-05 17:12:55 -070018013 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018014 pHalMicFailureInd->info.IV1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018015 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
Jeff Johnson295189b2012-06-20 16:38:30 -070018016 pHalMicFailureInd->info.keyId;
18017 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
18018 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
18019 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
18020 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
18021 /*Notify UMAC*/
18022 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018023
18024 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018025}/*WDI_ProcessMicFailureInd*/
18026
18027
18028/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018029 @brief Process Fatal Failure Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018030 an indication of this kind is being received over the
18031 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018032
18033 @param pWDICtx: pointer to the WLAN DAL context
18034 pEventData: pointer to the event information structure
18035
Jeff Johnson295189b2012-06-20 16:38:30 -070018036 @see
18037 @return Result of the function call
18038*/
18039WDI_Status
18040WDI_ProcessFatalErrorInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018041(
Jeff Johnson295189b2012-06-20 16:38:30 -070018042 WDI_ControlBlockType* pWDICtx,
18043 WDI_EventInfoType* pEventData
18044)
18045{
18046 WDI_Status wdiStatus;
18047 eHalStatus halStatus;
18048 WDI_LowLevelIndType wdiInd;
18049 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18050
18051 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018052 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018053 -------------------------------------------------------------------------*/
18054 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18055 ( NULL == pEventData->pEventData))
18056 {
18057 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18058 "%s: Invalid parameters", __FUNCTION__);
18059 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018060 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018061 }
18062
18063 /*-------------------------------------------------------------------------
18064 Extract indication and send it to UMAC
18065 -------------------------------------------------------------------------*/
18066
18067 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18068 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018069 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018070
18071 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18072 "Fatal failure received from device %d ", halStatus );
Jeff Johnsone7245742012-09-05 17:12:55 -070018073
Jeff Johnson295189b2012-06-20 16:38:30 -070018074 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018075 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18076 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018077
18078 /*Notify UMAC*/
18079 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018080
18081 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018082}/*WDI_ProcessFatalErrorInd*/
18083
18084/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018085 @brief Process Delete STA Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018086 an indication of this kind is being received over the
18087 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018088
18089 @param pWDICtx: pointer to the WLAN DAL context
18090 pEventData: pointer to the event information structure
18091
Jeff Johnson295189b2012-06-20 16:38:30 -070018092 @see
18093 @return Result of the function call
18094*/
18095WDI_Status
18096WDI_ProcessDelSTAInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018097(
Jeff Johnson295189b2012-06-20 16:38:30 -070018098 WDI_ControlBlockType* pWDICtx,
18099 WDI_EventInfoType* pEventData
18100)
18101{
18102 tDeleteStaContextParams halDelSTACtx;
18103 WDI_LowLevelIndType wdiInd;
18104 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18105
18106 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018107 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018108 -------------------------------------------------------------------------*/
18109 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18110 ( NULL == pEventData->pEventData))
18111 {
18112 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18113 "%s: Invalid parameters", __FUNCTION__);
18114 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018115 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018116 }
18117
18118 /*-------------------------------------------------------------------------
18119 Extract indication and send it to UMAC
18120 -------------------------------------------------------------------------*/
18121
18122 /* Parameters need to be unpacked according to HAL struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018123 wpalMemoryCopy( &halDelSTACtx,
18124 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018125 sizeof(halDelSTACtx));
18126
18127 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018128 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018129
18130 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
18131 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
18132 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
18133 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
18134
Jeff Johnsone7245742012-09-05 17:12:55 -070018135 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
Jeff Johnson295189b2012-06-20 16:38:30 -070018136 halDelSTACtx.assocId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018137 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070018138 halDelSTACtx.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018139 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
18140 halDelSTACtx.reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070018141
18142 /*Notify UMAC*/
18143 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018144
18145 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018146}/*WDI_ProcessDelSTAInd*/
18147
18148/**
18149*@brief Process Coex Indication function (called when
18150 an indication of this kind is being received over the
18151 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018152
18153 @param pWDICtx: pointer to the WLAN DAL context
18154 pEventData: pointer to the event information structure
18155
Jeff Johnson295189b2012-06-20 16:38:30 -070018156 @see
18157 @return Result of the function call
18158*/
18159WDI_Status
18160WDI_ProcessCoexInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018161(
Jeff Johnson295189b2012-06-20 16:38:30 -070018162 WDI_ControlBlockType* pWDICtx,
18163 WDI_EventInfoType* pEventData
18164)
18165{
18166 WDI_LowLevelIndType wdiInd;
18167 tCoexIndMsg halCoexIndMsg;
18168 wpt_uint32 index;
18169 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18170
18171 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018172 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018173 -------------------------------------------------------------------------*/
18174 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18175 ( NULL == pEventData->pEventData ))
18176 {
18177 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18178 "%s: Invalid parameters", __FUNCTION__);
18179 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070018180 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018181 }
18182
18183 /*-------------------------------------------------------------------------
18184 Extract indication and send it to UMAC
18185 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018186 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
18187 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018188 sizeof(halCoexIndMsg.coexIndParams) );
18189
18190 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018191 wdiInd.wdiIndicationType = WDI_COEX_IND;
18192 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
Jeff Johnson295189b2012-06-20 16:38:30 -070018193 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
18194 {
Jeff Johnsone7245742012-09-05 17:12:55 -070018195 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
Jeff Johnson295189b2012-06-20 16:38:30 -070018196 }
18197
18198 // DEBUG
18199 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18200 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
Jeff Johnsone7245742012-09-05 17:12:55 -070018201 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
18202 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
18203 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
18204 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
18205 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -070018206
18207 /*Notify UMAC*/
18208 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018209
18210 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018211}/*WDI_ProcessCoexInd*/
18212
18213/**
18214*@brief Process Tx Complete Indication function (called when
18215 an indication of this kind is being received over the
18216 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018217
18218 @param pWDICtx: pointer to the WLAN DAL context
18219 pEventData: pointer to the event information structure
18220
Jeff Johnson295189b2012-06-20 16:38:30 -070018221 @see
18222 @return Result of the function call
18223*/
18224WDI_Status
18225WDI_ProcessTxCompleteInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018226(
Jeff Johnson295189b2012-06-20 16:38:30 -070018227 WDI_ControlBlockType* pWDICtx,
18228 WDI_EventInfoType* pEventData
18229)
18230{
18231 WDI_LowLevelIndType wdiInd;
18232 tTxComplIndMsg halTxComplIndMsg;
18233 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18234
18235 /*-------------------------------------------------------------------------
18236 Sanity check
18237 -------------------------------------------------------------------------*/
18238 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18239 ( NULL == pEventData->pEventData ))
18240 {
18241 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18242 "%s: Invalid parameters", __FUNCTION__);
18243 WDI_ASSERT( 0 );
18244 return WDI_STATUS_E_FAILURE;
18245 }
18246
18247 /*-------------------------------------------------------------------------
18248 Extract indication and send it to UMAC
18249 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018250 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
18251 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018252 sizeof(halTxComplIndMsg.txComplParams) );
18253
18254 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018255 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
18256 wdiInd.wdiIndicationData.tx_complete_status
18257 = halTxComplIndMsg.txComplParams.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070018258
18259 /*Notify UMAC*/
18260 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018261
18262 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018263}/*WDI_ProcessTxCompleteInd*/
18264
18265#ifdef WLAN_FEATURE_P2P
18266/**
18267*@brief Process Noa Attr Indication function (called when
18268 an indication of this kind is being received over the
18269 bus from HAL)
18270
18271 @param pWDICtx: pointer to the WLAN DAL context
18272 pEventData: pointer to the event information structure
18273
18274 @see
18275 @return Result of the function call
18276*/
18277WDI_Status
18278WDI_ProcessP2pNoaAttrInd
18279(
18280 WDI_ControlBlockType* pWDICtx,
18281 WDI_EventInfoType* pEventData
18282)
18283{
18284 WDI_LowLevelIndType wdiInd;
18285 tNoaAttrIndMsg halNoaAttrIndMsg;
18286 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18287
18288 /*-------------------------------------------------------------------------
18289 Sanity check
18290 -------------------------------------------------------------------------*/
18291 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18292 ( NULL == pEventData->pEventData ))
18293 {
18294 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18295 "%s: Invalid parameters", __FUNCTION__);
18296 WDI_ASSERT( 0 );
18297 return WDI_STATUS_E_FAILURE;
18298 }
18299
18300 /*-------------------------------------------------------------------------
18301 Extract indication and send it to UMAC
18302 -------------------------------------------------------------------------*/
18303 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
18304 pEventData->pEventData,
18305 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
18306
18307 /*Fill in the indication parameters*/
18308 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -070018309
Jeff Johnson295189b2012-06-20 16:38:30 -070018310 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
18311 = halNoaAttrIndMsg.noaAttrIndParams.status;
Jeff Johnsone7245742012-09-05 17:12:55 -070018312
Jeff Johnson295189b2012-06-20 16:38:30 -070018313 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
18314 = halNoaAttrIndMsg.noaAttrIndParams.index;
18315 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
18316 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
18317 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
18318 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
Jeff Johnsone7245742012-09-05 17:12:55 -070018319
Jeff Johnson295189b2012-06-20 16:38:30 -070018320 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
18321 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
18322 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
18323 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
18324 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
18325 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
18326 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
18327 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070018328
Jeff Johnson295189b2012-06-20 16:38:30 -070018329 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
18330 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
18331 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
18332 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
18333 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
18334 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
18335 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
18336 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
18337
18338 /*Notify UMAC*/
18339 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18340
18341 return WDI_STATUS_SUCCESS;
18342}/*WDI_ProcessNoaAttrInd*/
18343#endif
18344
18345/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018346 @brief Process Tx PER Hit Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018347 an indication of this kind is being received over the
18348 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018349
18350 @param pWDICtx: pointer to the WLAN DAL context
18351 pEventData: pointer to the event information structure
18352
Jeff Johnson295189b2012-06-20 16:38:30 -070018353 @see
18354 @return Result of the function call
18355*/
18356WDI_Status
18357WDI_ProcessTxPerHitInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018358(
Jeff Johnson295189b2012-06-20 16:38:30 -070018359 WDI_ControlBlockType* pWDICtx,
18360 WDI_EventInfoType* pEventData
18361)
18362{
18363 WDI_LowLevelIndType wdiInd;
18364 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070018365
Jeff Johnson295189b2012-06-20 16:38:30 -070018366 /*-------------------------------------------------------------------------
18367 Extract indication and send it to UMAC
18368 -------------------------------------------------------------------------*/
18369 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018370 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18371
Jeff Johnson295189b2012-06-20 16:38:30 -070018372 /*Notify UMAC*/
18373 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18374
Jeff Johnsone7245742012-09-05 17:12:55 -070018375 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018376}/*WDI_ProcessTxPerHitInd*/
18377
18378#ifdef ANI_MANF_DIAG
18379/**
18380 @brief WDI_ProcessFTMCommandReq
18381 Process FTM Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018382
18383 @param pWDICtx: pointer to the WLAN DAL context
18384 pEventData: pointer to the event information structure
18385
Jeff Johnson295189b2012-06-20 16:38:30 -070018386 @see
18387 @return Result of the function call
18388*/
18389WDI_Status
18390WDI_ProcessFTMCommandReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018391(
Jeff Johnson295189b2012-06-20 16:38:30 -070018392 WDI_ControlBlockType* pWDICtx,
18393 WDI_EventInfoType* pEventData
18394)
18395{
18396 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18397 wpt_uint8 *ftmCommandBuffer = NULL;
18398 wpt_uint16 dataOffset;
18399 wpt_uint16 bufferSize;
18400 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018401 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018402 -------------------------------------------------------------------------*/
18403 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18404 ( NULL == pEventData->pEventData))
18405
18406 {
18407 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18408 "%s: Invalid parameters", __FUNCTION__);
18409 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018410 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018411 }
18412
18413 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18414
18415 /* Get MSG Buffer */
18416 WDI_GetMessageBuffer(pWDICtx,
18417 WDI_FTM_CMD_REQ,
18418 ftmCommandReq->bodyLength,
18419 &ftmCommandBuffer,
18420 &dataOffset,
18421 &bufferSize);
18422
18423 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18424 ftmCommandReq->FTMCommandBody,
18425 ftmCommandReq->bodyLength);
18426
18427 /* Send MSG */
18428 return WDI_SendMsg(pWDICtx,
18429 ftmCommandBuffer,
18430 bufferSize,
18431 pEventData->pCBfnc,
18432 pEventData->pUserData,
18433 WDI_FTM_CMD_RESP);
18434}
18435
18436/**
18437 @brief WDI_ProcessFTMCommandRsp
18438 Process FTM Command Response from HAL, simply route to HDD FTM
Jeff Johnsone7245742012-09-05 17:12:55 -070018439
18440 @param pWDICtx: pointer to the WLAN DAL context
18441 pEventData: pointer to the event information structure
18442
Jeff Johnson295189b2012-06-20 16:38:30 -070018443 @see
18444 @return Result of the function call
18445*/
18446WDI_Status
18447WDI_ProcessFTMCommandRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018448(
Jeff Johnson295189b2012-06-20 16:38:30 -070018449 WDI_ControlBlockType* pWDICtx,
18450 WDI_EventInfoType* pEventData
18451)
18452{
18453 WDI_FTMCommandRspCb ftmCMDRspCb;
18454 tProcessPttRspParams *ftmCMDRspData = NULL;
18455 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18456
18457 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018458 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018459 -------------------------------------------------------------------------*/
18460 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18461 ( NULL == pEventData->pEventData))
18462 {
18463 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18464 "%s: Invalid parameters", __FUNCTION__);
18465 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018466 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018467 }
18468
18469 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18470
18471 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18472
Jeff Johnsone7245742012-09-05 17:12:55 -070018473 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18474 (void *)&ftmCMDRspData->pttMsgBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018475 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18476
18477 /*Notify UMAC*/
18478 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18479
Jeff Johnsone7245742012-09-05 17:12:55 -070018480 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018481}
18482#endif /* ANI_MANF_DIAG */
18483/**
18484 @brief WDI_ProcessHalDumpCmdReq
18485 Process hal dump Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018486
18487 @param pWDICtx: pointer to the WLAN DAL context
18488 pEventData: pointer to the event information structure
18489
Jeff Johnson295189b2012-06-20 16:38:30 -070018490 @see
18491 @return Result of the function call
18492*/
18493WDI_Status
18494WDI_ProcessHALDumpCmdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018495(
Jeff Johnson295189b2012-06-20 16:38:30 -070018496 WDI_ControlBlockType* pWDICtx,
18497 WDI_EventInfoType* pEventData
18498)
18499{
18500 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18501 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18502 wpt_uint16 usDataOffset = 0;
18503 wpt_uint16 usSendSize = 0;
18504 tHalDumpCmdReqMsg halDumpCmdReqMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070018505 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070018506
18507 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018508 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018509 -------------------------------------------------------------------------*/
18510 if (( NULL == pEventData ) ||
18511 ( NULL == pEventData->pEventData) ||
18512 ( NULL == pEventData->pCBfnc ))
18513 {
18514 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18515 "%s: Invalid parameters", __FUNCTION__);
18516 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018517 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018518 }
18519
18520 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18521 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18522
18523 /* Copying the HAL DUMP Command Information HAL Structure*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018524 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018525 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
Jeff Johnsone7245742012-09-05 17:12:55 -070018526 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018527 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018528 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018529 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
Jeff Johnsone7245742012-09-05 17:12:55 -070018530 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018531 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
Jeff Johnsone7245742012-09-05 17:12:55 -070018532 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018533 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
Jeff Johnsone7245742012-09-05 17:12:55 -070018534
Jeff Johnson295189b2012-06-20 16:38:30 -070018535 /*-----------------------------------------------------------------------
18536 Get message buffer
18537 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018538 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070018539 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18540 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070018541 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070018542 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18543 {
18544 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18545 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18546 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18547 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018548 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018549 }
18550
Jeff Johnsone7245742012-09-05 17:12:55 -070018551 wpalMemoryCopy( pSendBuffer+usDataOffset,
18552 &halDumpCmdReqMsg.dumpCmdReqParams,
18553 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070018554
18555 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070018556 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018557
18558 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018559 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018560 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018561 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18562 wdiHALDumpCmdRspCb, pEventData->pUserData,
18563 WDI_HAL_DUMP_CMD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070018564}
18565
18566/**
18567 @brief WDI_ProcessHalDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018568 Process hal Dump Command Response from HAL, simply route to HDD
18569
18570 @param pWDICtx: pointer to the WLAN DAL context
18571 pEventData: pointer to the event information structure
18572
Jeff Johnson295189b2012-06-20 16:38:30 -070018573 @see
18574 @return Result of the function call
18575*/
18576WDI_Status
18577WDI_ProcessHALDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018578(
Jeff Johnson295189b2012-06-20 16:38:30 -070018579 WDI_ControlBlockType* pWDICtx,
18580 WDI_EventInfoType* pEventData
18581)
18582{
18583 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18584 tpHalDumpCmdRspParams halDumpCmdRspParams;
18585 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18586
18587 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018588 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018589 -------------------------------------------------------------------------*/
18590 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18591 ( NULL == pEventData->pEventData))
18592 {
18593 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18594 "%s: Invalid parameters", __FUNCTION__);
18595 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018596 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018597 }
18598
Jeff Johnsone7245742012-09-05 17:12:55 -070018599 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070018600
18601 /*Initialize the WDI Response structure */
18602 wdiHALDumpCmdRsp.usBufferLen = 0;
18603 wdiHALDumpCmdRsp.pBuffer = NULL;
18604
18605 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018606
18607 wdiHALDumpCmdRsp.wdiStatus =
18608 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
Jeff Johnson295189b2012-06-20 16:38:30 -070018609
18610 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18611 (halDumpCmdRspParams->rspLength != 0))
18612 {
18613 /* Copy the response data */
18614 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18615 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
Jeff Johnsone7245742012-09-05 17:12:55 -070018616 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18617 wdiHALDumpCmdRsp.pBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018618 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18619 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018620
Jeff Johnson295189b2012-06-20 16:38:30 -070018621 /*Notify UMAC*/
18622 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18623
18624 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18625 {
18626 /* Free the allocated buffer */
18627 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18628 }
18629 return WDI_STATUS_SUCCESS;
18630}
18631
18632/*==========================================================================
18633 CONTRL TRANSPORT INTERACTION
Jeff Johnsone7245742012-09-05 17:12:55 -070018634
Jeff Johnson295189b2012-06-20 16:38:30 -070018635 Callback function registered with the control transport - for receiving
Jeff Johnsone7245742012-09-05 17:12:55 -070018636 notifications and packets
Jeff Johnson295189b2012-06-20 16:38:30 -070018637==========================================================================*/
18638/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018639 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018640 when it wishes to send up a notification like the ones
18641 mentioned above.
Jeff Johnsone7245742012-09-05 17:12:55 -070018642
Jeff Johnson295189b2012-06-20 16:38:30 -070018643 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018644
18645 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018646 wctsEvent: the event being notified
Jeff Johnsone7245742012-09-05 17:12:55 -070018647 wctsNotifyCBData: the callback data of the user
18648
Jeff Johnson295189b2012-06-20 16:38:30 -070018649 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018650
18651 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018652*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018653void
Jeff Johnson295189b2012-06-20 16:38:30 -070018654WDI_NotifyMsgCTSCB
18655(
Jeff Johnsone7245742012-09-05 17:12:55 -070018656 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018657 WCTS_NotifyEventType wctsEvent,
18658 void* wctsNotifyCBData
18659)
18660{
Jeff Johnsone7245742012-09-05 17:12:55 -070018661 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018662 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18663
18664 if (NULL == pWDICtx )
18665 {
18666 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18667 "%s: Invalid parameters", __FUNCTION__);
18668 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018669 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018670 }
18671
18672 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18673 {
18674 /* callback presumably occurred after close */
18675 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18676 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018677 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018678 }
18679
18680 if ( WCTS_EVENT_OPEN == wctsEvent )
18681 {
18682 /*Flag must be set atomically as it is checked from incoming request
18683 functions*/
18684 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018685 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018686
18687 /*Nothing to do - so try to dequeue any pending request that may have
18688 occurred while we were trying to establish this*/
18689 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070018690 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnson295189b2012-06-20 16:38:30 -070018691 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018692 else if ( WCTS_EVENT_CLOSE == wctsEvent )
Jeff Johnson295189b2012-06-20 16:38:30 -070018693 {
18694 /*Flag must be set atomically as it is checked from incoming request
18695 functions*/
18696 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018697 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018698
18699 /*No other request will be processed from now on - fail all*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018700 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070018701 wpalMutexRelease(&pWDICtx->wptMutex);
18702
18703 /*Notify that the Control Channel is closed */
18704 wpalEventSet(&pWDICtx->wctsActionEvent);
18705 }
18706
18707}/*WDI_NotifyMsgCTSCB*/
18708
18709
18710/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018711 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018712 when it wishes to send up a packet received over the
18713 bus.
Jeff Johnsone7245742012-09-05 17:12:55 -070018714
Jeff Johnson295189b2012-06-20 16:38:30 -070018715 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018716
18717 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018718 pMsg: the packet
18719 uLen: the packet length
Jeff Johnsone7245742012-09-05 17:12:55 -070018720 wctsRxMsgCBData: the callback data of the user
18721
Jeff Johnson295189b2012-06-20 16:38:30 -070018722 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018723
18724 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018725*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018726void
18727WDI_RXMsgCTSCB
Jeff Johnson295189b2012-06-20 16:38:30 -070018728(
Jeff Johnsone7245742012-09-05 17:12:55 -070018729 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018730 void* pMsg,
18731 wpt_uint32 uLen,
18732 void* wctsRxMsgCBData
18733)
18734{
Jeff Johnsone7245742012-09-05 17:12:55 -070018735 tHalMsgHeader *pHalMsgHeader;
18736 WDI_EventInfoType wdiEventData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018737 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18738 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18739
18740 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018741 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018742 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018743 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070018744 ( uLen < sizeof(tHalMsgHeader)))
18745 {
18746 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18747 "%s: Invalid parameters", __FUNCTION__);
18748 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018749 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018750 }
18751
18752 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18753 {
18754 /* callback presumably occurred after close */
18755 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18756 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018757 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018758 }
18759
Jeff Johnsone7245742012-09-05 17:12:55 -070018760 /*The RX Callback is expected to be serialized in the proper control thread
Jeff Johnson295189b2012-06-20 16:38:30 -070018761 context - so no serialization is necessary here
18762 ! - revisit this assumption */
18763
18764 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18765
18766 if ( uLen != pHalMsgHeader->msgLen )
18767 {
18768 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18769 "Invalid packet received from HAL - catastrophic failure");
Jeff Johnsone7245742012-09-05 17:12:55 -070018770 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18771 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018772 }
18773
18774 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18775
18776 /*The message itself starts after the header*/
18777 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18778 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18779 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18780 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18781
18782
18783 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
18784 {
18785 /*Stop the timer as the response was received */
18786 /*!UT - check for potential race conditions between stop and response */
18787 wpalTimerStop(&pWDICtx->wptResponseTimer);
18788 }
18789 /* Check if we receive a response message which is not expected */
18790 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
18791 {
18792 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
18793 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
18794 WDI_getRespMsgString(wdiEventData.wdiResponse),
Jeff Johnsone7245742012-09-05 17:12:55 -070018795 wdiEventData.wdiResponse,
Jeff Johnson295189b2012-06-20 16:38:30 -070018796 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
18797 pWDICtx->wdiExpectedResponse);
18798 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
18799 return;
18800 }
18801
18802 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18803 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
18804
18805 /*Post response event to the state machine*/
18806 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
18807
18808}/*WDI_RXMsgCTSCB*/
18809
18810
18811/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070018812 Internal Helper Routines
Jeff Johnson295189b2012-06-20 16:38:30 -070018813========================================================================*/
18814
18815/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018816 @brief WDI_CleanCB - internal helper routine used to clean the
Jeff Johnson295189b2012-06-20 16:38:30 -070018817 WDI Main Control Block
Jeff Johnsone7245742012-09-05 17:12:55 -070018818
Jeff Johnson295189b2012-06-20 16:38:30 -070018819 @param pWDICtx - pointer to the control block
18820
18821 @return Result of the function call
18822*/
18823WPT_INLINE WDI_Status
18824WDI_CleanCB
18825(
18826 WDI_ControlBlockType* pWDICtx
18827)
18828{
18829 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18830
18831 /*Clean the WDI Control Block*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018832 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
Jeff Johnson295189b2012-06-20 16:38:30 -070018833
Jeff Johnsone7245742012-09-05 17:12:55 -070018834 pWDICtx->uGlobalState = WDI_MAX_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070018835 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
18836 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
18837
18838 WDI_ResetAssocSessions( pWDICtx );
18839
18840 return WDI_STATUS_SUCCESS;
18841}/*WDI_CleanCB*/
18842
18843
18844/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018845 @brief Process request helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070018846
Jeff Johnsone7245742012-09-05 17:12:55 -070018847
18848 @param pWDICtx: pointer to the WLAN DAL context
18849 pEventData: pointer to the event information structure
18850
Jeff Johnson295189b2012-06-20 16:38:30 -070018851 @see
18852 @return Result of the function call
18853*/
18854WPT_INLINE WDI_Status
18855WDI_ProcessRequest
18856(
18857 WDI_ControlBlockType* pWDICtx,
18858 WDI_EventInfoType* pEventData
18859)
18860{
18861 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18862
Jeff Johnsone7245742012-09-05 17:12:55 -070018863 /*!! Skip sanity check as this is called from the FSM functionss which
Jeff Johnson295189b2012-06-20 16:38:30 -070018864 already checked these pointers*/
18865
18866 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
18867 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070018868 {
Jeff Johnson295189b2012-06-20 16:38:30 -070018869 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18870 "Calling request processing function for req %s (%d) %x",
18871 WDI_getReqMsgString(pEventData->wdiRequest),
18872 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
18873 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
18874 }
18875 else
18876 {
18877 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070018878 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070018879 pEventData->wdiRequest);
18880 return WDI_STATUS_E_NOT_IMPLEMENT;
18881 }
18882}/*WDI_ProcessRequest*/
18883
18884
18885/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018886 @brief Get message helper function - it allocates memory for a
Jeff Johnson295189b2012-06-20 16:38:30 -070018887 message that is to be sent to HAL accross the bus and
Jeff Johnsone7245742012-09-05 17:12:55 -070018888 prefixes it with a send message header
18889
18890 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070018891 wdiReqType: type of the request being sent
18892 uBufferLen: message buffer len
18893 pMsgBuffer: resulting allocated buffer
18894 pusDataOffset: offset in the buffer where the caller
18895 can start copying its message data
18896 puBufferSize: the resulting buffer size (offset+buff
18897 len)
Jeff Johnsone7245742012-09-05 17:12:55 -070018898
Jeff Johnson295189b2012-06-20 16:38:30 -070018899 @see
18900 @return Result of the function call
18901*/
18902WDI_Status
18903WDI_GetMessageBuffer
Jeff Johnsone7245742012-09-05 17:12:55 -070018904(
18905 WDI_ControlBlockType* pWDICtx,
18906 WDI_RequestEnumType wdiReqType,
Jeff Johnson295189b2012-06-20 16:38:30 -070018907 wpt_uint16 usBufferLen,
Jeff Johnsone7245742012-09-05 17:12:55 -070018908 wpt_uint8** pMsgBuffer,
18909 wpt_uint16* pusDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070018910 wpt_uint16* pusBufferSize
18911)
18912{
18913 tHalMsgHeader halMsgHeader;
18914 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18915
Jeff Johnsone7245742012-09-05 17:12:55 -070018916 /*!! No sanity check here as we trust the called - ! check this assumption
Jeff Johnson295189b2012-06-20 16:38:30 -070018917 again*/
18918
18919 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018920 Try to allocate message buffer from PAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018921 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018922 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
Jeff Johnson295189b2012-06-20 16:38:30 -070018923 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
18924 if ( NULL == *pMsgBuffer )
18925 {
18926 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18927 "Unable to allocate message buffer for req %s (%d)",
18928 WDI_getReqMsgString(wdiReqType),
Jeff Johnsone7245742012-09-05 17:12:55 -070018929 wdiReqType);
Jeff Johnson295189b2012-06-20 16:38:30 -070018930 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018931 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018932 }
18933
18934 /*-------------------------------------------------------------------------
18935 Fill in the message header
18936 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018937 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
18938 /* Fill msgVersion */
18939#ifdef WLAN_FEATURE_11AC
18940 if (WDI_getFwWlanFeatCaps(DOT11AC))
18941 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1;
18942 else
18943#endif
18944 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0;
Jeff Johnson295189b2012-06-20 16:38:30 -070018945
Jeff Johnsone7245742012-09-05 17:12:55 -070018946 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
18947 *pusDataOffset = sizeof(halMsgHeader);
18948 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
18949
18950 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018951}/*WDI_GetMessageBuffer*/
18952
18953
18954/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018955 @brief Send message helper function - sends a message over the
Jeff Johnson295189b2012-06-20 16:38:30 -070018956 bus using the control tranport and saves some info in
Jeff Johnsone7245742012-09-05 17:12:55 -070018957 the CB
18958
18959 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070018960 pSendBuffer: buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070018961
Jeff Johnson295189b2012-06-20 16:38:30 -070018962 usSendSize size of the buffer to be sent
18963 pRspCb: response callback - save in the WDI
18964 CB
18965 pUserData: user data associated with the
18966 callback
18967 wdiExpectedResponse: the code of the response that is
18968 expected to be rx-ed for this request
Jeff Johnsone7245742012-09-05 17:12:55 -070018969
Jeff Johnson295189b2012-06-20 16:38:30 -070018970 @see
18971 @return Result of the function call
18972*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018973WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070018974WDI_SendMsg
Jeff Johnsone7245742012-09-05 17:12:55 -070018975(
18976 WDI_ControlBlockType* pWDICtx,
18977 wpt_uint8* pSendBuffer,
18978 wpt_uint32 usSendSize,
18979 void* pRspCb,
Jeff Johnson295189b2012-06-20 16:38:30 -070018980 void* pUserData,
18981 WDI_ResponseEnumType wdiExpectedResponse
18982)
18983{
Jeff Johnsond13512a2012-07-17 11:42:19 -070018984 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018985 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18986
18987 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018988 Save needed info in the CB
Jeff Johnson295189b2012-06-20 16:38:30 -070018989 ------------------------------------------------------------------------*/
18990 pWDICtx->pRspCBUserData = pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018991 pWDICtx->pfncRspCB = pRspCb;
18992 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070018993
18994 /*-----------------------------------------------------------------------
18995 Call the CTS to send this message over - free message afterwards
18996 - notify transport failure
18997 Note: CTS is reponsible for freeing the message buffer.
18998 -----------------------------------------------------------------------*/
18999 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
19000 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019001 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070019002 "Failed to send message over the bus - catastrophic failure");
19003
Jeff Johnsond13512a2012-07-17 11:42:19 -070019004 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019005 }
19006
Jeff Johnsond13512a2012-07-17 11:42:19 -070019007 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070019008 if ( NULL != pWDICtx->wdiReqStatusCB )
19009 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019010 /*Inform originator whether request went through or not*/
19011 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
19012 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070019013 pWDICtx->wdiReqStatusCB = NULL;
19014 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070019015 callback(wdiStatus, callbackContext);
19016
19017 /*For WDI requests which have registered a request callback,
19018 inform the WDA caller of the same via setting the return value
19019 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
19020 end up repeating the functonality in the req callback for the
19021 WDI_STATUS_E_FAILURE case*/
19022 if (wdiStatus == WDI_STATUS_E_FAILURE)
19023 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070019024 }
19025
Jeff Johnsond13512a2012-07-17 11:42:19 -070019026 if ( wdiStatus == WDI_STATUS_SUCCESS )
19027 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019028 /*Start timer for the expected response */
19029 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070019030 }
19031 else
19032 {
19033 /*Inform upper stack layers that a transport fatal error occured*/
19034 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19035 }
Jeff Johnson295189b2012-06-20 16:38:30 -070019036
Jeff Johnsond13512a2012-07-17 11:42:19 -070019037 return wdiStatus;
19038
Jeff Johnson295189b2012-06-20 16:38:30 -070019039}/*WDI_SendMsg*/
19040
19041
19042
19043/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019044 @brief Send indication helper function - sends a message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019045 the bus using the control transport and saves some info
19046 in the CB
Jeff Johnsone7245742012-09-05 17:12:55 -070019047
19048 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019049 pSendBuffer: buffer to be sent
19050 usSendSize: size of the buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019051
Jeff Johnson295189b2012-06-20 16:38:30 -070019052 @see
19053 @return Result of the function call
19054*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019055WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019056WDI_SendIndication
Jeff Johnsone7245742012-09-05 17:12:55 -070019057(
19058 WDI_ControlBlockType* pWDICtx,
19059 wpt_uint8* pSendBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070019060 wpt_uint32 usSendSize
19061)
19062{
19063 wpt_uint32 uStatus ;
19064 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19065
19066 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019067 Call the CTS to send this message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019068 Note: CTS is reponsible for freeing the message buffer.
19069 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019070 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070019071 (void*)pSendBuffer, usSendSize );
19072
19073 /*Inform Upper MAC about the outcome of the request*/
19074 if ( NULL != pWDICtx->wdiReqStatusCB )
19075 {
19076 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19077 "Send indication status : %d", uStatus);
19078
19079 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
Jeff Johnsone7245742012-09-05 17:12:55 -070019080 WDI_STATUS_SUCCESS,
19081 pWDICtx->pReqStatusUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070019082 }
19083
19084 /*If sending of the message failed - it is considered catastrophic and
19085 indicates an error with the device*/
19086 if ( 0 != uStatus)
19087 {
19088 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019089 "Failed to send indication over the bus - catastrophic failure");
Jeff Johnson295189b2012-06-20 16:38:30 -070019090
19091 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19092 return WDI_STATUS_E_FAILURE;
19093 }
19094
Jeff Johnsone7245742012-09-05 17:12:55 -070019095 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019096}/*WDI_SendIndication*/
19097
19098
19099/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019100 @brief WDI_DetectedDeviceError - called internally by DAL when
19101 it has detected a failure in the device
19102
19103 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019104 usErrorCode: error code detected by WDI or received
19105 from HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070019106
Jeff Johnson295189b2012-06-20 16:38:30 -070019107 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019108 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019109*/
19110void
19111WDI_DetectedDeviceError
19112(
19113 WDI_ControlBlockType* pWDICtx,
19114 wpt_uint16 usErrorCode
19115)
19116{
19117 WDI_LowLevelIndType wdiInd;
19118 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19119
19120 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19121 "Device Error detected code: %d - transitioning to stopped state",
19122 usErrorCode);
19123
19124 wpalMutexAcquire(&pWDICtx->wptMutex);
19125
19126 WDI_STATableStop(pWDICtx);
19127
19128 WDI_ResetAssocSessions(pWDICtx);
19129
19130 /*Set the expected state transition to stopped - because the device
19131 experienced a failure*/
19132 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
19133
19134 /*Transition to stopped to fail all incomming requests from this point on*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019135 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
Jeff Johnson295189b2012-06-20 16:38:30 -070019136
Jeff Johnsone7245742012-09-05 17:12:55 -070019137 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070019138
19139 /*TO DO: - there should be an attempt to reset the device here*/
19140
19141 wpalMutexRelease(&pWDICtx->wptMutex);
19142
19143 /*------------------------------------------------------------------------
19144 Notify UMAC if a handler is registered
19145 ------------------------------------------------------------------------*/
19146 if (pWDICtx->wdiLowLevelIndCB)
19147 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019148 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
19149 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019150
19151 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
19152 }
19153}/*WDI_DetectedDeviceError*/
19154
19155/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019156 @brief This callback is invoked by the wpt when a timer that
Jeff Johnson295189b2012-06-20 16:38:30 -070019157 we started on send message has expire - this should
19158 never happen - it means device is stuck and cannot
Jeff Johnsone7245742012-09-05 17:12:55 -070019159 reply - trigger catastrophic failure
19160 @param
19161
Jeff Johnson295189b2012-06-20 16:38:30 -070019162 pUserData: the callback data of the user (ptr to WDI CB)
Jeff Johnsone7245742012-09-05 17:12:55 -070019163
19164 @see
19165 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019166*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019167void
Jeff Johnson295189b2012-06-20 16:38:30 -070019168WDI_ResponseTimerCB
19169(
19170 void *pUserData
19171)
19172{
19173 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
19174 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19175
19176 if (NULL == pWDICtx )
19177 {
19178 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19179 "%s: Invalid parameters", __FUNCTION__);
19180 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019181 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019182 }
19183
19184 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
19185 {
19186
19187 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19188 "Timeout occurred while waiting for %s (%d) message from device "
Jeff Johnsone7245742012-09-05 17:12:55 -070019189 " - catastrophic failure",
Jeff Johnson295189b2012-06-20 16:38:30 -070019190 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19191 pWDICtx->wdiExpectedResponse);
19192 /* WDI timeout means Riva is not responding or SMD communication to Riva
19193 * is not happening. The only possible way to recover from this error
19194 * is to initiate SSR from APPS */
19195 wpalRivaSubystemRestart();
19196 }
19197 else
19198 {
19199 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19200 "Timeout occurred but not waiting for any response %d",
19201 pWDICtx->wdiExpectedResponse);
19202 }
19203
19204 return;
19205
19206}/*WDI_ResponseTimerCB*/
19207
19208
19209/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019210 @brief Process response helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019211
Jeff Johnsone7245742012-09-05 17:12:55 -070019212
19213 @param pWDICtx: pointer to the WLAN DAL context
19214 pEventData: pointer to the event information structure
19215
Jeff Johnson295189b2012-06-20 16:38:30 -070019216 @see
19217 @return Result of the function call
19218*/
19219WPT_INLINE WDI_Status
19220WDI_ProcessResponse
19221(
19222 WDI_ControlBlockType* pWDICtx,
19223 WDI_EventInfoType* pEventData
19224)
19225{
19226 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19227
Jeff Johnsone7245742012-09-05 17:12:55 -070019228 /* Skip sanity check as this is called from the FSM functions which
Jeff Johnson295189b2012-06-20 16:38:30 -070019229 already checked these pointers
19230 ! - revisit this assumption */
19231 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
19232 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019233 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019234 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070019235 "Calling response processing function for resp %s (%d) %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070019236 WDI_getRespMsgString(pEventData->wdiResponse),
19237 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
19238 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
19239 }
19240 else
19241 {
19242 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019243 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019244 pEventData->wdiResponse);
19245 return WDI_STATUS_E_NOT_IMPLEMENT;
19246 }
19247}/*WDI_ProcessResponse*/
19248
19249
19250/*=========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019251 QUEUE SUPPORT UTILITY FUNCTIONS
Jeff Johnson295189b2012-06-20 16:38:30 -070019252=========================================================================*/
19253
19254/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019255 @brief Utility function used by the DAL Core to help queue a
19256 request that cannot be processed right away.
19257 @param
19258
Jeff Johnson295189b2012-06-20 16:38:30 -070019259 pWDICtx: - pointer to the WDI control block
19260 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019261 queued
19262
19263 @see
19264 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019265*/
19266WDI_Status
19267WDI_QueuePendingReq
19268(
19269 WDI_ControlBlockType* pWDICtx,
19270 WDI_EventInfoType* pEventData
19271)
19272{
Jeff Johnsone7245742012-09-05 17:12:55 -070019273 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019274 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
Jeff Johnsone7245742012-09-05 17:12:55 -070019275 void* pEventInfo = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019276 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19277
19278 if ( NULL == pEventDataQueue )
19279 {
19280 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019281 "Cannot allocate memory for queueing");
Jeff Johnson295189b2012-06-20 16:38:30 -070019282 WDI_ASSERT(0);
19283 return WDI_STATUS_MEM_FAILURE;
19284 }
19285
19286 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19287 pEventDataQueue->pUserData = pEventData->pUserData;
19288 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19289 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019290 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019291
19292 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
19293 {
19294 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070019295
Jeff Johnson295189b2012-06-20 16:38:30 -070019296 if ( NULL == pEventInfo )
19297 {
19298 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019299 "Cannot allocate memory for queueing event data info");
Jeff Johnson295189b2012-06-20 16:38:30 -070019300 WDI_ASSERT(0);
19301 wpalMemoryFree(pEventDataQueue);
19302 return WDI_STATUS_MEM_FAILURE;
19303 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019304
Jeff Johnson295189b2012-06-20 16:38:30 -070019305 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19306
19307 }
19308 pEventDataQueue->pEventData = pEventInfo;
19309
19310 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019311 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019312
Jeff Johnsone7245742012-09-05 17:12:55 -070019313 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019314
19315 return WDI_STATUS_SUCCESS;
19316}/*WDI_QueuePendingReq*/
19317
19318/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019319 @brief Callback function for serializing queued message
Jeff Johnson295189b2012-06-20 16:38:30 -070019320 processing in the control context
Jeff Johnsone7245742012-09-05 17:12:55 -070019321 @param
19322
19323 pMsg - pointer to the message
19324
19325 @see
19326 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019327*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019328void
Jeff Johnson295189b2012-06-20 16:38:30 -070019329WDI_PALCtrlMsgCB
19330(
19331 wpt_msg *pMsg
19332)
19333{
19334 WDI_EventInfoType* pEventData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019335 WDI_ControlBlockType* pWDICtx = NULL;
19336 WDI_Status wdiStatus;
19337 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019338 void* pUserData;
19339 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19340
19341 if (( NULL == pMsg )||
19342 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
19343 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
19344 {
19345 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019346 "Invalid message received on serialize ctrl context API");
Jeff Johnson295189b2012-06-20 16:38:30 -070019347 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019348 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019349 }
19350
19351 /*Transition back to the state that we had before serialization
19352 - serialization transitions us to BUSY to stop any incomming requests
19353 ! TO DO L: possible race condition here if a request comes in between the
19354 state transition and the post function*/
19355
Jeff Johnsone7245742012-09-05 17:12:55 -070019356 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
Jeff Johnson295189b2012-06-20 16:38:30 -070019357
19358 /*-----------------------------------------------------------------------
19359 Check to see what type of event we are serializing
Jeff Johnsone7245742012-09-05 17:12:55 -070019360 - responses are never expected to come through here
Jeff Johnson295189b2012-06-20 16:38:30 -070019361 -----------------------------------------------------------------------*/
19362 switch ( pEventData->wdiRequest )
19363 {
19364
Jeff Johnsone7245742012-09-05 17:12:55 -070019365 case WDI_STOP_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -070019366 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19367 break;
19368
Jeff Johnson295189b2012-06-20 16:38:30 -070019369 case WDI_NV_DOWNLOAD_REQ:
19370 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19371 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19372 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19373 {
19374 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19375 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19376 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19377 }
19378 else
19379 {
19380 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19381 }
19382
19383 break;
19384
19385 default:
19386 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19387 break;
19388 }/*switch ( pEventData->wdiRequest )*/
19389
19390 if ( WDI_STATUS_SUCCESS != wdiStatus )
19391 {
19392 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19393
19394 if ( NULL != pfnReqStatusCB )
19395 {
19396 /*Fail the request*/
19397 pfnReqStatusCB( wdiStatus, pUserData);
19398 }
19399 }
19400
19401 /* Free data - that was allocated when queueing*/
19402 if( pEventData != NULL )
19403 {
19404 if( pEventData->pEventData != NULL )
19405 {
19406 wpalMemoryFree(pEventData->pEventData);
19407 }
19408 wpalMemoryFree(pEventData);
19409 }
19410
19411 if( pMsg != NULL )
19412 {
19413 wpalMemoryFree(pMsg);
19414 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019415
Jeff Johnson295189b2012-06-20 16:38:30 -070019416}/*WDI_PALCtrlMsgCB*/
19417
19418/**
19419 @brief Utility function used by the DAL Core to help dequeue
Jeff Johnsone7245742012-09-05 17:12:55 -070019420 and schedule for execution a pending request
19421 @param
19422
Jeff Johnson295189b2012-06-20 16:38:30 -070019423 pWDICtx: - pointer to the WDI control block
19424 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019425 queued
19426
19427 @see
19428 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019429*/
19430WDI_Status
19431WDI_DequeuePendingReq
19432(
19433 WDI_ControlBlockType* pWDICtx
19434)
19435{
Jeff Johnsone7245742012-09-05 17:12:55 -070019436 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019437 WDI_EventInfoType* pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019438 wpt_msg* palMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070019439 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19440
Jeff Johnsone7245742012-09-05 17:12:55 -070019441 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019442
19443 if ( NULL == pNode )
19444 {
19445 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019446 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019447 return WDI_STATUS_SUCCESS;
19448 }
19449
19450 /*The node actually points to the 1st element inside the Event Data struct -
19451 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019452 pEventData = (WDI_EventInfoType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019453
19454 /*Serialize processing in the control thread
19455 !TO DO: - check to see if these are all the messages params that need
19456 to be filled in*/
19457 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19458
19459 if ( NULL == palMsg )
19460 {
19461 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019462 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
Jeff Johnson295189b2012-06-20 16:38:30 -070019463 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019464 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019465 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019466 palMsg->pContext = pWDICtx;
Jeff Johnson295189b2012-06-20 16:38:30 -070019467 palMsg->callback = WDI_PALCtrlMsgCB;
19468 palMsg->ptr = pEventData;
19469
19470 /*Save the global state as we need it on the other side*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019471 palMsg->val = pWDICtx->uGlobalState;
19472
Jeff Johnson295189b2012-06-20 16:38:30 -070019473 /*Transition back to BUSY as we need to handle a queued request*/
19474 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -070019475
Jeff Johnson295189b2012-06-20 16:38:30 -070019476 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19477
19478 return WDI_STATUS_PENDING;
19479}/*WDI_DequeuePendingReq*/
19480
19481
19482/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019483 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019484 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019485 away.- The assoc requests will be queued by BSSID
19486 @param
19487
Jeff Johnson295189b2012-06-20 16:38:30 -070019488 pWDICtx: - pointer to the WDI control block
19489 pEventData: pointer to the evnt info that needs to be queued
19490 macBSSID: bssid
Jeff Johnsone7245742012-09-05 17:12:55 -070019491
19492 @see
19493 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019494*/
19495WDI_Status
19496WDI_QueueNewAssocRequest
19497(
19498 WDI_ControlBlockType* pWDICtx,
19499 WDI_EventInfoType* pEventData,
19500 wpt_macAddr macBSSID
19501)
19502{
Jeff Johnsone7245742012-09-05 17:12:55 -070019503 wpt_uint8 i;
19504 WDI_BSSSessionType* pSession = NULL;
19505 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019506 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019507 void* pEventInfo;
19508 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019509 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -070019510
Jeff Johnsone7245742012-09-05 17:12:55 -070019511
19512 /*------------------------------------------------------------------------
19513 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019514 ------------------------------------------------------------------------*/
19515 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19516 {
19517 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19518 {
19519 /*Found an empty session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019520 pSession = &pWDICtx->aBSSSessions[i];
19521 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070019522 }
19523 }
19524
19525 if ( i >= WDI_MAX_BSS_SESSIONS )
19526 {
19527 /*Cannot find any empty sessions*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019528 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019529 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019530
Jeff Johnson295189b2012-06-20 16:38:30 -070019531 /*------------------------------------------------------------------------
19532 Fill in the BSSID for this session and set the usage flag
19533 ------------------------------------------------------------------------*/
19534 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070019535 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019536
19537 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019538 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019539 ------------------------------------------------------------------------*/
19540 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19541 if ( NULL == pEventDataQueue )
19542 {
19543 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19544 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19545 WDI_ASSERT(0);
19546 return WDI_STATUS_MEM_FAILURE;
19547 }
19548
19549 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19550 if ( NULL == pSessionIdElement )
19551 {
19552 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19553 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19554 WDI_ASSERT(0);
19555 wpalMemoryFree(pEventDataQueue);
19556 return WDI_STATUS_MEM_FAILURE;
19557 }
19558
19559 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19560 if ( NULL == pEventInfo )
19561 {
19562 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19563 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19564 WDI_ASSERT(0);
19565 wpalMemoryFree(pSessionIdElement);
19566 wpalMemoryFree(pEventDataQueue);
19567 return WDI_STATUS_MEM_FAILURE;
19568 }
19569
19570 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19571 pEventDataQueue->pUserData = pEventData->pUserData;
19572 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19573 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019574 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019575
19576 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19577 pEventDataQueue->pEventData = pEventInfo;
19578
19579 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019580 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019581
19582 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019583 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019584
Jeff Johnsone7245742012-09-05 17:12:55 -070019585 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019586
19587 /*We need to maintain a separate list that keeps track of the order in which
19588 the new assoc requests are being queued such that we can start processing
19589 them in the order that they had arrived*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019590 pSessionIdElement->ucIndex = i;
19591 pNode = (wpt_list_node*)pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019592
19593 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19594 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
Jeff Johnsone7245742012-09-05 17:12:55 -070019595 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019596
19597 /*Return pending as this is what the status of the request is since it has
19598 been queued*/
19599 return WDI_STATUS_PENDING;
19600}/*WDI_QueueNewAssocRequest*/
19601
19602/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019603 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019604 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019605 away.- The assoc requests will be queued by BSSID
19606 @param
19607
Jeff Johnson295189b2012-06-20 16:38:30 -070019608 pWDICtx: - pointer to the WDI control block
19609 pSession: - session in which to queue
19610 pEventData: pointer to the event info that needs to be
19611 queued
Jeff Johnsone7245742012-09-05 17:12:55 -070019612
19613 @see
19614 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019615*/
19616WDI_Status
19617WDI_QueueAssocRequest
19618(
19619 WDI_ControlBlockType* pWDICtx,
19620 WDI_BSSSessionType* pSession,
19621 WDI_EventInfoType* pEventData
19622)
19623{
Jeff Johnsone7245742012-09-05 17:12:55 -070019624 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019625 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019626 void* pEventInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070019627 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019628
19629 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019630 Sanity check
19631 ------------------------------------------------------------------------*/
19632 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19633 {
19634 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19635 "%s: Invalid parameters", __FUNCTION__);
19636
Jeff Johnsone7245742012-09-05 17:12:55 -070019637 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019638 }
19639
19640 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019641 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019642 ------------------------------------------------------------------------*/
19643 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19644 if ( NULL == pEventDataQueue )
19645 {
19646 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019647 "%s: Cannot allocate memory for queueing", __FUNCTION__);
Jeff Johnson295189b2012-06-20 16:38:30 -070019648 WDI_ASSERT(0);
19649 return WDI_STATUS_MEM_FAILURE;
19650 }
19651
19652 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19653 if ( NULL == pEventInfo )
19654 {
19655 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19656 "%s: Cannot allocate memory for queueing event data info",
19657 __FUNCTION__);
19658 WDI_ASSERT(0);
19659 wpalMemoryFree(pEventDataQueue);
19660 return WDI_STATUS_MEM_FAILURE;
19661 }
19662
19663 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19664 pEventDataQueue->pUserData = pEventData->pUserData;
19665 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19666 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019667 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019668 pEventDataQueue->pEventData = pEventInfo;
19669
19670 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19671
19672 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019673 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019674
19675 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019676 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019677
Jeff Johnsone7245742012-09-05 17:12:55 -070019678 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019679
19680 /*The result of this operation is pending because the request has been
19681 queued and it will be processed at a later moment in time */
19682 return WDI_STATUS_PENDING;
19683}/*WDI_QueueAssocRequest*/
19684
19685/**
19686 @brief Utility function used by the DAL Core to help dequeue
19687 an association request that was pending
19688 The request will be queued up in front of the main
19689 pending queue for imediate processing
Jeff Johnsone7245742012-09-05 17:12:55 -070019690 @param
19691
Jeff Johnson295189b2012-06-20 16:38:30 -070019692 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019693
19694
19695 @see
19696 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019697*/
19698WDI_Status
19699WDI_DequeueAssocRequest
19700(
19701 WDI_ControlBlockType* pWDICtx
19702)
19703{
Jeff Johnsone7245742012-09-05 17:12:55 -070019704 wpt_list_node* pNode = NULL;
19705 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019706 WDI_BSSSessionType* pSession;
19707 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019708
19709 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019710 Sanity check
19711 ------------------------------------------------------------------------*/
19712 if ( NULL == pWDICtx )
19713 {
19714 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19715 "%s: Invalid parameters", __FUNCTION__);
19716
Jeff Johnsone7245742012-09-05 17:12:55 -070019717 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019718 }
19719
19720 /*------------------------------------------------------------------------
19721 An association has been completed => a new association can occur
19722 Check to see if there are any pending associations ->
19723 If so , transfer all the pending requests into the busy queue for
19724 processing
19725 These requests have arrived prior to the requests in the busy queue
19726 (bc they needed to be processed in order to be placed in this queue)
19727 => they will be placed at the front of the busy queue
19728 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019729 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019730
19731 if ( NULL == pNode )
19732 {
19733 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019734 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019735 return WDI_STATUS_SUCCESS;
19736 }
19737
19738 /*The node actually points to the 1st element inside the Session Id struct -
19739 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019740 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019741
19742 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19743 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19744
19745 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19746 {
19747 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
Jeff Johnsone7245742012-09-05 17:12:55 -070019748
Jeff Johnson295189b2012-06-20 16:38:30 -070019749 /*Transfer all the pending requests in this assoc queue to
Jeff Johnsone7245742012-09-05 17:12:55 -070019750 the front of the main waiting queue for subsequent execution*/
19751 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019752 while ( NULL != pNode )
19753 {
19754 /*Place it in front of the main pending list*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019755 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19756 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019757 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019758 pSession->bAssocReqQueued = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019759 }
19760 else
19761 {
19762 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019763 "Invalid session id queued up for assoc");
Jeff Johnson295189b2012-06-20 16:38:30 -070019764 WPAL_ASSERT(0);
19765 wpalMemoryFree(pSessionIdElement);
Jeff Johnsone7245742012-09-05 17:12:55 -070019766 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019767 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019768
Jeff Johnson295189b2012-06-20 16:38:30 -070019769 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19770 wpalMemoryFree(pSessionIdElement);
19771 return WDI_STATUS_SUCCESS;
19772}/*WDI_DequeueAssocRequest*/
19773
19774/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019775 @brief Utility function used by the DAL Core to clear any
Jeff Johnson295189b2012-06-20 16:38:30 -070019776 pending requests - all req cb will be called with
19777 failure and the queue will be emptied.
Jeff Johnsone7245742012-09-05 17:12:55 -070019778 @param
19779
Jeff Johnson295189b2012-06-20 16:38:30 -070019780 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019781
19782 @see
19783 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019784*/
19785WDI_Status
19786WDI_ClearPendingRequests
Jeff Johnsone7245742012-09-05 17:12:55 -070019787(
Jeff Johnson295189b2012-06-20 16:38:30 -070019788 WDI_ControlBlockType* pWDICtx
19789)
19790{
Jeff Johnsone7245742012-09-05 17:12:55 -070019791 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019792 WDI_EventInfoType* pEventDataQueue = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019793 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019794 void* pUserData;
19795 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19796
Jeff Johnsone7245742012-09-05 17:12:55 -070019797 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019798
19799 /*------------------------------------------------------------------------
19800 Go through all the requests and fail them - this will only be called
19801 when device is being stopped or an error was detected - either case the
Jeff Johnsone7245742012-09-05 17:12:55 -070019802 pending requests can no longer be sent down to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070019803 ------------------------------------------------------------------------*/
19804 while( pNode )
19805 {
19806 /*The node actually points to the 1st element inside the Event Data struct -
19807 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019808 pEventDataQueue = (WDI_EventInfoType*)pNode;
19809
Jeff Johnson295189b2012-06-20 16:38:30 -070019810 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
19811 if ( NULL != pfnReqStatusCB )
19812 {
19813 /*Fail the request*/
19814 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
19815 }
19816 /* Free data - that was allocated when queueing */
19817 if ( pEventDataQueue->pEventData != NULL )
19818 {
19819 wpalMemoryFree(pEventDataQueue->pEventData);
19820 }
19821 wpalMemoryFree(pEventDataQueue);
19822
19823 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
19824 {
19825 break;
19826 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019827 }
19828
Jeff Johnson295189b2012-06-20 16:38:30 -070019829 return WDI_STATUS_SUCCESS;
19830}/*WDI_ClearPendingRequests*/
19831
19832/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019833 @brief Helper routine used to init the BSS Sessions in the WDI control block
19834
19835
19836 @param pWDICtx: pointer to the WLAN DAL context
19837
Jeff Johnson295189b2012-06-20 16:38:30 -070019838 @see
19839*/
19840void
19841WDI_ResetAssocSessions
Jeff Johnsone7245742012-09-05 17:12:55 -070019842(
Jeff Johnson295189b2012-06-20 16:38:30 -070019843 WDI_ControlBlockType* pWDICtx
19844)
19845{
Jeff Johnsone7245742012-09-05 17:12:55 -070019846 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019847 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19848
19849 /*-------------------------------------------------------------------------
19850 No Sanity check
19851 -------------------------------------------------------------------------*/
19852 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19853 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019854 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
Jeff Johnson295189b2012-06-20 16:38:30 -070019855 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
19856 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
19857 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
19858 }
19859}/*WDI_ResetAssocSessions*/
19860
19861/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019862 @brief Helper routine used to find a session based on the BSSID
19863
19864
19865 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019866 macBSSID: BSSID of the session
Jeff Johnsone7245742012-09-05 17:12:55 -070019867 pSession: pointer to the session (if found)
19868
Jeff Johnson295189b2012-06-20 16:38:30 -070019869 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019870 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019871*/
19872wpt_uint8
19873WDI_FindAssocSession
Jeff Johnsone7245742012-09-05 17:12:55 -070019874(
Jeff Johnson295189b2012-06-20 16:38:30 -070019875 WDI_ControlBlockType* pWDICtx,
19876 wpt_macAddr macBSSID,
19877 WDI_BSSSessionType** ppSession
19878)
19879{
Jeff Johnsone7245742012-09-05 17:12:55 -070019880 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019881 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19882
19883 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019884 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019885 -------------------------------------------------------------------------*/
19886 if ( NULL == ppSession )
19887 {
19888 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19889 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019890 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019891 }
19892
Jeff Johnsone7245742012-09-05 17:12:55 -070019893 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019894
Jeff Johnsone7245742012-09-05 17:12:55 -070019895 /*------------------------------------------------------------------------
19896 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019897 ------------------------------------------------------------------------*/
19898 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19899 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019900 if ( eWLAN_PAL_TRUE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070019901 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
19902 {
19903 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019904 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070019905 return i;
19906 }
19907 }
19908
Jeff Johnsone7245742012-09-05 17:12:55 -070019909 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019910}/*WDI_FindAssocSession*/
19911
19912/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019913 @brief Helper routine used to find a session based on the BSSID
19914
19915
19916 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019917 ucBSSIdx: BSS Index of the session
19918 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070019919
Jeff Johnson295189b2012-06-20 16:38:30 -070019920 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019921 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019922*/
19923wpt_uint8
19924WDI_FindAssocSessionByBSSIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070019925(
Jeff Johnson295189b2012-06-20 16:38:30 -070019926 WDI_ControlBlockType* pWDICtx,
19927 wpt_uint16 ucBSSIdx,
19928 WDI_BSSSessionType** ppSession
19929)
19930{
Jeff Johnsone7245742012-09-05 17:12:55 -070019931 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019932 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19933
19934 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019935 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019936 -------------------------------------------------------------------------*/
19937 if ( NULL == ppSession )
19938 {
19939 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19940 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019941 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019942 }
19943
Jeff Johnsone7245742012-09-05 17:12:55 -070019944 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019945
Jeff Johnsone7245742012-09-05 17:12:55 -070019946 /*------------------------------------------------------------------------
19947 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019948 ------------------------------------------------------------------------*/
19949 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19950 {
19951 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
19952 {
19953 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019954 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070019955 return i;
19956 }
19957 }
19958
Jeff Johnsone7245742012-09-05 17:12:55 -070019959 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070019960}/*WDI_FindAssocSessionByBSSIdx*/
19961
19962/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019963 @brief Helper routine used to find a session based on the BSSID
19964
19965
19966 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019967 ucBSSIdx: BSS Index of the session
19968 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070019969
Jeff Johnson295189b2012-06-20 16:38:30 -070019970 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019971 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070019972*/
19973wpt_uint8
19974WDI_FindAssocSessionByIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070019975(
Jeff Johnson295189b2012-06-20 16:38:30 -070019976 WDI_ControlBlockType* pWDICtx,
19977 wpt_uint16 usIdx,
19978 WDI_BSSSessionType** ppSession
19979)
19980{
19981 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19982
19983 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019984 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070019985 -------------------------------------------------------------------------*/
19986 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
19987 {
19988 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19989 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070019990 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019991 }
19992
19993 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019994 *ppSession = &pWDICtx->aBSSSessions[usIdx];
Jeff Johnson295189b2012-06-20 16:38:30 -070019995
19996 return usIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070019997
Jeff Johnson295189b2012-06-20 16:38:30 -070019998}/*WDI_FindAssocSessionByBSSIdx*/
19999
20000/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020001 @brief Helper routine used to find an empty session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020002 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020003
20004
20005 @param pWDICtx: pointer to the WLAN DAL context
20006 pSession: pointer to the session (if found)
20007
Jeff Johnson295189b2012-06-20 16:38:30 -070020008 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020009 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020010*/
20011wpt_uint8
20012WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -070020013(
Jeff Johnson295189b2012-06-20 16:38:30 -070020014 WDI_ControlBlockType* pWDICtx,
20015 WDI_BSSSessionType** ppSession
20016)
20017{
Jeff Johnsone7245742012-09-05 17:12:55 -070020018 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020019 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20020 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020021 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020022 -------------------------------------------------------------------------*/
20023 if ( NULL == ppSession )
20024 {
20025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20026 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020027 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020028 }
20029
Jeff Johnsone7245742012-09-05 17:12:55 -070020030 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020031
Jeff Johnsone7245742012-09-05 17:12:55 -070020032 /*------------------------------------------------------------------------
20033 Search for a session that it is not in use
Jeff Johnson295189b2012-06-20 16:38:30 -070020034 ------------------------------------------------------------------------*/
20035 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20036 {
20037 if ( ! pWDICtx->aBSSSessions[i].bInUse )
20038 {
20039 /*Found a session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020040 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020041 return i;
20042 }
20043 }
20044
Jeff Johnsone7245742012-09-05 17:12:55 -070020045 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020046}/*WDI_FindEmptySession*/
20047
20048
20049/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020050 @brief Helper routine used to get the total count of active
Jeff Johnson295189b2012-06-20 16:38:30 -070020051 sessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020052
20053
20054 @param pWDICtx: pointer to the WLAN DAL context
20055
Jeff Johnson295189b2012-06-20 16:38:30 -070020056 @see
20057 @return Number of sessions in use
20058*/
20059wpt_uint8
20060WDI_GetActiveSessionsCount
Jeff Johnsone7245742012-09-05 17:12:55 -070020061(
Jeff Johnson295189b2012-06-20 16:38:30 -070020062 WDI_ControlBlockType* pWDICtx
20063)
20064{
Jeff Johnsone7245742012-09-05 17:12:55 -070020065 wpt_uint8 i, ucCount = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070020066 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020067
20068 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070020069 Count all sessions in use
20070 ------------------------------------------------------------------------*/
20071 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20072 {
20073 if ( pWDICtx->aBSSSessions[i].bInUse )
20074 {
20075 ucCount++;
20076 }
20077 }
20078
Jeff Johnsone7245742012-09-05 17:12:55 -070020079 return ucCount;
Jeff Johnson295189b2012-06-20 16:38:30 -070020080}/*WDI_GetActiveSessionsCount*/
20081
20082/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020083 @brief Helper routine used to delete session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020084 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020085
20086
20087 @param pWDICtx: pointer to the WLAN DAL context
20088 pSession: pointer to the session (if found)
20089
Jeff Johnson295189b2012-06-20 16:38:30 -070020090 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020091 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020092*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020093void
Jeff Johnson295189b2012-06-20 16:38:30 -070020094WDI_DeleteSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020095(
Jeff Johnson295189b2012-06-20 16:38:30 -070020096 WDI_ControlBlockType* pWDICtx,
20097 WDI_BSSSessionType* ppSession
20098)
20099{
20100 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020101 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020102 -------------------------------------------------------------------------*/
20103 if ( NULL == ppSession )
20104 {
20105 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20106 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020107 return ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020108 }
20109
Jeff Johnsone7245742012-09-05 17:12:55 -070020110 /*------------------------------------------------------------------------
20111 Reset the entries int session
Jeff Johnson295189b2012-06-20 16:38:30 -070020112 ------------------------------------------------------------------------*/
20113 wpal_list_destroy(&ppSession->wptPendingQueue);
20114 wpalMemoryZero(ppSession, sizeof(*ppSession));
Jeff Johnsone7245742012-09-05 17:12:55 -070020115 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
20116 ppSession->bInUse = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020117 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
20118 wpal_list_init(&ppSession->wptPendingQueue);
20119
20120}/*WDI_DeleteSession*/
20121
20122/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020123 @brief Utility function to add the broadcast STA to the the STA table.
Jeff Johnson295189b2012-06-20 16:38:30 -070020124 The bcast STA ID is assigned by HAL and must be valid.
Jeff Johnsone7245742012-09-05 17:12:55 -070020125 @param
20126
Jeff Johnson295189b2012-06-20 16:38:30 -070020127 WDI_AddStaParams: - pointer to the WDI Add STA params
20128 usBcastStaIdx: - Broadcast STA index passed by HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070020129
20130 @see
20131 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070020132*/
20133void
20134WDI_AddBcastSTAtoSTATable
20135(
20136 WDI_ControlBlockType* pWDICtx,
20137 WDI_AddStaParams * staParams,
20138 wpt_uint16 usBcastStaIdx
20139)
20140{
20141 WDI_AddStaParams wdiAddSTAParam = {0};
20142 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
20143 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20144
20145 /*---------------------------------------------------------------------
20146 Sanity check
20147 ---------------------------------------------------------------------*/
20148 if ( NULL == staParams )
20149 {
20150 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20151 "%s: Invalid parameters", __FUNCTION__);
20152
Jeff Johnsone7245742012-09-05 17:12:55 -070020153 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020154 }
20155
20156 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
20157 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
20158 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
20159 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
20160 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
20161 wdiAddSTAParam.dpuSig = staParams->dpuSig;
20162 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
20163 WDI_MAC_ADDR_LEN );
20164 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
20165 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
20166 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
20167 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
20168 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
20169 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
20170 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020171
Jeff Johnson295189b2012-06-20 16:38:30 -070020172 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
20173}
20174
20175/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020176 @brief NV blob will be divided into fragments of size 4kb and
20177 Sent to HAL
20178
20179 @param pWDICtx: pointer to the WLAN DAL context
20180 pEventData: pointer to the event information structure
20181
Jeff Johnson295189b2012-06-20 16:38:30 -070020182 @see
20183 @return Result of the function call
20184 */
20185
20186WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -070020187(
Jeff Johnson295189b2012-06-20 16:38:30 -070020188 WDI_ControlBlockType* pWDICtx,
20189 WDI_EventInfoType* pEventData
20190)
20191{
20192
20193 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
20194 wpt_uint8* pSendBuffer = NULL;
20195 wpt_uint16 usDataOffset = 0;
20196 wpt_uint16 usSendSize = 0;
20197 wpt_uint16 usCurrentFragmentSize =0;
20198 wpt_uint8* pSrcBuffer = NULL;
20199 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
20200 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
20201
20202 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
20203 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
20204 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
20205
Jeff Johnsone7245742012-09-05 17:12:55 -070020206 /* Sanity Check is done by the caller */
Jeff Johnson295189b2012-06-20 16:38:30 -070020207 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
20208
20209 /* Update the current Fragment Number */
20210 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
20211
20212 /*Update the HAL REQ structure */
20213 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
20214 halNvImgDownloadParam.nvImageReqParams.fragNumber =
20215 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
20216
20217 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
Jeff Johnsone7245742012-09-05 17:12:55 -070020218 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
Jeff Johnson295189b2012-06-20 16:38:30 -070020219 image will be sent to HAL*/
20220
Jeff Johnsone7245742012-09-05 17:12:55 -070020221 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
Jeff Johnson295189b2012-06-20 16:38:30 -070020222 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
Jeff Johnsone7245742012-09-05 17:12:55 -070020223 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020224 /* Taking care of boundry condition */
Jeff Johnsone7245742012-09-05 17:12:55 -070020225 if( !(usCurrentFragmentSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070020226 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
20227 usCurrentFragmentSize = FRAGMENT_SIZE;
20228
20229 /*Update the HAL REQ structure */
20230 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
20231 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
20232
20233 }
20234 else
Jeff Johnsone7245742012-09-05 17:12:55 -070020235 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020236 usCurrentFragmentSize = FRAGMENT_SIZE;
20237
20238 /*Update the HAL REQ structure */
20239 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
20240 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
20241 }
20242
20243 /*-----------------------------------------------------------------------
20244 Get message buffer
20245 -----------------------------------------------------------------------*/
20246 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
20247 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
20248 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070020249 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070020250 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
20251 {
20252 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20253 "Unable to get send buffer in NV Download req %x %x ",
20254 pEventData, pwdiNvDownloadReqParams);
20255 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070020256 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020257 }
20258
20259 /* Copying the Hal NV download REQ structure */
Jeff Johnsone7245742012-09-05 17:12:55 -070020260 wpalMemoryCopy(pSendBuffer + usDataOffset ,
Jeff Johnson295189b2012-06-20 16:38:30 -070020261 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
20262
20263 /* Appending the NV image fragment */
20264 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
20265 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
20266 usCurrentFragmentSize);
20267
20268 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070020269 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070020270
Jeff Johnsone7245742012-09-05 17:12:55 -070020271 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
20272 wdiNvDownloadRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -070020273 WDI_NV_DOWNLOAD_RESP);
20274
20275}
Jeff Johnsone7245742012-09-05 17:12:55 -070020276/*============================================================================
20277 Helper inline functions for
Jeff Johnson295189b2012-06-20 16:38:30 -070020278 ============================================================================*/
20279/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020280 @brief Helper routine used to find a session based on the BSSID
20281 @param pContext: pointer to the WLAN DAL context
20282 @param pDPContext: pointer to the Datapath context
20283
Jeff Johnson295189b2012-06-20 16:38:30 -070020284 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020285 @return
Jeff Johnson295189b2012-06-20 16:38:30 -070020286*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020287WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020288WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
20289{
20290 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20291
20292 pCB->pDPContext = pDPContext;
20293 return;
20294}
20295
20296/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020297 @brief Helper routine used to find a session based on the BSSID
20298
20299
20300 @param pContext: pointer to the WLAN DAL context
20301
Jeff Johnson295189b2012-06-20 16:38:30 -070020302 @see
20303 @return pointer to Datapath context
20304*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020305WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020306WDI_DS_GetDatapathContext (void *pContext)
20307{
20308 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20309 return pCB->pDPContext;
20310}
20311/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020312 @brief Helper routine used to find a session based on the BSSID
20313
20314
20315 @param pContext: pointer to the WLAN DAL context
20316 @param pDTDriverContext: pointer to the Transport Driver context
20317
Jeff Johnson295189b2012-06-20 16:38:30 -070020318 @see
20319 @return void
20320*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020321WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020322WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
20323{
20324 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20325
20326 pCB->pDTDriverContext = pDTDriverContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020327 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020328}
20329
20330/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020331 @brief Helper routine used to find a session based on the BSSID
20332
20333
20334 @param pWDICtx: pointer to the WLAN DAL context
20335
Jeff Johnson295189b2012-06-20 16:38:30 -070020336 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020337 @return pointer to datapath context
Jeff Johnson295189b2012-06-20 16:38:30 -070020338*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020339WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020340WDT_GetTransportDriverContext (void *pContext)
20341{
20342 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020343 return(pCB->pDTDriverContext);
Jeff Johnson295189b2012-06-20 16:38:30 -070020344}
20345
Jeff Johnsone7245742012-09-05 17:12:55 -070020346/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -070020347 Helper inline converters
20348 ============================================================================*/
20349/*Convert WDI driver type into HAL driver type*/
20350WPT_STATIC WPT_INLINE WDI_Status
20351WDI_HAL_2_WDI_STATUS
20352(
20353 eHalStatus halStatus
20354)
20355{
Jeff Johnsone7245742012-09-05 17:12:55 -070020356 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020357 the chances of getting inlined*/
20358 switch( halStatus )
20359 {
20360 case eHAL_STATUS_SUCCESS:
20361 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20362 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20363 return WDI_STATUS_SUCCESS;
20364 case eHAL_STATUS_FAILURE:
20365 return WDI_STATUS_E_FAILURE;
20366 case eHAL_STATUS_FAILED_ALLOC:
Jeff Johnsone7245742012-09-05 17:12:55 -070020367 return WDI_STATUS_MEM_FAILURE;
20368 /*The rest of the HAL error codes must be kept hidden from the UMAC as
Jeff Johnson295189b2012-06-20 16:38:30 -070020369 they refer to specific internal modules of our device*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020370 default:
20371 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20372 }
Jeff Johnson295189b2012-06-20 16:38:30 -070020373
Jeff Johnsone7245742012-09-05 17:12:55 -070020374 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020375}/*WDI_HAL_2_WDI_STATUS*/
20376
20377/*Convert WDI request type into HAL request type*/
20378WPT_STATIC WPT_INLINE tHalHostMsgType
20379WDI_2_HAL_REQ_TYPE
20380(
20381 WDI_RequestEnumType wdiReqType
20382)
20383{
Jeff Johnsone7245742012-09-05 17:12:55 -070020384 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020385 the chances of getting inlined*/
20386 switch( wdiReqType )
Jeff Johnsone7245742012-09-05 17:12:55 -070020387 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020388 case WDI_START_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020389 return WLAN_HAL_START_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020390 case WDI_STOP_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020391 return WLAN_HAL_STOP_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020392 case WDI_INIT_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020393 return WLAN_HAL_INIT_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020394 case WDI_START_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020395 return WLAN_HAL_START_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020396 case WDI_END_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020397 return WLAN_HAL_END_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020398 case WDI_FINISH_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020399 return WLAN_HAL_FINISH_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020400 case WDI_JOIN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020401 return WLAN_HAL_JOIN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020402 case WDI_CONFIG_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020403 return WLAN_HAL_CONFIG_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020404 case WDI_DEL_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020405 return WLAN_HAL_DELETE_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020406 case WDI_POST_ASSOC_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020407 return WLAN_HAL_POST_ASSOC_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020408 case WDI_DEL_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020409 return WLAN_HAL_DELETE_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020410 case WDI_SET_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020411 return WLAN_HAL_SET_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020412 case WDI_RMV_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020413 return WLAN_HAL_RMV_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020414 case WDI_SET_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020415 return WLAN_HAL_SET_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020416 case WDI_RMV_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020417 return WLAN_HAL_RMV_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020418 case WDI_SET_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020419 return WLAN_HAL_SET_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020420 case WDI_RMV_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020421 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020422 return WLAN_HAL_RMV_STAKEY_REQ;
20423 case WDI_ADD_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020424 return WLAN_HAL_ADD_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020425 case WDI_DEL_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020426 return WLAN_HAL_DEL_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020427 case WDI_UPD_EDCA_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020428 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020429 case WDI_ADD_BA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020430 return WLAN_HAL_ADD_BA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020431 case WDI_DEL_BA_REQ:
20432 return WLAN_HAL_DEL_BA_REQ;
20433#ifdef FEATURE_WLAN_CCX
20434 case WDI_TSM_STATS_REQ:
20435 return WLAN_HAL_TSM_STATS_REQ;
20436#endif
20437 case WDI_CH_SWITCH_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020438 return WLAN_HAL_CH_SWITCH_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020439 case WDI_CONFIG_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020440 return WLAN_HAL_CONFIG_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020441 case WDI_SET_LINK_ST_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020442 return WLAN_HAL_SET_LINK_ST_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020443 case WDI_GET_STATS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020444 return WLAN_HAL_GET_STATS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020445 case WDI_UPDATE_CFG_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020446 return WLAN_HAL_UPDATE_CFG_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020447 case WDI_ADD_BA_SESSION_REQ:
20448 return WLAN_HAL_ADD_BA_SESSION_REQ;
20449 case WDI_TRIGGER_BA_REQ:
20450 return WLAN_HAL_TRIGGER_BA_REQ;
20451 case WDI_UPD_BCON_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020452 return WLAN_HAL_UPDATE_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020453 case WDI_SND_BCON_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020454 return WLAN_HAL_SEND_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020455 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20456 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20457 case WDI_SET_MAX_TX_POWER_REQ:
20458 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20459#ifdef WLAN_FEATURE_P2P
20460 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20461 return WLAN_HAL_SET_P2P_GONOA_REQ;
20462#endif
20463 case WDI_ENTER_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020464 return WLAN_HAL_ENTER_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020465 case WDI_EXIT_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020466 return WLAN_HAL_EXIT_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020467 case WDI_ENTER_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020468 return WLAN_HAL_ENTER_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020469 case WDI_EXIT_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020470 return WLAN_HAL_EXIT_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020471 case WDI_ENTER_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020472 return WLAN_HAL_ENTER_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020473 case WDI_EXIT_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020474 return WLAN_HAL_EXIT_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020475 case WDI_SET_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020476 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020477 case WDI_UPDATE_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020478 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020479 case WDI_CONFIGURE_RXP_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020480 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020481 case WDI_SET_BEACON_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020482 return WLAN_HAL_ADD_BCN_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020483 case WDI_REM_BEACON_FILTER_REQ:
20484 return WLAN_HAL_REM_BCN_FILTER_REQ;
20485 case WDI_SET_RSSI_THRESHOLDS_REQ:
20486 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20487 case WDI_HOST_OFFLOAD_REQ:
20488 return WLAN_HAL_HOST_OFFLOAD_REQ;
20489 case WDI_WOWL_ADD_BC_PTRN_REQ:
20490 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20491 case WDI_WOWL_DEL_BC_PTRN_REQ:
20492 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20493 case WDI_WOWL_ENTER_REQ:
20494 return WLAN_HAL_ENTER_WOWL_REQ;
20495 case WDI_WOWL_EXIT_REQ:
20496 return WLAN_HAL_EXIT_WOWL_REQ;
20497 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20498 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20499 case WDI_NV_DOWNLOAD_REQ:
20500 return WLAN_HAL_DOWNLOAD_NV_REQ;
20501 case WDI_FLUSH_AC_REQ:
20502 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20503 case WDI_BTAMP_EVENT_REQ:
20504 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20505#ifdef WLAN_FEATURE_VOWIFI_11R
20506 case WDI_AGGR_ADD_TS_REQ:
20507 return WLAN_HAL_AGGR_ADD_TS_REQ;
20508#endif /* WLAN_FEATURE_VOWIFI_11R */
20509#ifdef ANI_MANF_DIAG
20510 case WDI_FTM_CMD_REQ:
20511 return WLAN_HAL_PROCESS_PTT_REQ;
20512#endif /* ANI_MANF_DIAG */
20513 case WDI_ADD_STA_SELF_REQ:
20514 return WLAN_HAL_ADD_STA_SELF_REQ;
20515 case WDI_DEL_STA_SELF_REQ:
20516 return WLAN_HAL_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070020517#ifdef FEATURE_OEM_DATA_SUPPORT
20518 case WDI_START_OEM_DATA_REQ:
20519 return WLAN_HAL_START_OEM_DATA_REQ;
20520#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020521 case WDI_HOST_RESUME_REQ:
20522 return WLAN_HAL_HOST_RESUME_REQ;
20523 case WDI_HOST_SUSPEND_IND:
20524 return WLAN_HAL_HOST_SUSPEND_IND;
20525 case WDI_KEEP_ALIVE_REQ:
20526 return WLAN_HAL_KEEP_ALIVE_REQ;
20527
20528#ifdef FEATURE_WLAN_SCAN_PNO
20529 case WDI_SET_PREF_NETWORK_REQ:
20530 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20531 case WDI_SET_RSSI_FILTER_REQ:
20532 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20533 case WDI_UPDATE_SCAN_PARAMS_REQ:
20534 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20535#endif // FEATURE_WLAN_SCAN_PNO
20536 case WDI_SET_TX_PER_TRACKING_REQ:
20537 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20538#ifdef WLAN_FEATURE_PACKET_FILTERING
20539 case WDI_8023_MULTICAST_LIST_REQ:
20540 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20541 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020542 return WLAN_HAL_SET_PACKET_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020543 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20544 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20545 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20546 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20547#endif // WLAN_FEATURE_PACKET_FILTERING
20548 case WDI_HAL_DUMP_CMD_REQ:
20549 return WLAN_HAL_DUMP_COMMAND_REQ;
20550#ifdef WLAN_FEATURE_GTK_OFFLOAD
20551 case WDI_GTK_OFFLOAD_REQ:
20552 return WLAN_HAL_GTK_OFFLOAD_REQ;
20553 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20554 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20555#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20556
20557 case WDI_INIT_SCAN_CON_REQ:
20558 return WLAN_HAL_INIT_SCAN_CON_REQ;
20559 case WDI_SET_POWER_PARAMS_REQ:
20560 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20561 case WDI_SET_TM_LEVEL_REQ:
20562 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20563 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20564 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020565#ifdef WLAN_FEATURE_11AC
20566 case WDI_UPDATE_VHT_OP_MODE_REQ:
20567 return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ;
20568#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020569 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020570 return WLAN_HAL_MSG_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020571 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020572
Jeff Johnson295189b2012-06-20 16:38:30 -070020573}/*WDI_2_HAL_REQ_TYPE*/
20574
20575/*Convert WDI response type into HAL response type*/
20576WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20577HAL_2_WDI_RSP_TYPE
20578(
20579 tHalHostMsgType halMsg
20580)
20581{
Jeff Johnsone7245742012-09-05 17:12:55 -070020582 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020583 the chances of getting inlined*/
20584 switch( halMsg )
20585 {
20586 case WLAN_HAL_START_RSP:
20587 return WDI_START_RESP;
20588 case WLAN_HAL_STOP_RSP:
20589 return WDI_STOP_RESP;
20590 case WLAN_HAL_INIT_SCAN_RSP:
20591 return WDI_INIT_SCAN_RESP;
20592 case WLAN_HAL_START_SCAN_RSP:
20593 return WDI_START_SCAN_RESP;
20594 case WLAN_HAL_END_SCAN_RSP:
20595 return WDI_END_SCAN_RESP;
20596 case WLAN_HAL_FINISH_SCAN_RSP:
20597 return WDI_FINISH_SCAN_RESP;
20598 case WLAN_HAL_CONFIG_STA_RSP:
20599 return WDI_CONFIG_STA_RESP;
20600 case WLAN_HAL_DELETE_STA_RSP:
20601 return WDI_DEL_STA_RESP;
20602 case WLAN_HAL_CONFIG_BSS_RSP:
20603 return WDI_CONFIG_BSS_RESP;
20604 case WLAN_HAL_DELETE_BSS_RSP:
20605 return WDI_DEL_BSS_RESP;
20606 case WLAN_HAL_JOIN_RSP:
20607 return WDI_JOIN_RESP;
20608 case WLAN_HAL_POST_ASSOC_RSP:
20609 return WDI_POST_ASSOC_RESP;
20610 case WLAN_HAL_SET_BSSKEY_RSP:
20611 return WDI_SET_BSS_KEY_RESP;
20612 case WLAN_HAL_SET_STAKEY_RSP:
20613 return WDI_SET_STA_KEY_RESP;
20614 case WLAN_HAL_RMV_BSSKEY_RSP:
20615 return WDI_RMV_BSS_KEY_RESP;
20616 case WLAN_HAL_RMV_STAKEY_RSP:
20617 return WDI_RMV_STA_KEY_RESP;
20618 case WLAN_HAL_SET_BCASTKEY_RSP:
20619 return WDI_SET_STA_BCAST_KEY_RESP;
20620 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20621 // return WDI_RMV_STA_BCAST_KEY_RESP;
20622 case WLAN_HAL_ADD_TS_RSP:
20623 return WDI_ADD_TS_RESP;
20624 case WLAN_HAL_DEL_TS_RSP:
20625 return WDI_DEL_TS_RESP;
20626 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20627 return WDI_UPD_EDCA_PRMS_RESP;
20628 case WLAN_HAL_ADD_BA_RSP:
20629 return WDI_ADD_BA_RESP;
20630 case WLAN_HAL_DEL_BA_RSP:
20631 return WDI_DEL_BA_RESP;
20632#ifdef FEATURE_WLAN_CCX
20633 case WLAN_HAL_TSM_STATS_RSP:
20634 return WDI_TSM_STATS_RESP;
20635#endif
20636 case WLAN_HAL_CH_SWITCH_RSP:
20637 return WDI_CH_SWITCH_RESP;
20638 case WLAN_HAL_SET_LINK_ST_RSP:
20639 return WDI_SET_LINK_ST_RESP;
20640 case WLAN_HAL_GET_STATS_RSP:
20641 return WDI_GET_STATS_RESP;
20642 case WLAN_HAL_UPDATE_CFG_RSP:
20643 return WDI_UPDATE_CFG_RESP;
20644 case WLAN_HAL_ADD_BA_SESSION_RSP:
20645 return WDI_ADD_BA_SESSION_RESP;
20646 case WLAN_HAL_TRIGGER_BA_RSP:
20647 return WDI_TRIGGER_BA_RESP;
20648 case WLAN_HAL_UPDATE_BEACON_RSP:
20649 return WDI_UPD_BCON_PRMS_RESP;
20650 case WLAN_HAL_SEND_BEACON_RSP:
20651 return WDI_SND_BCON_RESP;
20652 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20653 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20654 /*Indications*/
20655 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20656 return WDI_HAL_RSSI_NOTIFICATION_IND;
20657 case WLAN_HAL_MISSED_BEACON_IND:
20658 return WDI_HAL_MISSED_BEACON_IND;
20659 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20660 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20661 case WLAN_HAL_MIC_FAILURE_IND:
20662 return WDI_HAL_MIC_FAILURE_IND;
20663 case WLAN_HAL_FATAL_ERROR_IND:
20664 return WDI_HAL_FATAL_ERROR_IND;
20665 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20666 return WDI_HAL_DEL_STA_IND;
20667 case WLAN_HAL_COEX_IND:
20668 return WDI_HAL_COEX_IND;
20669 case WLAN_HAL_OTA_TX_COMPL_IND:
20670 return WDI_HAL_TX_COMPLETE_IND;
20671#ifdef WLAN_FEATURE_P2P
20672 case WLAN_HAL_P2P_NOA_ATTR_IND:
20673 return WDI_HAL_P2P_NOA_ATTR_IND;
20674#endif
20675 case WLAN_HAL_TX_PER_HIT_IND:
20676 return WDI_HAL_TX_PER_HIT_IND;
20677 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20678 return WDI_SET_MAX_TX_POWER_RESP;
20679#ifdef WLAN_FEATURE_P2P
20680 case WLAN_HAL_SET_P2P_GONOA_RSP:
20681 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20682#endif
20683 case WLAN_HAL_ENTER_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020684 return WDI_ENTER_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020685 case WLAN_HAL_EXIT_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020686 return WDI_EXIT_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020687 case WLAN_HAL_ENTER_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020688 return WDI_ENTER_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020689 case WLAN_HAL_EXIT_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020690 return WDI_EXIT_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020691 case WLAN_HAL_ENTER_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020692 return WDI_ENTER_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020693 case WLAN_HAL_EXIT_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020694 return WDI_EXIT_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020695 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020696 return WDI_SET_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020697 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020698 return WDI_UPDATE_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020699 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020700 return WDI_CONFIGURE_RXP_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020701 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20702 return WDI_SET_BEACON_FILTER_RESP;
20703 case WLAN_HAL_REM_BCN_FILTER_RSP:
20704 return WDI_REM_BEACON_FILTER_RESP;
20705 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20706 return WDI_SET_RSSI_THRESHOLDS_RESP;
20707 case WLAN_HAL_HOST_OFFLOAD_RSP:
20708 return WDI_HOST_OFFLOAD_RESP;
20709 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20710 return WDI_WOWL_ADD_BC_PTRN_RESP;
20711 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20712 return WDI_WOWL_DEL_BC_PTRN_RESP;
20713 case WLAN_HAL_ENTER_WOWL_RSP:
20714 return WDI_WOWL_ENTER_RESP;
20715 case WLAN_HAL_EXIT_WOWL_RSP:
20716 return WDI_WOWL_EXIT_RESP;
20717 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20718 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20719 case WLAN_HAL_DOWNLOAD_NV_RSP:
20720 return WDI_NV_DOWNLOAD_RESP;
20721 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20722 return WDI_FLUSH_AC_RESP;
20723 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20724 return WDI_BTAMP_EVENT_RESP;
20725#ifdef ANI_MANF_DIAG
20726 case WLAN_HAL_PROCESS_PTT_RSP:
20727 return WDI_FTM_CMD_RESP;
20728#endif /* ANI_MANF_DIAG */
20729 case WLAN_HAL_ADD_STA_SELF_RSP:
20730 return WDI_ADD_STA_SELF_RESP;
20731case WLAN_HAL_DEL_STA_SELF_RSP:
20732 return WDI_DEL_STA_SELF_RESP;
Jeff Johnsone7245742012-09-05 17:12:55 -070020733#ifdef FEATURE_OEM_DATA_SUPPORT
20734 case WLAN_HAL_START_OEM_DATA_RSP:
20735 return WDI_START_OEM_DATA_RESP;
20736#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020737 case WLAN_HAL_HOST_RESUME_RSP:
20738 return WDI_HOST_RESUME_RESP;
20739 case WLAN_HAL_KEEP_ALIVE_RSP:
20740 return WDI_KEEP_ALIVE_RESP;
20741#ifdef FEATURE_WLAN_SCAN_PNO
20742 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20743 return WDI_SET_PREF_NETWORK_RESP;
20744 case WLAN_HAL_SET_RSSI_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020745 return WDI_SET_RSSI_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020746 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20747 return WDI_UPDATE_SCAN_PARAMS_RESP;
20748 case WLAN_HAL_PREF_NETW_FOUND_IND:
20749 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20750#endif // FEATURE_WLAN_SCAN_PNO
20751 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20752 return WDI_SET_TX_PER_TRACKING_RESP;
20753#ifdef WLAN_FEATURE_PACKET_FILTERING
20754 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20755 return WDI_8023_MULTICAST_LIST_RESP;
20756 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20757 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20758 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20759 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20760 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20761 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20762#endif // WLAN_FEATURE_PACKET_FILTERING
20763
20764 case WLAN_HAL_DUMP_COMMAND_RSP:
20765 return WDI_HAL_DUMP_CMD_RESP;
20766 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20767 return WDI_SET_POWER_PARAMS_RESP;
20768#ifdef WLAN_FEATURE_VOWIFI_11R
20769 case WLAN_HAL_AGGR_ADD_TS_RSP:
20770 return WDI_AGGR_ADD_TS_RESP;
20771#endif
20772
20773#ifdef WLAN_FEATURE_GTK_OFFLOAD
20774 case WLAN_HAL_GTK_OFFLOAD_RSP:
20775 return WDI_GTK_OFFLOAD_RESP;
20776 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
20777 return WDI_GTK_OFFLOAD_GETINFO_RESP;
20778#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20779#ifdef WLAN_WAKEUP_EVENTS
20780 case WLAN_HAL_WAKE_REASON_IND:
20781 return WDI_HAL_WAKE_REASON_IND;
20782#endif // WLAN_WAKEUP_EVENTS
20783
20784 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
20785 return WDI_SET_TM_LEVEL_RESP;
20786 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
20787 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020788#ifdef WLAN_FEATURE_11AC
20789 case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP:
20790 return WDI_UPDATE_VHT_OP_MODE_RESP;
20791#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020792 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020793 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020794 }
20795
20796}/*HAL_2_WDI_RSP_TYPE*/
20797
20798
20799/*Convert WDI driver type into HAL driver type*/
20800WPT_STATIC WPT_INLINE tDriverType
20801WDI_2_HAL_DRV_TYPE
20802(
20803 WDI_DriverType wdiDriverType
20804)
20805{
Jeff Johnsone7245742012-09-05 17:12:55 -070020806 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020807 the chances of getting inlined*/
20808 switch( wdiDriverType )
20809 {
20810 case WDI_DRIVER_TYPE_PRODUCTION:
20811 return eDRIVER_TYPE_PRODUCTION;
20812 case WDI_DRIVER_TYPE_MFG:
20813 return eDRIVER_TYPE_MFG;
20814 case WDI_DRIVER_TYPE_DVT:
20815 return eDRIVER_TYPE_DVT;
20816 }
20817
Jeff Johnsone7245742012-09-05 17:12:55 -070020818 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020819}/*WDI_2_HAL_DRV_TYPE*/
20820
20821
20822/*Convert WDI stop reason into HAL stop reason*/
20823WPT_STATIC WPT_INLINE tHalStopType
20824WDI_2_HAL_STOP_REASON
20825(
20826 WDI_StopType wdiDriverType
20827)
20828{
Jeff Johnsone7245742012-09-05 17:12:55 -070020829 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020830 the chances of getting inlined*/
20831 switch( wdiDriverType )
20832 {
20833 case WDI_STOP_TYPE_SYS_RESET:
20834 return HAL_STOP_TYPE_SYS_RESET;
20835 case WDI_DRIVER_TYPE_MFG:
20836 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
20837 case WDI_STOP_TYPE_RF_KILL:
20838 return HAL_STOP_TYPE_RF_KILL;
20839 }
20840
Jeff Johnsone7245742012-09-05 17:12:55 -070020841 return HAL_STOP_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020842}/*WDI_2_HAL_STOP_REASON*/
20843
20844
20845/*Convert WDI scan mode type into HAL scan mode type*/
20846WPT_STATIC WPT_INLINE eHalSysMode
20847WDI_2_HAL_SCAN_MODE
20848(
20849 WDI_ScanMode wdiScanMode
20850)
20851{
Jeff Johnsone7245742012-09-05 17:12:55 -070020852 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020853 the chances of getting inlined*/
20854 switch( wdiScanMode )
20855 {
20856 case WDI_SCAN_MODE_NORMAL:
20857 return eHAL_SYS_MODE_NORMAL;
20858 case WDI_SCAN_MODE_LEARN:
20859 return eHAL_SYS_MODE_LEARN;
20860 case WDI_SCAN_MODE_SCAN:
20861 return eHAL_SYS_MODE_SCAN;
20862 case WDI_SCAN_MODE_PROMISC:
20863 return eHAL_SYS_MODE_PROMISC;
20864 case WDI_SCAN_MODE_SUSPEND_LINK:
20865 return eHAL_SYS_MODE_SUSPEND_LINK;
20866 }
20867
Jeff Johnsone7245742012-09-05 17:12:55 -070020868 return eHAL_SYS_MODE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020869}/*WDI_2_HAL_SCAN_MODE*/
20870
20871/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020872WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -070020873WDI_2_HAL_SEC_CH_OFFSET
20874(
20875 WDI_HTSecondaryChannelOffset wdiSecChOffset
20876)
20877{
Jeff Johnsone7245742012-09-05 17:12:55 -070020878 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020879 the chances of getting inlined*/
20880 switch( wdiSecChOffset )
20881 {
20882 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
Jeff Johnsone7245742012-09-05 17:12:55 -070020883 return PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -070020884 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020885 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
Jeff Johnson295189b2012-06-20 16:38:30 -070020886 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
Jeff Johnsone7245742012-09-05 17:12:55 -070020887 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
20888#ifdef WLAN_FEATURE_11AC
20889 case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
20890 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20891 case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
20892 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20893 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
20894 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
20895 case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW:
20896 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20897 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
20898 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20899 case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
20900 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
20901 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
20902 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
20903#endif
20904 default:
20905 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070020906 }
20907
Jeff Johnsone7245742012-09-05 17:12:55 -070020908 return PHY_CHANNEL_BONDING_STATE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020909}/*WDI_2_HAL_SEC_CH_OFFSET*/
20910
20911/*Convert WDI BSS type into HAL BSS type*/
20912WPT_STATIC WPT_INLINE tSirBssType
20913WDI_2_HAL_BSS_TYPE
20914(
20915 WDI_BssType wdiBSSType
20916)
20917{
Jeff Johnsone7245742012-09-05 17:12:55 -070020918 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020919 the chances of getting inlined*/
20920 switch( wdiBSSType )
20921 {
20922 case WDI_INFRASTRUCTURE_MODE:
20923 return eSIR_INFRASTRUCTURE_MODE;
20924 case WDI_INFRA_AP_MODE:
20925 return eSIR_INFRA_AP_MODE;
20926 case WDI_IBSS_MODE:
20927 return eSIR_IBSS_MODE;
20928 case WDI_BTAMP_STA_MODE:
20929 return eSIR_BTAMP_STA_MODE;
20930 case WDI_BTAMP_AP_MODE:
Jeff Johnsone7245742012-09-05 17:12:55 -070020931 return eSIR_BTAMP_AP_MODE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020932 case WDI_BSS_AUTO_MODE:
20933 return eSIR_AUTO_MODE;
20934 }
20935
Jeff Johnsone7245742012-09-05 17:12:55 -070020936 return eSIR_DONOT_USE_BSS_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020937}/*WDI_2_HAL_BSS_TYPE*/
20938
20939/*Convert WDI NW type into HAL NW type*/
20940WPT_STATIC WPT_INLINE tSirNwType
20941WDI_2_HAL_NW_TYPE
20942(
20943 WDI_NwType wdiNWType
20944)
20945{
Jeff Johnsone7245742012-09-05 17:12:55 -070020946 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020947 the chances of getting inlined*/
20948 switch( wdiNWType )
20949 {
20950 case WDI_11A_NW_TYPE:
20951 return eSIR_11A_NW_TYPE;
20952 case WDI_11B_NW_TYPE:
20953 return eSIR_11B_NW_TYPE;
20954 case WDI_11G_NW_TYPE:
20955 return eSIR_11G_NW_TYPE;
20956 case WDI_11N_NW_TYPE:
20957 return eSIR_11N_NW_TYPE;
20958 }
20959
Jeff Johnsone7245742012-09-05 17:12:55 -070020960 return eSIR_DONOT_USE_NW_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020961}/*WDI_2_HAL_NW_TYPE*/
20962
20963/*Convert WDI chanel bonding type into HAL cb type*/
20964WPT_STATIC WPT_INLINE ePhyChanBondState
20965WDI_2_HAL_CB_STATE
20966(
20967 WDI_PhyChanBondState wdiCbState
20968)
20969{
Jeff Johnsone7245742012-09-05 17:12:55 -070020970 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020971 the chances of getting inlined*/
20972 switch ( wdiCbState )
20973 {
20974 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
20975 return PHY_SINGLE_CHANNEL_CENTERED;
20976 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
20977 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
20978 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
20979 return PHY_DOUBLE_CHANNEL_CENTERED;
20980 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
20981 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
Jeff Johnsone7245742012-09-05 17:12:55 -070020982#ifdef WLAN_FEATURE_11AC
20983 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
20984 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
20985 case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
20986 return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
20987 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
20988 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
20989 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
20990 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
20991 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
20992 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
20993 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
20994 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
20995 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
20996 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
20997#endif
20998 case WDI_MAX_CB_STATE:
20999 default:
21000 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021001 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021002
Jeff Johnson295189b2012-06-20 16:38:30 -070021003 return PHY_CHANNEL_BONDING_STATE_MAX;
21004}/*WDI_2_HAL_CB_STATE*/
21005
21006/*Convert WDI chanel bonding type into HAL cb type*/
21007WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
21008WDI_2_HAL_HT_OPER_MODE
21009(
21010 WDI_HTOperatingMode wdiHTOperMode
21011)
21012{
Jeff Johnsone7245742012-09-05 17:12:55 -070021013 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021014 the chances of getting inlined*/
21015 switch ( wdiHTOperMode )
21016 {
21017 case WDI_HT_OP_MODE_PURE:
21018 return eSIR_HT_OP_MODE_PURE;
21019 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
21020 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
21021 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
21022 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
21023 case WDI_HT_OP_MODE_MIXED:
21024 return eSIR_HT_OP_MODE_MIXED;
21025 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021026
Jeff Johnson295189b2012-06-20 16:38:30 -070021027 return eSIR_HT_OP_MODE_MAX;
21028}/*WDI_2_HAL_HT_OPER_MODE*/
21029
21030/*Convert WDI mimo PS type into HAL mimo PS type*/
21031WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
21032WDI_2_HAL_MIMO_PS
21033(
21034 WDI_HTMIMOPowerSaveState wdiHTOperMode
21035)
21036{
Jeff Johnsone7245742012-09-05 17:12:55 -070021037 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021038 the chances of getting inlined*/
21039 switch ( wdiHTOperMode )
21040 {
21041 case WDI_HT_MIMO_PS_STATIC:
21042 return eSIR_HT_MIMO_PS_STATIC;
21043 case WDI_HT_MIMO_PS_DYNAMIC:
21044 return eSIR_HT_MIMO_PS_DYNAMIC;
21045 case WDI_HT_MIMO_PS_NA:
21046 return eSIR_HT_MIMO_PS_NA;
21047 case WDI_HT_MIMO_PS_NO_LIMIT:
21048 return eSIR_HT_MIMO_PS_NO_LIMIT;
21049 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021050
Jeff Johnson295189b2012-06-20 16:38:30 -070021051 return eSIR_HT_MIMO_PS_MAX;
21052}/*WDI_2_HAL_MIMO_PS*/
21053
21054/*Convert WDI ENC type into HAL ENC type*/
21055WPT_STATIC WPT_INLINE tAniEdType
21056WDI_2_HAL_ENC_TYPE
21057(
21058 WDI_EncryptType wdiEncType
21059)
21060{
Jeff Johnsone7245742012-09-05 17:12:55 -070021061 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021062 the chances of getting inlined*/
21063 switch ( wdiEncType )
21064 {
21065 case WDI_ENCR_NONE:
21066 return eSIR_ED_NONE;
21067
21068 case WDI_ENCR_WEP40:
21069 return eSIR_ED_WEP40;
21070
21071 case WDI_ENCR_WEP104:
21072 return eSIR_ED_WEP104;
21073
21074 case WDI_ENCR_TKIP:
21075 return eSIR_ED_TKIP;
21076
21077 case WDI_ENCR_CCMP:
21078 return eSIR_ED_CCMP;
21079
21080 case WDI_ENCR_AES_128_CMAC:
21081 return eSIR_ED_AES_128_CMAC;
21082#if defined(FEATURE_WLAN_WAPI)
21083 case WDI_ENCR_WPI:
21084 return eSIR_ED_WPI;
21085#endif
21086 default:
21087 return eSIR_ED_NOT_IMPLEMENTED;
21088 }
21089
21090}/*WDI_2_HAL_ENC_TYPE*/
21091
21092/*Convert WDI WEP type into HAL WEP type*/
21093WPT_STATIC WPT_INLINE tAniWepType
21094WDI_2_HAL_WEP_TYPE
21095(
21096 WDI_WepType wdiWEPType
21097)
21098{
Jeff Johnsone7245742012-09-05 17:12:55 -070021099 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021100 the chances of getting inlined*/
21101 switch ( wdiWEPType )
21102 {
21103 case WDI_WEP_STATIC:
21104 return eSIR_WEP_STATIC;
21105
21106 case WDI_WEP_DYNAMIC:
21107 return eSIR_WEP_DYNAMIC;
21108 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021109
Jeff Johnson295189b2012-06-20 16:38:30 -070021110 return eSIR_WEP_MAX;
21111}/*WDI_2_HAL_WEP_TYPE*/
21112
21113WPT_STATIC WPT_INLINE tSirLinkState
21114WDI_2_HAL_LINK_STATE
21115(
21116 WDI_LinkStateType wdiLinkState
21117)
21118{
Jeff Johnsone7245742012-09-05 17:12:55 -070021119 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021120 the chances of getting inlined*/
21121 switch ( wdiLinkState )
21122 {
21123 case WDI_LINK_IDLE_STATE:
21124 return eSIR_LINK_IDLE_STATE;
21125
21126 case WDI_LINK_PREASSOC_STATE:
21127 return eSIR_LINK_PREASSOC_STATE;
21128
21129 case WDI_LINK_POSTASSOC_STATE:
21130 return eSIR_LINK_POSTASSOC_STATE;
21131
21132 case WDI_LINK_AP_STATE:
21133 return eSIR_LINK_AP_STATE;
21134
21135 case WDI_LINK_IBSS_STATE:
21136 return eSIR_LINK_IBSS_STATE;
21137
21138 case WDI_LINK_BTAMP_PREASSOC_STATE:
21139 return eSIR_LINK_BTAMP_PREASSOC_STATE;
21140
21141 case WDI_LINK_BTAMP_POSTASSOC_STATE:
21142 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
21143
21144 case WDI_LINK_BTAMP_AP_STATE:
21145 return eSIR_LINK_BTAMP_AP_STATE;
21146
21147 case WDI_LINK_BTAMP_STA_STATE:
21148 return eSIR_LINK_BTAMP_STA_STATE;
21149
21150 case WDI_LINK_LEARN_STATE:
21151 return eSIR_LINK_LEARN_STATE;
21152
21153 case WDI_LINK_SCAN_STATE:
21154 return eSIR_LINK_SCAN_STATE;
21155
21156 case WDI_LINK_FINISH_SCAN_STATE:
21157 return eSIR_LINK_FINISH_SCAN_STATE;
21158
21159 case WDI_LINK_INIT_CAL_STATE:
21160 return eSIR_LINK_INIT_CAL_STATE;
21161
21162 case WDI_LINK_FINISH_CAL_STATE:
21163 return eSIR_LINK_FINISH_CAL_STATE;
21164
21165#ifdef WLAN_FEATURE_P2P
21166 case WDI_LINK_LISTEN_STATE:
21167 return eSIR_LINK_LISTEN_STATE;
21168#endif
21169
21170 default:
21171 return eSIR_LINK_MAX;
Jeff Johnsone7245742012-09-05 17:12:55 -070021172 }
Jeff Johnson295189b2012-06-20 16:38:30 -070021173}
21174
Jeff Johnsone7245742012-09-05 17:12:55 -070021175/*Translate a STA Context from WDI into HAL*/
21176WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -070021177void
21178WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -070021179(
Jeff Johnson295189b2012-06-20 16:38:30 -070021180 tConfigStaParams* phalConfigSta,
21181 WDI_ConfigStaReqInfoType* pwdiConfigSta
21182)
21183{
21184 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070021185#ifdef WLAN_FEATURE_11AC
21186 /* Get the Version 1 Handler */
21187 tConfigStaParams_V1* phalConfigSta_V1 = NULL;
21188 if (WDI_getFwWlanFeatCaps(DOT11AC))
21189 {
21190 phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta;
21191 }
21192#endif
21193 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021194 the chances of getting inlined*/
21195
Jeff Johnsone7245742012-09-05 17:12:55 -070021196 wpalMemoryCopy(phalConfigSta->bssId,
21197 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
21198
21199 wpalMemoryCopy(phalConfigSta->staMac,
21200 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070021201
21202 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
21203 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
21204 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
21205 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
21206 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
21207 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
21208 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
21209 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
21210 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
21211 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
21212 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
21213 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
21214 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
21215 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
21216 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
21217 phalConfigSta->action = pwdiConfigSta->wdiAction;
21218 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
21219 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
21220 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
21221 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
21222 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
21223 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
21224 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
Jeff Johnsone7245742012-09-05 17:12:55 -070021225
Jeff Johnson295189b2012-06-20 16:38:30 -070021226 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
21227
Jeff Johnsone7245742012-09-05 17:12:55 -070021228 phalConfigSta->supportedRates.opRateMode =
Jeff Johnson295189b2012-06-20 16:38:30 -070021229 pwdiConfigSta->wdiSupportedRates.opRateMode;
21230 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
21231 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021232 phalConfigSta->supportedRates.llbRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021233 pwdiConfigSta->wdiSupportedRates.llbRates[i];
21234 }
21235 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
21236 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021237 phalConfigSta->supportedRates.llaRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021238 pwdiConfigSta->wdiSupportedRates.llaRates[i];
21239 }
21240 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
21241 {
21242 phalConfigSta->supportedRates.aniLegacyRates[i] =
21243 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
21244 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021245 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070021246 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
21247 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
21248 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021249 phalConfigSta->supportedRates.supportedMCSSet[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021250 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
21251 }
21252 phalConfigSta->supportedRates.rxHighestDataRate =
21253 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
21254
Jeff Johnsone7245742012-09-05 17:12:55 -070021255#ifdef WLAN_FEATURE_11AC
21256 if(phalConfigSta_V1 != NULL)
21257 {
21258 phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap;
21259 phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate;
21260 phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap;
21261 phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate;
21262 }
21263#endif
21264
Jeff Johnson295189b2012-06-20 16:38:30 -070021265#ifdef WLAN_FEATURE_P2P
21266 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
21267#endif
21268
Jeff Johnsone7245742012-09-05 17:12:55 -070021269#ifdef WLAN_FEATURE_11AC
21270 if(phalConfigSta_V1 != NULL)
21271 {
21272 phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta;
21273 phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet;
21274 }
21275#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021276}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
Jeff Johnsone7245742012-09-05 17:12:55 -070021277
21278/*Translate a Rate set info from WDI into HAL*/
21279WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070021280WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -070021281(
Jeff Johnson295189b2012-06-20 16:38:30 -070021282 tSirMacRateSet* pHalRateSet,
21283 WDI_RateSet* pwdiRateSet
21284)
21285{
Jeff Johnsone7245742012-09-05 17:12:55 -070021286 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070021287 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21288
21289 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
21290 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
21291
21292 for ( i = 0; i < pHalRateSet->numRates; i++ )
21293 {
21294 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
21295 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021296
Jeff Johnson295189b2012-06-20 16:38:30 -070021297}/*WDI_CopyWDIRateSetToHALRateSet*/
21298
21299
21300/*Translate an EDCA Parameter Record from WDI into HAL*/
21301WPT_STATIC WPT_INLINE void
21302WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -070021303(
Jeff Johnson295189b2012-06-20 16:38:30 -070021304 tSirMacEdcaParamRecord* phalEdcaParam,
21305 WDI_EdcaParamRecord* pWDIEdcaParam
21306)
21307{
Jeff Johnsone7245742012-09-05 17:12:55 -070021308 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021309 the chances of getting inlined*/
21310
21311 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
21312 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
21313 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
21314 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
21315
21316 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
21317 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
21318 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
21319}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
21320
21321
21322/*Copy a management frame header from WDI fmt into HAL fmt*/
21323WPT_STATIC WPT_INLINE void
21324WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
21325(
21326 tSirMacMgmtHdr* pmacMgmtHdr,
21327 WDI_MacMgmtHdr* pwdiMacMgmtHdr
21328)
21329{
21330 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
21331 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
21332 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
21333 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
21334 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
21335 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
21336 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
21337 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
21338 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
21339 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
21340 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
21341
21342 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
21343 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
21344
Jeff Johnsone7245742012-09-05 17:12:55 -070021345 wpalMemoryCopy(pmacMgmtHdr->da,
Jeff Johnson295189b2012-06-20 16:38:30 -070021346 pwdiMacMgmtHdr->da, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021347 wpalMemoryCopy(pmacMgmtHdr->sa,
Jeff Johnson295189b2012-06-20 16:38:30 -070021348 pwdiMacMgmtHdr->sa, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021349 wpalMemoryCopy(pmacMgmtHdr->bssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070021350 pwdiMacMgmtHdr->bssId, 6);
21351
21352 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
21353 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
21354 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
21355
21356}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
21357
21358
21359/*Copy config bss parameters from WDI fmt into HAL fmt*/
21360WPT_STATIC WPT_INLINE void
21361WDI_CopyWDIConfigBSSToHALConfigBSS
21362(
21363 tConfigBssParams* phalConfigBSS,
21364 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
21365)
21366{
21367
21368 wpt_uint8 keyIndex = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070021369#ifdef WLAN_FEATURE_11AC
21370 /* Get the Version 1 Handler */
21371 tConfigBssParams_V1* phalConfigBSS_V1 = NULL;
21372 if (WDI_getFwWlanFeatCaps(DOT11AC))
21373 phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS;
21374#endif
21375
Jeff Johnson295189b2012-06-20 16:38:30 -070021376 wpalMemoryCopy( phalConfigBSS->bssId,
21377 pwdiConfigBSS->macBSSID,
21378 WDI_MAC_ADDR_LEN);
21379
21380#ifdef HAL_SELF_STA_PER_BSS
21381 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
21382 pwdiConfigBSS->macSelfAddr,
21383 WDI_MAC_ADDR_LEN);
21384#endif
21385
21386 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
21387
21388 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
21389 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
21390
Jeff Johnsone7245742012-09-05 17:12:55 -070021391 phalConfigBSS->shortSlotTimeSupported =
Jeff Johnson295189b2012-06-20 16:38:30 -070021392 pwdiConfigBSS->ucShortSlotTimeSupported;
21393 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
21394 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
21395 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
21396 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
21397 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070021398 phalConfigBSS->fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070021399 pwdiConfigBSS->ucTXOPProtectionFullSupport;
21400 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
21401 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
21402 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
21403 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
21404 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
21405 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
21406 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
21407 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
21408 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
21409 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
21410
Jeff Johnsone7245742012-09-05 17:12:55 -070021411 phalConfigBSS->htOperMode =
21412 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
Jeff Johnson295189b2012-06-20 16:38:30 -070021413
21414 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
21415 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
21416 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
21417 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
21418
21419#ifdef WLAN_FEATURE_VOWIFI
21420 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
21421#endif
21422
21423 /*! Used 32 as magic number because that is how the ssid is declared inside the
21424 hal header - hal needs a macro for it */
Jeff Johnsone7245742012-09-05 17:12:55 -070021425 phalConfigBSS->ssId.length =
Jeff Johnson295189b2012-06-20 16:38:30 -070021426 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
21427 pwdiConfigBSS->wdiSSID.ucLength : 32;
21428 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070021429 pwdiConfigBSS->wdiSSID.sSSID,
21430 phalConfigBSS->ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070021431
21432 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
21433 &pwdiConfigBSS->wdiSTAContext);
Jeff Johnsone7245742012-09-05 17:12:55 -070021434
Jeff Johnson295189b2012-06-20 16:38:30 -070021435 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
21436 &pwdiConfigBSS->wdiRateSet);
21437
21438 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21439
21440 if(phalConfigBSS->edcaParamsValid)
21441 {
21442 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21443 &pwdiConfigBSS->wdiBEEDCAParams);
21444 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21445 &pwdiConfigBSS->wdiBKEDCAParams);
21446 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21447 &pwdiConfigBSS->wdiVIEDCAParams);
21448 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21449 &pwdiConfigBSS->wdiVOEDCAParams);
21450 }
21451
Jeff Johnsone7245742012-09-05 17:12:55 -070021452 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
Jeff Johnson295189b2012-06-20 16:38:30 -070021453
21454 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21455
21456#ifdef WLAN_FEATURE_VOWIFI_11R
21457
Jeff Johnsone7245742012-09-05 17:12:55 -070021458 phalConfigBSS->extSetStaKeyParamValid =
Jeff Johnson295189b2012-06-20 16:38:30 -070021459 pwdiConfigBSS->bExtSetStaKeyParamValid;
Jeff Johnsone7245742012-09-05 17:12:55 -070021460
Jeff Johnson295189b2012-06-20 16:38:30 -070021461 if( phalConfigBSS->extSetStaKeyParamValid )
21462 {
21463 /*-----------------------------------------------------------------------
21464 Copy the STA Key parameters into the HAL message
21465 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021466 phalConfigBSS->extSetStaKeyParam.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021467 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21468
Jeff Johnsone7245742012-09-05 17:12:55 -070021469 phalConfigBSS->extSetStaKeyParam.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021470 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21471
21472 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21473
21474 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21475
21476 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21477
21478#ifdef WLAN_SOFTAP_FEATURE
21479 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21480 keyIndex++)
21481 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021482 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021483 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21484 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21485 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21486 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21487 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21488 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021489 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021490 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021491 phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021492 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021493 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021494 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21495 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021496 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021497 WDI_MAX_KEY_LENGTH);
21498 }
21499#else
Jeff Johnsone7245742012-09-05 17:12:55 -070021500 phalConfigBSS->extSetStaKeyParam.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021501 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21502 phalConfigBSS->extSetStaKeyParam.key.unicast =
21503 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21504 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21505 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21506 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021507 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021508 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021509 phalConfigBSS->extSetStaKeyParam.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021510 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021511 phalConfigBSS->extSetStaKeyParam.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021512 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21513 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021514 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021515 WDI_MAX_KEY_LENGTH);
21516#endif
21517 }
21518 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21519 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021520 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070021521 sizeof(phalConfigBSS->extSetStaKeyParam) );
21522 }
21523
21524#endif /*WLAN_FEATURE_VOWIFI_11R*/
21525
Jeff Johnsone7245742012-09-05 17:12:55 -070021526#ifdef WLAN_FEATURE_11AC
21527 if(phalConfigBSS_V1 != NULL)
21528 {
21529 phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta;
21530 phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet;
21531 }
21532#endif
21533
Jeff Johnson295189b2012-06-20 16:38:30 -070021534}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21535
21536
Jeff Johnsone7245742012-09-05 17:12:55 -070021537/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -070021538 pointed to by user data */
21539WPT_STATIC WPT_INLINE void
21540WDI_ExtractRequestCBFromEvent
21541(
21542 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -070021543 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -070021544 void** ppUserData
21545)
21546{
21547 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21548 switch ( pEvent->wdiRequest )
21549 {
21550 case WDI_START_REQ:
21551 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21552 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21553 break;
21554 case WDI_STOP_REQ:
21555 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21556 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21557 break;
21558 case WDI_INIT_SCAN_REQ:
21559 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21560 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21561 break;
21562 case WDI_START_SCAN_REQ:
21563 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21564 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21565 break;
21566 case WDI_END_SCAN_REQ:
21567 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21568 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21569 break;
21570 case WDI_FINISH_SCAN_REQ:
21571 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21572 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21573 break;
21574 case WDI_JOIN_REQ:
21575 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21576 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21577 break;
21578 case WDI_CONFIG_BSS_REQ:
21579 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21580 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21581 break;
21582 case WDI_DEL_BSS_REQ:
21583 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21584 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21585 break;
21586 case WDI_POST_ASSOC_REQ:
21587 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21588 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21589 break;
21590 case WDI_DEL_STA_REQ:
21591 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21592 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21593 break;
21594 case WDI_DEL_STA_SELF_REQ:
21595 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21596 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21597 break;
21598
21599 case WDI_SET_BSS_KEY_REQ:
21600 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21601 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21602 break;
21603 case WDI_RMV_BSS_KEY_REQ:
21604 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21605 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21606 break;
21607 case WDI_SET_STA_KEY_REQ:
21608 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21609 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21610 break;
21611 case WDI_RMV_STA_KEY_REQ:
21612 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21613 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21614 break;
21615 case WDI_ADD_TS_REQ:
21616 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21617 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21618 break;
21619 case WDI_DEL_TS_REQ:
21620 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21621 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21622 break;
21623 case WDI_UPD_EDCA_PRMS_REQ:
21624 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21625 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21626 break;
21627 case WDI_ADD_BA_SESSION_REQ:
21628 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21629 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21630 break;
21631 case WDI_DEL_BA_REQ:
21632 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21633 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21634 break;
21635#ifdef FEATURE_WLAN_CCX
21636 case WDI_TSM_STATS_REQ:
21637 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21638 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21639 break;
21640#endif
21641 case WDI_CH_SWITCH_REQ:
21642 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21643 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21644 break;
21645 case WDI_CONFIG_STA_REQ:
21646 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21647 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21648 break;
21649 case WDI_SET_LINK_ST_REQ:
21650 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21651 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21652 break;
21653 case WDI_GET_STATS_REQ:
21654 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21655 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21656 break;
21657 case WDI_UPDATE_CFG_REQ:
21658 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21659 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21660 break;
21661 case WDI_ADD_BA_REQ:
21662 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21663 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21664 break;
21665 case WDI_TRIGGER_BA_REQ:
21666 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21667 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21668 break;
21669 case WDI_UPD_BCON_PRMS_REQ:
21670 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21671 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21672 break;
21673 case WDI_SND_BCON_REQ:
21674 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21675 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21676 break;
21677 case WDI_ENTER_BMPS_REQ:
21678 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21679 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21680 break;
21681 case WDI_EXIT_BMPS_REQ:
21682 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21683 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21684 break;
21685 case WDI_ENTER_UAPSD_REQ:
21686 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21687 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21688 break;
21689 case WDI_UPDATE_UAPSD_PARAM_REQ:
21690 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21691 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21692 break;
21693 case WDI_CONFIGURE_RXP_FILTER_REQ:
21694 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21695 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21696 break;
21697 case WDI_SET_BEACON_FILTER_REQ:
21698 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21699 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21700 break;
21701 case WDI_REM_BEACON_FILTER_REQ:
21702 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21703 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070021704 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021705 case WDI_SET_RSSI_THRESHOLDS_REQ:
21706 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21707 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21708 break;
21709 case WDI_HOST_OFFLOAD_REQ:
21710 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21711 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21712 break;
21713 case WDI_WOWL_ADD_BC_PTRN_REQ:
21714 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21715 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21716 break;
21717 case WDI_WOWL_DEL_BC_PTRN_REQ:
21718 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21719 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21720 break;
21721 case WDI_WOWL_ENTER_REQ:
21722 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21723 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21724 break;
21725 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21726 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21727 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21728 break;
21729 case WDI_FLUSH_AC_REQ:
21730 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21731 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21732 break;
21733 case WDI_BTAMP_EVENT_REQ:
21734 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21735 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21736 break;
21737 case WDI_KEEP_ALIVE_REQ:
21738 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21739 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21740 break;
21741 case WDI_SET_TX_PER_TRACKING_REQ:
21742 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21743 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21744 default:
21745 *ppfnReqCB = NULL;
21746 *ppUserData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070021747 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021748 }
21749}/*WDI_ExtractRequestCBFromEvent*/
21750
21751
21752/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021753 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
Jeff Johnson295189b2012-06-20 16:38:30 -070021754 frame xtl is enabled for a particular STA.
21755
21756 WDI_PostAssocReq must have been called.
21757
Jeff Johnsone7245742012-09-05 17:12:55 -070021758 @param uSTAIdx: STA index
21759
Jeff Johnson295189b2012-06-20 16:38:30 -070021760 @see WDI_PostAssocReq
21761 @return Result of the function call
21762*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021763wpt_boolean
Jeff Johnson295189b2012-06-20 16:38:30 -070021764WDI_IsHwFrameTxTranslationCapable
21765(
21766 wpt_uint8 uSTAIdx
21767)
21768{
Jeff Johnsone7245742012-09-05 17:12:55 -070021769 /*!! FIX ME - this must eventually be per station - for now just feedback
Jeff Johnson295189b2012-06-20 16:38:30 -070021770 uma value*/
21771 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021772 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021773 ------------------------------------------------------------------------*/
21774 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21775 {
21776 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21777 "WDI API call before module is initialized - Fail request");
21778
Jeff Johnsone7245742012-09-05 17:12:55 -070021779 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021780 }
21781
Jeff Johnsone7245742012-09-05 17:12:55 -070021782
Jeff Johnson295189b2012-06-20 16:38:30 -070021783 return gWDICb.bFrameTransEnabled;
21784}/*WDI_IsHwFrameTxTranslationCapable*/
21785
21786#ifdef FEATURE_WLAN_SCAN_PNO
21787/**
21788 @brief WDI_SetPreferredNetworkList
21789
Jeff Johnsone7245742012-09-05 17:12:55 -070021790 @param pwdiPNOScanReqParams: the Set PNO as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070021791 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021792
Jeff Johnson295189b2012-06-20 16:38:30 -070021793 wdiPNOScanCb: callback for passing back the response
21794 of the Set PNO operation received from the
21795 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021796
Jeff Johnson295189b2012-06-20 16:38:30 -070021797 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021798 callback
21799
Jeff Johnson295189b2012-06-20 16:38:30 -070021800 @return Result of the function call
21801*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021802WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021803WDI_SetPreferredNetworkReq
21804(
21805 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21806 WDI_PNOScanCb wdiPNOScanCb,
21807 void* pUserData
21808)
21809{
21810 WDI_EventInfoType wdiEventData = {{0}};
21811 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21812
21813 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021814 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021815 ------------------------------------------------------------------------*/
21816 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21817 {
21818 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21819 "WDI API call before module is initialized - Fail request");
21820
Jeff Johnsone7245742012-09-05 17:12:55 -070021821 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021822 }
21823
21824 /*------------------------------------------------------------------------
21825 Fill in Event data and post to the Main FSM
21826 ------------------------------------------------------------------------*/
21827 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021828 wdiEventData.pEventData = pwdiPNOScanReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070021829 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070021830 wdiEventData.pCBfnc = wdiPNOScanCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021831 wdiEventData.pUserData = pUserData;
21832
21833 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21834}
21835
21836
21837/**
21838 @brief WDI_SetRssiFilterReq
21839
Jeff Johnsone7245742012-09-05 17:12:55 -070021840 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
Jeff Johnson295189b2012-06-20 16:38:30 -070021841 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021842
Jeff Johnson295189b2012-06-20 16:38:30 -070021843 wdiRssiFilterCb: callback for passing back the response
21844 of the Set RSSI Filter operation received from the
21845 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021846
Jeff Johnson295189b2012-06-20 16:38:30 -070021847 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021848 callback
21849
Jeff Johnson295189b2012-06-20 16:38:30 -070021850 @return Result of the function call
21851*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021852WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021853WDI_SetRssiFilterReq
21854(
21855 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
21856 WDI_RssiFilterCb wdiRssiFilterCb,
21857 void* pUserData
21858)
21859{
21860 WDI_EventInfoType wdiEventData = {{0}};
21861 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21862
21863 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021864 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021865 ------------------------------------------------------------------------*/
21866 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21867 {
21868 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21869 "WDI API call before module is initialized - Fail request");
21870
Jeff Johnsone7245742012-09-05 17:12:55 -070021871 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021872 }
21873
21874 /*------------------------------------------------------------------------
21875 Fill in Event data and post to the Main FSM
21876 ------------------------------------------------------------------------*/
21877 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021878 wdiEventData.pEventData = pwdiRssiFilterReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070021879 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070021880 wdiEventData.pCBfnc = wdiRssiFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021881 wdiEventData.pUserData = pUserData;
21882
21883 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21884}/*WDI_SetRssiFilterReq*/
21885
21886/**
21887 @brief WDI_UpdateScanParamsReq
21888
Jeff Johnsone7245742012-09-05 17:12:55 -070021889 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070021890 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070021891
Jeff Johnson295189b2012-06-20 16:38:30 -070021892 wdiUpdateScanParamsCb: callback for passing back the response
21893 of the Set PNO operation received from the
21894 device
Jeff Johnsone7245742012-09-05 17:12:55 -070021895
Jeff Johnson295189b2012-06-20 16:38:30 -070021896 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070021897 callback
21898
Jeff Johnson295189b2012-06-20 16:38:30 -070021899 @return Result of the function call
21900*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021901WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070021902WDI_UpdateScanParamsReq
21903(
21904 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
21905 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
21906 void* pUserData
21907)
21908{
21909 WDI_EventInfoType wdiEventData = {{0}};
21910 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21911
21912 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021913 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021914 ------------------------------------------------------------------------*/
21915 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21916 {
21917 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21918 "WDI API call before module is initialized - Fail request");
21919
Jeff Johnsone7245742012-09-05 17:12:55 -070021920 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021921 }
21922
21923 /*------------------------------------------------------------------------
21924 Fill in Event data and post to the Main FSM
21925 ------------------------------------------------------------------------*/
21926 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070021927 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
Jeff Johnson295189b2012-06-20 16:38:30 -070021928 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
Jeff Johnsone7245742012-09-05 17:12:55 -070021929 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070021930 wdiEventData.pUserData = pUserData;
21931
21932 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
21933}
21934
21935/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021936 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070021937 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070021938
21939 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070021940 pwdiPNOScanReqParams: pointer to the info received
21941 from upper layers
21942 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070021943 and its size
21944
Jeff Johnson295189b2012-06-20 16:38:30 -070021945 @return Result of the function call
21946*/
21947
21948WDI_Status
21949WDI_PackPreferredNetworkList
21950(
21951 WDI_ControlBlockType* pWDICtx,
21952 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
21953 wpt_uint8** ppSendBuffer,
21954 wpt_uint16* pSize
21955)
21956{
Jeff Johnsone7245742012-09-05 17:12:55 -070021957 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070021958 wpt_uint16 usDataOffset = 0;
21959 wpt_uint16 usSendSize = 0;
21960 tPrefNetwListParams pPrefNetwListParams = {0};
21961 wpt_uint8 i;
21962 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
21963
21964 /*-----------------------------------------------------------------------
21965 Get message buffer
21966 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021967 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070021968 sizeof(pPrefNetwListParams),
21969 &pSendBuffer, &usDataOffset, &usSendSize))||
21970 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
21971 {
21972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
21973 "Unable to get send buffer in Set PNO req %x ",
21974 pwdiPNOScanReqParams);
21975 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070021976 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021977 }
21978
21979 /*-------------------------------------------------------------------------
21980 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
21981 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021982 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070021983 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070021984 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070021985 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
21986
Jeff Johnsone7245742012-09-05 17:12:55 -070021987 pPrefNetwListParams.ucNetworksCount =
21988 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070021989 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070021990 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070021991 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
21992
21993 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070021994 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070021995 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
21996 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
21997 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
21998
21999 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22000 {
22001 /*SSID of the BSS*/
22002 pPrefNetwListParams.aNetworks[i].ssId.length
22003 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22004
22005 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22006 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22007 pPrefNetwListParams.aNetworks[i].ssId.length);
22008
22009 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022010 pPrefNetwListParams.aNetworks[i].authentication =
22011 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022012
22013 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022014 pPrefNetwListParams.aNetworks[i].encryption =
22015 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022016
Jeff Johnsone7245742012-09-05 17:12:55 -070022017 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022018 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022019 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022020 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22021
22022 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22023 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22024 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22025
22026 /*Indicates the RSSI threshold for the network to be considered*/
22027 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22028 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22029
22030 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022031 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022032 pPrefNetwListParams.aNetworks[i].ssId.length,
22033 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22034 }
22035
Jeff Johnsone7245742012-09-05 17:12:55 -070022036 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22037 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022038 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22039 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22040 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22041
22042 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022043 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022044 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22045 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22046 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22047
22048 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22049 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022050 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022051 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022052 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022053 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22054 }
22055
22056 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022057 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022058 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22059 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22060 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022061 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022062
Jeff Johnsone7245742012-09-05 17:12:55 -070022063 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22064 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22065 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022066
Jeff Johnsone7245742012-09-05 17:12:55 -070022067 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022068 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22069 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22070 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022071 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022072
Jeff Johnsone7245742012-09-05 17:12:55 -070022073 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22074 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22075 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022076
22077 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022078 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22079 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022080
22081 /*Set the output values*/
22082 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022083 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022084
22085 return WDI_STATUS_SUCCESS;
22086}/*WDI_PackPreferredNetworkList*/
22087
22088/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022089 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022090 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022091
22092 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022093 pwdiPNOScanReqParams: pointer to the info received
22094 from upper layers
22095 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022096 and its size
22097
Jeff Johnson295189b2012-06-20 16:38:30 -070022098 @return Result of the function call
22099*/
22100
22101WDI_Status
22102WDI_PackPreferredNetworkListNew
22103(
22104 WDI_ControlBlockType* pWDICtx,
22105 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22106 wpt_uint8** ppSendBuffer,
22107 wpt_uint16* pSize
22108)
22109{
Jeff Johnsone7245742012-09-05 17:12:55 -070022110 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022111 wpt_uint16 usDataOffset = 0;
22112 wpt_uint16 usSendSize = 0;
22113 tPrefNetwListParamsNew pPrefNetwListParams;
22114 wpt_uint8 i;
22115 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
22116
22117 /*-----------------------------------------------------------------------
22118 Get message buffer
22119 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022120 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022121 sizeof(pPrefNetwListParams),
22122 &pSendBuffer, &usDataOffset, &usSendSize))||
22123 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
22124 {
22125 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22126 "Unable to get send buffer in Set PNO req %x ",
22127 pwdiPNOScanReqParams);
22128 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022129 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022130 }
22131
22132 /*-------------------------------------------------------------------------
22133 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22134 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022135 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022136 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070022137 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022138 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22139
Jeff Johnsone7245742012-09-05 17:12:55 -070022140 pPrefNetwListParams.ucNetworksCount =
22141 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022142 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022143 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022144 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22145
22146 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022147 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022148 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22149 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22150 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22151
22152 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22153 {
22154 /*SSID of the BSS*/
22155 pPrefNetwListParams.aNetworks[i].ssId.length
22156 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22157
22158 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22159 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22160 pPrefNetwListParams.aNetworks[i].ssId.length);
22161
22162 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022163 pPrefNetwListParams.aNetworks[i].authentication =
22164 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022165
22166 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022167 pPrefNetwListParams.aNetworks[i].encryption =
22168 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022169
22170 /*SSID bcast type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022171 pPrefNetwListParams.aNetworks[i].bcastNetworkType =
22172 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022173
Jeff Johnsone7245742012-09-05 17:12:55 -070022174 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022175 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022176 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022177 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22178
22179 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22180 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22181 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22182
22183 /*Indicates the RSSI threshold for the network to be considered*/
22184 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22185 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22186
22187 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022188 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022189 pPrefNetwListParams.aNetworks[i].ssId.length,
22190 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22191 }
22192
Jeff Johnsone7245742012-09-05 17:12:55 -070022193 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22194 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022195 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22196 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22197 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22198
22199 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022200 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022201 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22202 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22203 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22204
22205 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22206 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022207 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022208 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022209 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022210 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22211 }
22212
22213 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022214 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022215 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22216 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22217 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022218 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022219
Jeff Johnsone7245742012-09-05 17:12:55 -070022220 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22221 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22222 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022223
Jeff Johnsone7245742012-09-05 17:12:55 -070022224 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022225 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22226 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22227 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022228 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022229
Jeff Johnsone7245742012-09-05 17:12:55 -070022230 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22231 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22232 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022233
22234 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022235 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22236 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022237
22238 /*Set the output values*/
22239 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022240 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022241
22242 return WDI_STATUS_SUCCESS;
22243}/*WDI_PackPreferredNetworkListNew*/
22244
22245/**
22246 @brief Process Set Preferred Network List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022247
22248 @param pWDICtx: pointer to the WLAN DAL context
22249 pEventData: pointer to the event information structure
22250
Jeff Johnson295189b2012-06-20 16:38:30 -070022251 @return Result of the function call
22252*/
22253WDI_Status
22254WDI_ProcessSetPreferredNetworkReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022255(
Jeff Johnson295189b2012-06-20 16:38:30 -070022256 WDI_ControlBlockType* pWDICtx,
22257 WDI_EventInfoType* pEventData
22258)
22259{
22260 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
22261 WDI_PNOScanCb wdiPNOScanCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022262 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022263 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070022264 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022265
22266 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022267 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022268 -------------------------------------------------------------------------*/
22269 if (( NULL == pEventData ) ||
22270 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
22271 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
22272 {
22273 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22274 "%s: Invalid parameters", __FUNCTION__);
22275 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022276 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022277 }
22278
22279 /*-------------------------------------------------------------------------
22280 Pack the PNO request structure based on version
22281 -------------------------------------------------------------------------*/
22282 if ( pWDICtx->wdiPNOVersion > 0 )
22283 {
22284 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022285 "%s: PNO new version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022286 pWDICtx->wdiPNOVersion);
22287
22288 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
22289 &pSendBuffer, &usSendSize);
22290 }
22291 else
22292 {
22293 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022294 "%s: PNO old version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022295 pWDICtx->wdiPNOVersion);
22296
22297 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
22298 &pSendBuffer, &usSendSize);
22299 }
22300
22301 if (( WDI_STATUS_SUCCESS != wdiStatus )||
22302 ( NULL == pSendBuffer )||( 0 == usSendSize ))
22303 {
22304 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22305 "%s: failed to pack request parameters", __FUNCTION__);
22306 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022307 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022308 }
22309
22310 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022311 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022312
22313 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022314 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022315 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022316 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22317 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022318}
22319
22320/**
22321 @brief Process Set RSSI Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022322
22323 @param pWDICtx: pointer to the WLAN DAL context
22324 pEventData: pointer to the event information structure
22325
Jeff Johnson295189b2012-06-20 16:38:30 -070022326 @see
22327 @return Result of the function call
22328*/
22329WDI_Status
22330WDI_ProcessSetRssiFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022331(
Jeff Johnson295189b2012-06-20 16:38:30 -070022332 WDI_ControlBlockType* pWDICtx,
22333 WDI_EventInfoType* pEventData
22334)
22335{
22336 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
22337 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022338 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022339 wpt_uint16 usDataOffset = 0;
22340 wpt_uint16 usSendSize = 0;
22341 wpt_uint8 ucRssiThreshold;
22342
22343 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022344 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022345 -------------------------------------------------------------------------*/
22346 if (( NULL == pEventData ) ||
22347 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
22348 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
22349 {
22350 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22351 "%s: Invalid parameters", __FUNCTION__);
22352 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022353 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022354 }
22355
22356 /*-----------------------------------------------------------------------
22357 Get message buffer
22358 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022359 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022360 sizeof(ucRssiThreshold),
22361 &pSendBuffer, &usDataOffset, &usSendSize))||
22362 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
22363 {
22364 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22365 "Unable to get send buffer in Set PNO req %x %x %x",
22366 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
22367 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022368 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022369 }
22370
22371 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
22372
Jeff Johnsone7245742012-09-05 17:12:55 -070022373 wpalMemoryCopy( pSendBuffer+usDataOffset,
22374 &ucRssiThreshold,
22375 sizeof(ucRssiThreshold));
Jeff Johnson295189b2012-06-20 16:38:30 -070022376
22377 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022378 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022379
22380 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022381 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022382 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022383 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22384 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022385}
22386
22387
22388/**
22389 @brief Process Update Scan Params function
Jeff Johnsone7245742012-09-05 17:12:55 -070022390
22391 @param pWDICtx: pointer to the WLAN DAL context
22392 pEventData: pointer to the event information structure
22393
Jeff Johnson295189b2012-06-20 16:38:30 -070022394 @see
22395 @return Result of the function call
22396*/
22397WDI_Status
22398WDI_ProcessUpdateScanParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022399(
Jeff Johnson295189b2012-06-20 16:38:30 -070022400 WDI_ControlBlockType* pWDICtx,
22401 WDI_EventInfoType* pEventData
22402)
22403{
22404 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
22405 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022406 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022407 wpt_uint16 usDataOffset = 0;
22408 wpt_uint16 usSendSize = 0;
22409 tUpdateScanParams updateScanParams = {0};
22410
22411
22412 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022413 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022414 -------------------------------------------------------------------------*/
22415 if (( NULL == pEventData ) ||
22416 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
22417 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
22418 {
22419 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22420 "%s: Invalid parameters", __FUNCTION__);
22421 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022422 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022423 }
22424
22425 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22426 "Begin WDI Update Scan Parameters");
22427 /*-----------------------------------------------------------------------
22428 Get message buffer
22429 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022430 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022431 sizeof(updateScanParams),
22432 &pSendBuffer, &usDataOffset, &usSendSize))||
22433 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
22434 {
22435 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22436 "Unable to get send buffer in Update Scan Params req %x %x %x",
22437 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
22438 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022439 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022440 }
22441
22442 //
22443 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
22444 //
22445
22446 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22447 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
Jeff Johnsone7245742012-09-05 17:12:55 -070022448 updateScanParams.ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022449 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22450 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22451 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22452 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22453
Jeff Johnsone7245742012-09-05 17:12:55 -070022454 wpalMemoryCopy( updateScanParams.aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022455 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22456 updateScanParams.ucChannelCount);
22457
22458 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22459 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22460 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22461 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22462 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22463
Jeff Johnsone7245742012-09-05 17:12:55 -070022464 wpalMemoryCopy( pSendBuffer+usDataOffset,
22465 &updateScanParams,
22466 sizeof(updateScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022467
22468 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022469 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022470
22471 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22472 "End Update Scan Parameters");
22473 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022474 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022475 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022476 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22477 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022478}
22479
22480/**
22481 @brief Process Preferred Network Found Indication function
Jeff Johnsone7245742012-09-05 17:12:55 -070022482
22483 @param pWDICtx: pointer to the WLAN DAL context
22484 pEventData: pointer to the event information structure
22485
Jeff Johnson295189b2012-06-20 16:38:30 -070022486 @see
22487 @return Result of the function call
22488*/
22489WDI_Status
22490WDI_ProcessPrefNetworkFoundInd
Jeff Johnsone7245742012-09-05 17:12:55 -070022491(
Jeff Johnson295189b2012-06-20 16:38:30 -070022492 WDI_ControlBlockType* pWDICtx,
22493 WDI_EventInfoType* pEventData
22494)
22495{
22496 WDI_LowLevelIndType wdiInd;
22497 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22498
22499
22500 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022501 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022502 -------------------------------------------------------------------------*/
22503 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22504 ( NULL == pEventData->pEventData ))
22505 {
22506 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22507 "%s: Invalid parameters", __FUNCTION__);
22508 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070022509 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022510 }
22511
22512 /*-------------------------------------------------------------------------
22513 Extract indication and send it to UMAC
22514 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022515 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22516 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022517 sizeof(tPrefNetwFoundParams));
22518
22519 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022520 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070022521
22522 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22523
Jeff Johnsone7245742012-09-05 17:12:55 -070022524 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070022525 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
Jeff Johnsone7245742012-09-05 17:12:55 -070022526 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
Jeff Johnson295189b2012-06-20 16:38:30 -070022527
Jeff Johnsone7245742012-09-05 17:12:55 -070022528 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22529 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022530 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22531
22532 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22533 prefNetwFoundInd.prefNetwFoundParams.rssi;
22534
22535 // DEBUG
22536 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22537 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22538 wdiInd.wdiIndicationType,
22539 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22540 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22541
22542 /*Notify UMAC*/
22543 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070022544
22545 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022546}
22547
22548/**
22549 @brief Process PNO Rsp function (called when a
22550 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022551
22552 @param pWDICtx: pointer to the WLAN DAL context
22553 pEventData: pointer to the event information structure
22554
Jeff Johnson295189b2012-06-20 16:38:30 -070022555 @see
22556 @return Result of the function call
22557*/
22558WDI_Status
22559WDI_ProcessSetPreferredNetworkRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022560(
Jeff Johnson295189b2012-06-20 16:38:30 -070022561 WDI_ControlBlockType* pWDICtx,
22562 WDI_EventInfoType* pEventData
22563)
22564{
22565 WDI_Status wdiStatus;
22566 eHalStatus halStatus;
22567 WDI_PNOScanCb wdiPNOScanCb = NULL;
22568 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22569
22570 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022571 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022572 -------------------------------------------------------------------------*/
22573 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22574 ( NULL == pEventData->pEventData ))
22575 {
22576 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22577 "%s: Invalid parameters", __FUNCTION__);
22578 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022579 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022580 }
22581
22582
Jeff Johnsone7245742012-09-05 17:12:55 -070022583 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022584
22585 /*-------------------------------------------------------------------------
22586 Extract response and send it to UMAC
22587 -------------------------------------------------------------------------*/
22588 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022589 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022590
22591 /*Notify UMAC*/
22592 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22593
Jeff Johnsone7245742012-09-05 17:12:55 -070022594 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022595}/*WDI_ProcessSetPreferredNetworkRsp*/
22596
22597/**
22598 @brief Process RSSI Filter Rsp function (called when a
22599 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022600
22601 @param pWDICtx: pointer to the WLAN DAL context
22602 pEventData: pointer to the event information structure
22603
Jeff Johnson295189b2012-06-20 16:38:30 -070022604 @see
22605 @return Result of the function call
22606*/
22607WDI_Status
22608WDI_ProcessSetRssiFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022609(
Jeff Johnson295189b2012-06-20 16:38:30 -070022610 WDI_ControlBlockType* pWDICtx,
22611 WDI_EventInfoType* pEventData
22612)
22613{
22614 WDI_Status wdiStatus;
22615 eHalStatus halStatus;
22616 WDI_RssiFilterCb wdiRssiFilterCb;
22617 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22618
22619 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022620 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022621 -------------------------------------------------------------------------*/
22622 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22623 ( NULL == pEventData->pEventData ))
22624 {
22625 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22626 "%s: Invalid parameters", __FUNCTION__);
22627 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022628 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022629 }
22630
Jeff Johnsone7245742012-09-05 17:12:55 -070022631 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022632
22633 /*-------------------------------------------------------------------------
22634 Extract response and send it to UMAC
22635 -------------------------------------------------------------------------*/
22636 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022637 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022638
22639 /*Notify UMAC*/
22640 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22641
Jeff Johnsone7245742012-09-05 17:12:55 -070022642 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022643}/*WDI_ProcessSetRssiFilterRsp*/
22644
22645/**
22646 @brief Process Update Scan Params Rsp function (called when a
22647 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022648
22649 @param pWDICtx: pointer to the WLAN DAL context
22650 pEventData: pointer to the event information structure
22651
Jeff Johnson295189b2012-06-20 16:38:30 -070022652 @see
22653 @return Result of the function call
22654*/
22655WDI_Status
22656WDI_ProcessUpdateScanParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022657(
Jeff Johnson295189b2012-06-20 16:38:30 -070022658 WDI_ControlBlockType* pWDICtx,
22659 WDI_EventInfoType* pEventData
22660)
22661{
22662 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070022663 tUpdateScanParamsResp halUpdScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022664 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022665 wpt_uint32 uStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022666 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22667
22668 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022669 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022670 -------------------------------------------------------------------------*/
22671 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22672 ( NULL == pEventData->pEventData ))
22673 {
22674 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22675 "%s: Invalid parameters", __FUNCTION__);
22676 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022677 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022678 }
22679
22680 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22681 "Process UPD scan params ptr : %x", __FUNCTION__);
22682
Jeff Johnsone7245742012-09-05 17:12:55 -070022683 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022684
22685 /*-------------------------------------------------------------------------
22686 Extract response and send it to UMAC
22687 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022688 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22689 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022690 sizeof(halUpdScanParams.status));
22691
22692 uStatus = halUpdScanParams.status;
22693
22694 /*Extract PNO version - 1st bit of the status */
Jeff Johnsone7245742012-09-05 17:12:55 -070022695 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
Jeff Johnson295189b2012-06-20 16:38:30 -070022696
22697 /*Remove version bit*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022698 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
Jeff Johnson295189b2012-06-20 16:38:30 -070022699
Jeff Johnsone7245742012-09-05 17:12:55 -070022700 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022701
22702 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022703 "UPD Scan Parameters rsp with status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022704 halUpdScanParams.status);
22705
22706 /*Notify UMAC*/
22707 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22708
Jeff Johnsone7245742012-09-05 17:12:55 -070022709 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022710}
22711#endif // FEATURE_WLAN_SCAN_PNO
22712
22713#ifdef WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -070022714WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022715WDI_8023MulticastListReq
22716(
22717 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22718 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22719 void* pUserData
22720)
22721{
22722 WDI_EventInfoType wdiEventData;
22723 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22724
22725 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22726 "%s", __FUNCTION__);
22727
22728 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022729 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022730 ------------------------------------------------------------------------*/
22731 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22732 {
22733 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22734 "WDI API call before module is initialized - Fail request");
22735
Jeff Johnsone7245742012-09-05 17:12:55 -070022736 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022737 }
22738
22739 /*------------------------------------------------------------------------
22740 Fill in Event data and post to the Main FSM
22741 ------------------------------------------------------------------------*/
22742 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022743 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022744 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022745 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022746 wdiEventData.pUserData = pUserData;
22747
22748 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22749}
22750
Jeff Johnsone7245742012-09-05 17:12:55 -070022751WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022752WDI_ReceiveFilterSetFilterReq
22753(
22754 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22755 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22756 void* pUserData
22757)
22758{
22759 WDI_EventInfoType wdiEventData;
22760 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22761
22762 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22763 "%s",__FUNCTION__);
22764
22765 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022766 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022767 ------------------------------------------------------------------------*/
22768 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22769 {
22770 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22771 "WDI API call before module is initialized - Fail request");
22772
Jeff Johnsone7245742012-09-05 17:12:55 -070022773 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022774 }
22775
22776 /*------------------------------------------------------------------------
22777 Fill in Event data and post to the Main FSM
22778 ------------------------------------------------------------------------*/
22779 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022780 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
22781 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
22782 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
Jeff Johnson295189b2012-06-20 16:38:30 -070022783 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
Jeff Johnsone7245742012-09-05 17:12:55 -070022784 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022785 wdiEventData.pUserData = pUserData;
22786
22787
22788 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22789}
22790
Jeff Johnsone7245742012-09-05 17:12:55 -070022791WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022792WDI_FilterMatchCountReq
22793(
22794 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
22795 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
22796 void* pUserData
22797)
22798{
22799 WDI_EventInfoType wdiEventData;
22800 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22801
22802 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22803 "%s",__FUNCTION__);
22804
22805 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022806 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022807 ------------------------------------------------------------------------*/
22808 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22809 {
22810 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22811 "WDI API call before module is initialized - Fail request");
22812
Jeff Johnsone7245742012-09-05 17:12:55 -070022813 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022814 }
22815
22816 /*------------------------------------------------------------------------
22817 Fill in Event data and post to the Main FSM
22818 ------------------------------------------------------------------------*/
22819 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022820 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022821 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022822 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022823 wdiEventData.pUserData = pUserData;
22824
22825
22826 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22827}
22828
Jeff Johnsone7245742012-09-05 17:12:55 -070022829WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022830WDI_ReceiveFilterClearFilterReq
22831(
22832 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
22833 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
22834 void* pUserData
22835)
22836{
22837 WDI_EventInfoType wdiEventData;
22838 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22839
22840 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22841 "%s",__FUNCTION__);
22842
22843 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022844 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022845 ------------------------------------------------------------------------*/
22846 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22847 {
22848 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22849 "WDI API call before module is initialized - Fail request");
22850
Jeff Johnsone7245742012-09-05 17:12:55 -070022851 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022852 }
22853
22854 /*------------------------------------------------------------------------
22855 Fill in Event data and post to the Main FSM
22856 ------------------------------------------------------------------------*/
22857 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022858 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022859 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022860 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022861 wdiEventData.pUserData = pUserData;
22862
22863
22864 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22865}
22866
22867/**
22868 @brief Process 8023 Multicast List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022869
22870 @param pWDICtx: pointer to the WLAN DAL context
22871 pEventData: pointer to the event information structure
22872
Jeff Johnson295189b2012-06-20 16:38:30 -070022873 @see
22874 @return Result of the function call
22875*/
22876WDI_Status
22877WDI_Process8023MulticastListReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022878(
Jeff Johnson295189b2012-06-20 16:38:30 -070022879 WDI_ControlBlockType* pWDICtx,
22880 WDI_EventInfoType* pEventData
22881)
22882{
22883 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
22884 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022885 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022886 wpt_uint16 usDataOffset = 0;
22887 wpt_uint16 usSendSize = 0;
22888 tHalRcvFltMcAddrListType rcvFltMcAddrListType;
22889 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070022890 wpt_uint8 ucCurrentBSSSesIdx = 0;
22891 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022892
22893 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22894 "%s",__FUNCTION__);
22895
22896 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022897 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022898 -------------------------------------------------------------------------*/
22899 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022900 ( NULL == (pwdiFltPktSetMcListReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070022901 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022902 ( NULL == (wdi8023MulticastListCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070022903 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
22904 {
22905 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22906 "%s: Invalid parameters", __FUNCTION__);
22907 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022908 return WDI_STATUS_E_FAILURE;
22909 }
22910
22911 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
22912 pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId,
22913 &pBSSSes);
22914 if ( NULL == pBSSSes )
22915 {
22916 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22917 " %s : Association for this BSSID does not exist",__FUNCTION__);
22918 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022919 }
22920
22921 /*-----------------------------------------------------------------------
22922 Get message buffer
22923 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022924 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
22925 WDI_8023_MULTICAST_LIST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022926 sizeof(tHalRcvFltMcAddrListType),
22927 &pSendBuffer, &usDataOffset, &usSendSize))||
22928 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
22929 {
22930 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22931 "Unable to get send buffer in "
22932 "WDI_Process8023MulticastListReq() %x %x %x",
22933 pEventData, pwdiFltPktSetMcListReqParamsType,
22934 wdi8023MulticastListCb);
22935 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022936 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022937 }
22938
Jeff Johnsone7245742012-09-05 17:12:55 -070022939 rcvFltMcAddrListType.cMulticastAddr =
22940 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
Jeff Johnson295189b2012-06-20 16:38:30 -070022941 for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ )
22942 {
22943 wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i],
22944 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
22945 sizeof(tSirMacAddr));
22946 }
22947
Jeff Johnsone7245742012-09-05 17:12:55 -070022948 rcvFltMcAddrListType.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070022949 wpalMemoryCopy( pSendBuffer+usDataOffset,
22950 &rcvFltMcAddrListType,
22951 sizeof(rcvFltMcAddrListType));
22952
22953 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022954 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022955
22956
22957 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022958 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022959 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022960 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070022961 wdi8023MulticastListCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070022962 WDI_8023_MULTICAST_LIST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022963}
22964
22965/**
22966 @brief Process Receive Filter Set Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022967
22968 @param pWDICtx: pointer to the WLAN DAL context
22969 pEventData: pointer to the event information structure
22970
Jeff Johnson295189b2012-06-20 16:38:30 -070022971 @see
22972 @return Result of the function call
22973*/
22974WDI_Status
22975WDI_ProcessReceiveFilterSetFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022976(
Jeff Johnson295189b2012-06-20 16:38:30 -070022977 WDI_ControlBlockType* pWDICtx,
22978 WDI_EventInfoType* pEventData
22979)
22980{
22981 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
22982 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022983 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022984 wpt_uint16 usDataOffset = 0;
22985 wpt_uint16 usSendSize = 0;
22986 wpt_uint32 usRcvPktFilterCfgSize;
22987 tHalRcvPktFilterCfgType *pRcvPktFilterCfg;
22988 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070022989 wpt_uint8 ucCurrentBSSSesIdx = 0;
22990 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022991
22992 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22993 "%s",__FUNCTION__);
22994
22995 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022996 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022997 -------------------------------------------------------------------------*/
22998 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070022999 ( NULL == (pwdiSetRcvPktFilterReqInfo =
Jeff Johnson295189b2012-06-20 16:38:30 -070023000 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023001 ( NULL == (wdiReceiveFilterSetFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023002 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
23003 {
23004 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23005 "%s: Invalid parameters", __FUNCTION__);
23006 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023007 return WDI_STATUS_E_FAILURE;
23008 }
23009
23010 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23011 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId,
23012 &pBSSSes);
23013 if ( NULL == pBSSSes )
23014 {
23015 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23016 " %s : Association for this BSSID does not exist",__FUNCTION__);
23017 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023018 }
23019
23020 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
23021 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23022 * sizeof(tHalRcvPktFilterParams));
23023
23024 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
23025 usRcvPktFilterCfgSize);
23026
23027 if(NULL == pRcvPktFilterCfg)
23028 {
23029 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23030 "%s: Failed to allocate memory for "
23031 "tHalRcvPktFilterCfgType: %x %x %x ",
23032 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23033 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023034 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023035 }
23036
23037 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
23038
23039 /*-----------------------------------------------------------------------
23040 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070023041
Jeff Johnson295189b2012-06-20 16:38:30 -070023042 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023043 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023044 usRcvPktFilterCfgSize,
23045 &pSendBuffer, &usDataOffset, &usSendSize))||
23046 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
23047 {
23048 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23049 "Unable to get send buffer in "
23050 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23051 pEventData, pwdiSetRcvPktFilterReqInfo,
23052 wdiReceiveFilterSetFilterCb);
23053 WDI_ASSERT(0);
23054 wpalMemoryFree(pRcvPktFilterCfg);
Jeff Johnsone7245742012-09-05 17:12:55 -070023055 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023056 }
23057
23058 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023059 "UsData Off %d UsSend %d cfg %d",usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023060 usSendSize,usRcvPktFilterCfgSize);
23061
23062 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
Jeff Johnsone7245742012-09-05 17:12:55 -070023063 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
Jeff Johnson295189b2012-06-20 16:38:30 -070023064 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070023065 pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
Jeff Johnson295189b2012-06-20 16:38:30 -070023066
Jeff Johnsone7245742012-09-05 17:12:55 -070023067 //pRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070023068
23069 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023070 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
Jeff Johnson295189b2012-06-20 16:38:30 -070023071 pRcvPktFilterCfg->filterType);
23072 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23073 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070023074 pRcvPktFilterCfg->coalesceTime);
Jeff Johnson295189b2012-06-20 16:38:30 -070023075
23076 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
23077 {
Jeff Johnsone7245742012-09-05 17:12:55 -070023078 pRcvPktFilterCfg->paramsData[i].protocolLayer =
Jeff Johnson295189b2012-06-20 16:38:30 -070023079 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
Jeff Johnsone7245742012-09-05 17:12:55 -070023080 pRcvPktFilterCfg->paramsData[i].cmpFlag =
Jeff Johnson295189b2012-06-20 16:38:30 -070023081 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
Jeff Johnsone7245742012-09-05 17:12:55 -070023082 pRcvPktFilterCfg->paramsData[i].dataOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070023083 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070023084 pRcvPktFilterCfg->paramsData[i].dataLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070023085 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
23086
23087 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
23088 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23089 8);
23090 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
23091 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23092 8);
23093
23094 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23095 "Out:Proto %d Comp Flag %d \n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023096 pRcvPktFilterCfg->paramsData[i].protocolLayer,
Jeff Johnson295189b2012-06-20 16:38:30 -070023097 pRcvPktFilterCfg->paramsData[i].cmpFlag);
23098
23099 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23100 "Data Offset %d Data Len %d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023101 pRcvPktFilterCfg->paramsData[i].dataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023102 pRcvPktFilterCfg->paramsData[i].dataLength);
23103
23104 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23105 "CData: %d:%d:%d:%d:%d:%d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023106 pRcvPktFilterCfg->paramsData[i].compareData[0],
23107 pRcvPktFilterCfg->paramsData[i].compareData[1],
23108 pRcvPktFilterCfg->paramsData[i].compareData[2],
Jeff Johnson295189b2012-06-20 16:38:30 -070023109 pRcvPktFilterCfg->paramsData[i].compareData[3],
Jeff Johnsone7245742012-09-05 17:12:55 -070023110 pRcvPktFilterCfg->paramsData[i].compareData[4],
Jeff Johnson295189b2012-06-20 16:38:30 -070023111 pRcvPktFilterCfg->paramsData[i].compareData[5]);
23112
23113 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23114 "MData: %d:%d:%d:%d:%d:%d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023115 pRcvPktFilterCfg->paramsData[i].dataMask[0],
23116 pRcvPktFilterCfg->paramsData[i].dataMask[1],
23117 pRcvPktFilterCfg->paramsData[i].dataMask[2],
Jeff Johnson295189b2012-06-20 16:38:30 -070023118 pRcvPktFilterCfg->paramsData[i].dataMask[3],
Jeff Johnsone7245742012-09-05 17:12:55 -070023119 pRcvPktFilterCfg->paramsData[i].dataMask[4],
Jeff Johnson295189b2012-06-20 16:38:30 -070023120 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
23121 }
23122
Jeff Johnsone7245742012-09-05 17:12:55 -070023123 wpalMemoryCopy( pSendBuffer+usDataOffset,
23124 pRcvPktFilterCfg,
23125 usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023126
23127
23128 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023129 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023130
23131 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23132 "%s",__FUNCTION__);
23133 wpalMemoryFree(pRcvPktFilterCfg);
23134
23135 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023136 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023137 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023138 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023139 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023140 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023141}
23142
23143/**
23144 @brief Process Packet Filter Match Count Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023145
23146 @param pWDICtx: pointer to the WLAN DAL context
23147 pEventData: pointer to the event information structure
23148
Jeff Johnson295189b2012-06-20 16:38:30 -070023149 @see
23150 @return Result of the function call
23151*/
23152WDI_Status
23153WDI_ProcessFilterMatchCountReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023154(
Jeff Johnson295189b2012-06-20 16:38:30 -070023155 WDI_ControlBlockType* pWDICtx,
23156 WDI_EventInfoType* pEventData
23157)
23158{
23159 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
23160 NULL;
23161 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
23162 NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023163 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023164 wpt_uint16 usDataOffset = 0;
23165 wpt_uint16 usSendSize = 0;
23166
23167 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23168 "%s",__FUNCTION__);
23169
23170 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023171 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023172 -------------------------------------------------------------------------*/
23173 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023174 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023175 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023176 ( NULL == (wdiFilterMatchCountCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023177 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
23178 {
23179 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23180 "%s: Invalid parameters", __FUNCTION__);
23181 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023182 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023183 }
23184
23185 /*-----------------------------------------------------------------------
23186 Get message buffer
23187 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023188 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23189 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023190 0,
23191 &pSendBuffer, &usDataOffset, &usSendSize))||
23192 ( usSendSize < usDataOffset))
23193 {
23194 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23195 "Unable to get send buffer in "
23196 "WDI_ProcessFilterMatchCountReq() %x %x %x",
23197 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
23198 wdiFilterMatchCountCb);
23199 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023200 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023201 }
23202
23203 //
23204 // Don't need to fill send buffer other than header
23205 //
23206 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023207 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023208
23209
23210 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023211 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023212 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023213 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23214 wdiFilterMatchCountCb,
23215 pEventData->pUserData,
23216 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023217}
23218
23219/**
23220 @brief Process Receive Filter Clear Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023221
23222 @param pWDICtx: pointer to the WLAN DAL context
23223 pEventData: pointer to the event information structure
23224
Jeff Johnson295189b2012-06-20 16:38:30 -070023225 @see
23226 @return Result of the function call
23227*/
23228WDI_Status
23229WDI_ProcessReceiveFilterClearFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023230(
Jeff Johnson295189b2012-06-20 16:38:30 -070023231 WDI_ControlBlockType* pWDICtx,
23232 WDI_EventInfoType* pEventData
23233)
Jeff Johnsone7245742012-09-05 17:12:55 -070023234{
Jeff Johnson295189b2012-06-20 16:38:30 -070023235 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
23236 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023237 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023238 wpt_uint16 usDataOffset = 0;
23239 wpt_uint16 usSendSize = 0;
23240 tHalRcvFltPktClearParam rcvFltPktClearParam;
Jeff Johnsone7245742012-09-05 17:12:55 -070023241 wpt_uint8 ucCurrentBSSSesIdx = 0;
23242 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023243
23244 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23245 "%s",__FUNCTION__);
23246
23247 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023248 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023249 -------------------------------------------------------------------------*/
23250 if (( NULL == pEventData ) ||
23251 ( NULL == (pwdiRcvFltPktClearReqParamsType =
23252 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023253 ( NULL == (wdiRcvFltPktClearFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023254 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
23255 {
23256 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23257 "%s: Invalid parameters", __FUNCTION__);
23258 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023259 return WDI_STATUS_E_FAILURE;
23260 }
23261
23262 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23263 pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId,
23264 &pBSSSes);
23265 if ( NULL == pBSSSes )
23266 {
23267 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23268 " %s : Association for this BSSID does not exist",__FUNCTION__);
23269 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023270 }
23271
23272 /*-----------------------------------------------------------------------
23273 Get message buffer
23274 -----------------------------------------------------------------------*/
23275 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023276 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023277 sizeof(tHalRcvFltPktClearParam),
23278 &pSendBuffer, &usDataOffset, &usSendSize))||
23279 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
23280 {
23281 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23282 "Unable to get send buffer in "
23283 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
23284 pEventData, pwdiRcvFltPktClearReqParamsType,
23285 wdiRcvFltPktClearFilterCb);
23286 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023287 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023288 }
23289
23290
23291 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023292 filterClearParam.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070023293 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023294 filterClearParam.filterId;
Jeff Johnson295189b2012-06-20 16:38:30 -070023295
Jeff Johnsone7245742012-09-05 17:12:55 -070023296 rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx;
23297 wpalMemoryCopy( pSendBuffer+usDataOffset,
23298 &rcvFltPktClearParam,
23299 sizeof(rcvFltPktClearParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070023300
23301 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023302 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023303
23304
23305 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023306 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023307 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023308 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023309 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023310 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023311}
23312
23313/**
23314 @brief Process 8023 Multicast List Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023315
23316 @param pWDICtx: pointer to the WLAN DAL context
23317 pEventData: pointer to the event information structure
23318
Jeff Johnson295189b2012-06-20 16:38:30 -070023319 @see
23320 @return Result of the function call
23321*/
23322WDI_Status
23323WDI_Process8023MulticastListRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023324(
Jeff Johnson295189b2012-06-20 16:38:30 -070023325 WDI_ControlBlockType* pWDICtx,
23326 WDI_EventInfoType* pEventData
23327)
23328{
23329 WDI_Status wdiStatus;
23330 eHalStatus halStatus;
23331 WDI_8023MulticastListCb wdi8023MulticastListCb;
23332 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23333
23334 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23335 "%s",__FUNCTION__);
23336
23337 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023338 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023339 -------------------------------------------------------------------------*/
23340 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23341 ( NULL == pEventData->pEventData ))
23342 {
23343 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23344 "%s: Invalid parameters", __FUNCTION__);
23345 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023346 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023347 }
23348
Jeff Johnsone7245742012-09-05 17:12:55 -070023349 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023350
23351 /*-------------------------------------------------------------------------
23352 Extract response and send it to UMAC
23353 -------------------------------------------------------------------------*/
23354 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023355 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023356
23357 /*Notify UMAC*/
23358 wdi8023MulticastListCb(wdiStatus, pWDICtx->pRspCBUserData);
23359
Jeff Johnsone7245742012-09-05 17:12:55 -070023360 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023361}
23362
23363/**
23364 @brief Process Set Rsp function (called when a
23365 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023366
23367 @param pWDICtx: pointer to the WLAN DAL context
23368 pEventData: pointer to the event information structure
23369
Jeff Johnson295189b2012-06-20 16:38:30 -070023370 @see
23371 @return Result of the function call
23372*/
23373WDI_Status
23374WDI_ProcessReceiveFilterSetFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023375(
Jeff Johnson295189b2012-06-20 16:38:30 -070023376 WDI_ControlBlockType* pWDICtx,
23377 WDI_EventInfoType* pEventData
23378)
23379{
23380 WDI_Status wdiStatus;
23381 eHalStatus halStatus;
23382 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
23383 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23384
23385 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23386 "%s",__FUNCTION__);
23387
23388 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023389 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023390 -------------------------------------------------------------------------*/
23391 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23392 ( NULL == pEventData->pEventData ))
23393 {
23394 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23395 "%s: Invalid parameters", __FUNCTION__);
23396 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023397 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023398 }
23399
23400 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023401 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023402
23403 /*-------------------------------------------------------------------------
23404 Extract response and send it to UMAC
23405 -------------------------------------------------------------------------*/
23406 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023407 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023408
23409 /*Notify UMAC*/
23410 wdiReceiveFilterSetFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23411
Jeff Johnsone7245742012-09-05 17:12:55 -070023412 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023413}
23414
23415/**
23416 @brief Process Packet Filter Match Count Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023417
23418 @param pWDICtx: pointer to the WLAN DAL context
23419 pEventData: pointer to the event information structure
23420
Jeff Johnson295189b2012-06-20 16:38:30 -070023421 @see
23422 @return Result of the function call
23423*/
23424WDI_Status
23425WDI_ProcessFilterMatchCountRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023426(
Jeff Johnson295189b2012-06-20 16:38:30 -070023427 WDI_ControlBlockType* pWDICtx,
23428 WDI_EventInfoType* pEventData
23429)
23430{
23431 WDI_Status wdiStatus;
23432 eHalStatus halStatus;
23433
23434 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
23435
23436 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23437
23438 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23439 "%s",__FUNCTION__);
23440
23441 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023442 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023443 -------------------------------------------------------------------------*/
23444 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23445 ( NULL == pEventData->pEventData ))
23446 {
23447 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23448 "%s: Invalid parameters", __FUNCTION__);
23449 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023450 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023451 }
23452
Jeff Johnsone7245742012-09-05 17:12:55 -070023453 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023454
23455 /*-------------------------------------------------------------------------
23456 Extract response and send it to UMAC
23457 -------------------------------------------------------------------------*/
23458 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023459 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023460
23461 /*Notify UMAC*/
23462 wdiFilterMatchCountCb(wdiStatus, pWDICtx->pRspCBUserData);
23463
Jeff Johnsone7245742012-09-05 17:12:55 -070023464 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023465}
23466
23467/**
23468 @brief Process Receive Filter Clear Filter Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023469
23470 @param pWDICtx: pointer to the WLAN DAL context
23471 pEventData: pointer to the event information structure
23472
Jeff Johnson295189b2012-06-20 16:38:30 -070023473 @see
23474 @return Result of the function call
23475*/
23476WDI_Status
23477WDI_ProcessReceiveFilterClearFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023478(
Jeff Johnson295189b2012-06-20 16:38:30 -070023479 WDI_ControlBlockType* pWDICtx,
23480 WDI_EventInfoType* pEventData
23481)
23482{
23483 WDI_Status wdiStatus;
23484 eHalStatus halStatus;
23485 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
23486 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23487
23488 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23489 "%s",__FUNCTION__);
23490
23491 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023492 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023493 -------------------------------------------------------------------------*/
23494 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23495 ( NULL == pEventData->pEventData ))
23496 {
23497 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23498 "%s: Invalid parameters", __FUNCTION__);
23499 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023500 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023501 }
23502
23503 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023504 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023505
23506 /*-------------------------------------------------------------------------
23507 Extract response and send it to UMAC
23508 -------------------------------------------------------------------------*/
23509 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023510 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023511
23512 /*Notify UMAC*/
23513 wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
23514
Jeff Johnsone7245742012-09-05 17:12:55 -070023515 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023516}
23517#endif // WLAN_FEATURE_PACKET_FILTERING
23518
23519/**
23520 @brief Process Shutdown Rsp function
23521 There is no shutdown response comming from HAL
23522 - function just kept for simmetry
Jeff Johnsone7245742012-09-05 17:12:55 -070023523
Jeff Johnson295189b2012-06-20 16:38:30 -070023524 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnsone7245742012-09-05 17:12:55 -070023525 pEventData: pointer to the event information structure
Jeff Johnson295189b2012-06-20 16:38:30 -070023526
23527 @see
23528 @return Result of the function call
23529*/
23530WDI_Status
23531WDI_ProcessShutdownRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023532(
Jeff Johnson295189b2012-06-20 16:38:30 -070023533 WDI_ControlBlockType* pWDICtx,
23534 WDI_EventInfoType* pEventData
23535)
23536{
23537 /*There is no shutdown response comming from HAL - function just kept for
23538 simmetry */
23539 WDI_ASSERT(0);
23540 return WDI_STATUS_SUCCESS;
23541}/*WDI_ProcessShutdownRsp*/
23542
23543/**
23544 @brief WDI_SetPowerParamsReq
23545
Jeff Johnsone7245742012-09-05 17:12:55 -070023546 @param pwdiPowerParamsReqParams: the Set Power Params as
Jeff Johnson295189b2012-06-20 16:38:30 -070023547 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070023548
Jeff Johnson295189b2012-06-20 16:38:30 -070023549 wdiPowerParamsCb: callback for passing back the response
23550 of the Set Power Params operation received from the
23551 device
Jeff Johnsone7245742012-09-05 17:12:55 -070023552
Jeff Johnson295189b2012-06-20 16:38:30 -070023553 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070023554 callback
23555
Jeff Johnson295189b2012-06-20 16:38:30 -070023556 @return Result of the function call
23557*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023558WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023559WDI_SetPowerParamsReq
23560(
23561 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23562 WDI_SetPowerParamsCb wdiPowerParamsCb,
23563 void* pUserData
23564)
23565{
23566 WDI_EventInfoType wdiEventData;
23567 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23568
23569 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023570 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023571 ------------------------------------------------------------------------*/
23572 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23573 {
23574 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23575 "WDI API call before module is initialized - Fail request");
23576
Jeff Johnsone7245742012-09-05 17:12:55 -070023577 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023578 }
23579
23580 /*------------------------------------------------------------------------
23581 Fill in Event data and post to the Main FSM
23582 ------------------------------------------------------------------------*/
23583 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023584 wdiEventData.pEventData = pwdiPowerParamsReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070023585 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070023586 wdiEventData.pCBfnc = wdiPowerParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070023587 wdiEventData.pUserData = pUserData;
23588
23589 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23590}/*WDI_SetPowerParamsReq*/
23591
23592/**
23593 @brief Process Set Power Params Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023594
23595 @param pWDICtx: pointer to the WLAN DAL context
23596 pEventData: pointer to the event information structure
23597
Jeff Johnson295189b2012-06-20 16:38:30 -070023598 @see
23599 @return Result of the function call
23600*/
23601WDI_Status
23602WDI_ProcessSetPowerParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023603(
Jeff Johnson295189b2012-06-20 16:38:30 -070023604 WDI_ControlBlockType* pWDICtx,
23605 WDI_EventInfoType* pEventData
23606)
23607{
23608 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
23609 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023610 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023611 wpt_uint16 usDataOffset = 0;
23612 wpt_uint16 usSendSize = 0;
23613 tSetPowerParamsType powerParams;
23614
23615 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023616 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023617 -------------------------------------------------------------------------*/
23618 if (( NULL == pEventData ) ||
23619 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
23620 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
23621 {
23622 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23623 "%s: Invalid parameters", __FUNCTION__);
23624 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023625 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023626 }
23627
23628 /*-----------------------------------------------------------------------
23629 Get message buffer
23630 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023631 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023632 sizeof(powerParams),
23633 &pSendBuffer, &usDataOffset, &usSendSize))||
23634 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
23635 {
23636 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23637 "Unable to get send buffer in Set PNO req %x %x %x",
23638 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
23639 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023640 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023641 }
23642
23643 /* Ignore DTIM */
Jeff Johnsone7245742012-09-05 17:12:55 -070023644 powerParams.uIgnoreDTIM =
Jeff Johnson295189b2012-06-20 16:38:30 -070023645 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
23646
23647 /*DTIM Period*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023648 powerParams.uDTIMPeriod =
Jeff Johnson295189b2012-06-20 16:38:30 -070023649 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
23650
23651 /* Listen Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070023652 powerParams.uListenInterval=
Jeff Johnson295189b2012-06-20 16:38:30 -070023653 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
23654
23655 /* Broadcast Multicas Filter */
Jeff Johnsone7245742012-09-05 17:12:55 -070023656 powerParams.uBcastMcastFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070023657 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
23658
23659 /* Beacon Early Termination */
Jeff Johnsone7245742012-09-05 17:12:55 -070023660 powerParams.uEnableBET =
Jeff Johnson295189b2012-06-20 16:38:30 -070023661 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
23662
23663 /* Beacon Early Termination Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070023664 powerParams.uBETInterval =
23665 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
Jeff Johnson295189b2012-06-20 16:38:30 -070023666
Jeff Johnsone7245742012-09-05 17:12:55 -070023667
23668 wpalMemoryCopy( pSendBuffer+usDataOffset,
23669 &powerParams,
23670 sizeof(powerParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070023671
23672 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023673 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023674
23675 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023676 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023677 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023678 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23679 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023680}
23681
23682/**
23683 @brief Process Power Params Rsp function (called when a
23684 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023685
23686 @param pWDICtx: pointer to the WLAN DAL context
23687 pEventData: pointer to the event information structure
23688
Jeff Johnson295189b2012-06-20 16:38:30 -070023689 @see
23690 @return Result of the function call
23691*/
23692WDI_Status
23693WDI_ProcessSetPowerParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023694(
Jeff Johnson295189b2012-06-20 16:38:30 -070023695 WDI_ControlBlockType* pWDICtx,
23696 WDI_EventInfoType* pEventData
23697)
23698{
23699 WDI_Status wdiStatus;
23700 eHalStatus halStatus;
23701 WDI_SetPowerParamsCb wdiPowerParamsCb;
23702 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23703
23704 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023705 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023706 -------------------------------------------------------------------------*/
23707 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23708 ( NULL == pEventData->pEventData ))
23709 {
23710 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23711 "%s: Invalid parameters", __FUNCTION__);
23712 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023713 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023714 }
23715
Jeff Johnsone7245742012-09-05 17:12:55 -070023716 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023717
23718 /*-------------------------------------------------------------------------
23719 Extract response and send it to UMAC
23720 -------------------------------------------------------------------------*/
23721 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070023722 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070023723
23724 /*Notify UMAC*/
23725 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
23726
Jeff Johnsone7245742012-09-05 17:12:55 -070023727 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023728}/*WDI_ProcessSetPowerParamsRsp*/
23729
23730#ifdef WLAN_FEATURE_GTK_OFFLOAD
23731/**
23732 @brief WDI_GTKOffloadReq will be called when the upper MAC
23733 wants to set GTK Rekey Counter while in power save. Upon
23734 the call of this API the WLAN DAL will pack and send a
23735 HAL GTK offload request message to the lower RIVA
23736 sub-system if DAL is in state STARTED.
23737
23738 In state BUSY this request will be queued. Request won't
23739 be allowed in any other state.
23740
23741 WDI_PostAssocReq must have been called.
23742
23743 @param pwdiGtkOffloadParams: the GTK offload as specified
23744 by the Device Interface
23745
23746 wdiGtkOffloadCb: callback for passing back the response
23747 of the GTK offload operation received from the device
23748
23749 pUserData: user data will be passed back with the
23750 callback
23751
23752 @see WDI_PostAssocReq
23753 @return Result of the function call
23754*/
23755WDI_Status
23756WDI_GTKOffloadReq
23757(
23758 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
23759 WDI_GtkOffloadCb wdiGtkOffloadCb,
23760 void* pUserData
23761)
23762{
23763 WDI_EventInfoType wdiEventData = {0};
23764 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23765
23766 /*------------------------------------------------------------------------
23767 Sanity Check
23768 ------------------------------------------------------------------------*/
23769 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23770 {
23771 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23772 "WDI API call before module is initialized - Fail request");
23773
23774 return WDI_STATUS_E_NOT_ALLOWED;
23775 }
23776
23777 /*------------------------------------------------------------------------
23778 Fill in Event data and post to the Main FSM
23779 ------------------------------------------------------------------------*/
23780 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
23781 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
23782 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
23783 wdiEventData.pCBfnc = wdiGtkOffloadCb;
23784 wdiEventData.pUserData = pUserData;
23785
23786 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23787}
23788
23789
23790/**
23791 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
23792 MAC wants to get GTK Rekey Counter while in power save.
23793 Upon the call of this API the WLAN DAL will pack and
23794 send a HAL GTK offload request message to the lower RIVA
23795 sub-system if DAL is in state STARTED.
23796
23797 In state BUSY this request will be queued. Request won't
23798 be allowed in any other state.
23799
23800 WDI_PostAssocReq must have been called.
23801
23802 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
23803 Information Message as specified by the
23804 Device Interface
23805
23806 wdiGtkOffloadGetInfoCb: callback for passing back the
23807 response of the GTK offload operation received from the
23808 device
23809
23810 pUserData: user data will be passed back with the
23811 callback
23812
23813 @see WDI_PostAssocReq
23814 @return Result of the function call
23815*/
23816WDI_Status
23817WDI_GTKOffloadGetInfoReq
23818(
23819 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
23820 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
23821 void* pUserData
23822)
23823{
23824 WDI_EventInfoType wdiEventData = {0};
23825 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23826
23827 /*------------------------------------------------------------------------
23828 Sanity Check
23829 ------------------------------------------------------------------------*/
23830 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23831 {
23832 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23833 "WDI API call before module is initialized - Fail request");
23834
23835 return WDI_STATUS_E_NOT_ALLOWED;
23836 }
23837
23838 /*------------------------------------------------------------------------
23839 Fill in Event data and post to the Main FSM
23840 ------------------------------------------------------------------------*/
23841 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
23842 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
23843 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
23844 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
23845 wdiEventData.pUserData = pUserData;
23846
23847 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23848}
23849
23850
23851/**
23852 @brief Process set GTK Offload Request function
23853
23854 @param pWDICtx: pointer to the WLAN DAL context
23855 pEventData: pointer to the event information structure
23856
23857 @see
23858 @return Result of the function call
23859*/
23860WDI_Status
23861WDI_ProcessGTKOffloadReq
23862(
23863 WDI_ControlBlockType* pWDICtx,
23864 WDI_EventInfoType* pEventData
23865)
23866{
23867 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
23868 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
23869 wpt_uint8* pSendBuffer = NULL;
23870 wpt_uint16 usDataOffset = 0;
23871 wpt_uint16 usSendSize = 0;
23872 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
23873 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23874
23875 /*-------------------------------------------------------------------------
23876 Sanity check
23877 -------------------------------------------------------------------------*/
23878 if (( NULL == pEventData ) ||
23879 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
23880 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
23881 {
23882 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23883 "%s: Invalid parameters", __FUNCTION__);
23884 WDI_ASSERT(0);
23885 return WDI_STATUS_E_FAILURE;
23886 }
23887
23888 /*-----------------------------------------------------------------------
23889 Get message buffer
23890 -----------------------------------------------------------------------*/
23891 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
23892 sizeof(gtkOffloadReqParams),
23893 &pSendBuffer, &usDataOffset, &usSendSize))||
23894 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
23895 {
23896 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23897 "Unable to get send buffer in GTK offload req %x %x %x",
23898 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
23899 WDI_ASSERT(0);
23900 return WDI_STATUS_E_FAILURE;
23901 }
23902
23903 //
23904 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
23905 //
23906 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
23907 // Copy KCK
23908 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
23909 // Copy KEK
23910 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
23911 // Copy KeyReplayCounter
23912 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
23913
23914 wpalMemoryCopy( pSendBuffer+usDataOffset,
23915 &gtkOffloadReqParams,
23916 sizeof(gtkOffloadReqParams));
23917
23918 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
23919 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
23920
23921 /*-------------------------------------------------------------------------
23922 Send Get STA Request to HAL
23923 -------------------------------------------------------------------------*/
23924 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23925 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
23926}
23927
23928
23929/**
23930 @brief Process GTK Offload Get Information Request function
23931
23932 @param pWDICtx: pointer to the WLAN DAL context
23933 pEventData: pointer to the event information structure
23934
23935 @see
23936 @return Result of the function call
23937*/
23938WDI_Status
23939WDI_ProcessGTKOffloadGetInfoReq
23940(
23941 WDI_ControlBlockType* pWDICtx,
23942 WDI_EventInfoType* pEventData
23943)
23944{
23945 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
23946 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
23947 wpt_uint8* pSendBuffer = NULL;
23948 wpt_uint16 usDataOffset = 0;
23949 wpt_uint16 usSendSize = 0;
23950
23951 /*-------------------------------------------------------------------------
23952 Sanity check
23953 -------------------------------------------------------------------------*/
23954 if (( NULL == pEventData ) ||
23955 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
23956 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
23957 {
23958 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23959 "%s: Invalid parameters", __FUNCTION__);
23960 WDI_ASSERT(0);
23961 return WDI_STATUS_E_FAILURE;
23962 }
23963
23964 /*-----------------------------------------------------------------------
23965 Get message buffer
23966 -----------------------------------------------------------------------*/
23967 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
23968 0,
23969 &pSendBuffer, &usDataOffset, &usSendSize))||
23970 ( usSendSize < usDataOffset))
23971 {
23972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23973 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
23974 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
23975 WDI_ASSERT(0);
23976 return WDI_STATUS_E_FAILURE;
23977 }
23978
23979 //
23980 // Don't need to fill send buffer other than header
23981 //
23982
23983 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
23984 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
23985
23986 /*-------------------------------------------------------------------------
23987 Send Get STA Request to HAL
23988 -------------------------------------------------------------------------*/
23989 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23990 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
23991}
23992
23993/**
23994 @brief Process host offload Rsp function (called when a
23995 response is being received over the bus from HAL)
23996
23997 @param pWDICtx: pointer to the WLAN DAL context
23998 pEventData: pointer to the event information structure
23999
24000 @see
24001 @return Result of the function call
24002*/
24003WDI_Status
24004WDI_ProcessGtkOffloadRsp
24005(
24006 WDI_ControlBlockType* pWDICtx,
24007 WDI_EventInfoType* pEventData
24008)
24009{
24010 WDI_Status wdiStatus;
24011 eHalStatus halStatus;
24012 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
24013 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24014
24015 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
24016
24017 /*-------------------------------------------------------------------------
24018 Sanity check
24019 -------------------------------------------------------------------------*/
24020 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24021 ( NULL == pEventData->pEventData))
24022 {
24023 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24024 "%s: Invalid parameters", __FUNCTION__);
24025 WDI_ASSERT(0);
24026 return WDI_STATUS_E_FAILURE;
24027 }
24028
24029 /*-------------------------------------------------------------------------
24030 Extract response and send it to UMAC
24031 -------------------------------------------------------------------------*/
24032 halStatus = *((eHalStatus*)pEventData->pEventData);
24033 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24034
24035 /*Notify UMAC*/
24036 wdiGtkOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
24037
24038 return WDI_STATUS_SUCCESS;
24039}
24040
24041/**
24042 @brief Process GTK Offload Get Information Response function
24043
24044 @param pWDICtx: pointer to the WLAN DAL context
24045 pEventData: pointer to the event information structure
24046
24047 @see
24048 @return Result of the function call
24049*/
24050WDI_Status
24051WDI_ProcessGTKOffloadGetInfoRsp
24052(
24053 WDI_ControlBlockType* pWDICtx,
24054 WDI_EventInfoType* pEventData
24055)
24056{
24057 WDI_Status wdiStatus;
24058 eHalStatus halStatus;
24059
24060 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
24061
24062 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24063
24064 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
24065
24066 /*-------------------------------------------------------------------------
24067 Sanity check
24068 -------------------------------------------------------------------------*/
24069 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24070 ( NULL == pEventData->pEventData ))
24071 {
24072 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24073 "%s: Invalid parameters", __FUNCTION__);
24074 WDI_ASSERT(0);
24075 return WDI_STATUS_E_FAILURE;
24076 }
24077
24078 /*-------------------------------------------------------------------------
24079 Extract response and send it to UMAC
24080 -------------------------------------------------------------------------*/
24081 halStatus = *((eHalStatus*)pEventData->pEventData);
24082 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24083
24084 /*Notify UMAC*/
24085 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24086 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
24087 wdiGtkOffloadGetInfoCb(wdiStatus, pWDICtx->pRspCBUserData);
24088
24089 return WDI_STATUS_SUCCESS;
24090}
24091#endif // WLAN_FEATURE_GTK_OFFLOAD
24092
24093#ifdef WLAN_WAKEUP_EVENTS
24094WDI_Status
24095WDI_ProcessWakeReasonInd
24096(
24097 WDI_ControlBlockType* pWDICtx,
24098 WDI_EventInfoType* pEventData
24099)
24100{
24101 WDI_LowLevelIndType *pWdiInd;
24102 tpWakeReasonParams pWakeReasonParams;
24103 wpt_uint32 allocSize = 0;
24104
24105 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24106 "+%s", __FUNCTION__);
24107
24108 /*-------------------------------------------------------------------------
24109 Sanity check
24110 -------------------------------------------------------------------------*/
24111 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24112 ( NULL == pEventData->pEventData ))
24113 {
24114 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24115 "%s: Invalid parameters", __FUNCTION__);
24116 WDI_ASSERT( 0 );
24117 return WDI_STATUS_E_FAILURE;
24118 }
24119
24120 /*-------------------------------------------------------------------------
24121 Extract indication and send it to UMAC
24122 -------------------------------------------------------------------------*/
24123 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
24124
24125 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
24126
24127 //Allocate memory for WDI_WakeReasonIndType structure
24128 pWdiInd = wpalMemoryAllocate(allocSize) ;
24129
24130 if(NULL == pWdiInd)
24131 {
24132 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24133 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
24134 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
24135 WDI_ASSERT(0);
24136 return WDI_STATUS_E_FAILURE;
24137 }
24138
24139 wpalMemoryZero(pWdiInd, allocSize);
24140
24141 /* Fill in the indication parameters*/
24142 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
24143 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
24144 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
24145 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
24146 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
24147 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
24148 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
24149 &(pWakeReasonParams->aDataStart[0]),
24150 pWakeReasonParams->ulStoredDataLen);
24151
24152 /*Notify UMAC*/
24153 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
24154
24155 //Free memory allocated for WDI_WakeReasonIndType structure
24156 wpalMemoryFree(pWdiInd);
24157
24158 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24159 "-%s", __FUNCTION__);
24160
24161 return WDI_STATUS_SUCCESS;
24162}
24163#endif // WLAN_WAKEUP_EVENTS
24164
24165void WDI_GetWcnssCompiledApiVersion
24166(
24167 WDI_WlanVersionType *pWcnssApiVersion
24168)
24169{
24170 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
24171 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
24172 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
24173 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
24174}
24175
24176/**
24177 @brief Process Set TM Level Rsp function (called when a
24178 response is being received over the bus from HAL)
24179
24180 @param pWDICtx: pointer to the WLAN DAL context
24181 pEventData: pointer to the event information structure
24182
24183 @see
24184 @return Result of the function call
24185*/
24186WDI_Status
24187WDI_ProcessSetTmLevelRsp
24188(
24189 WDI_ControlBlockType* pWDICtx,
24190 WDI_EventInfoType* pEventData
24191)
24192{
24193 WDI_Status wdiStatus;
24194 eHalStatus halStatus;
24195 WDI_SetTmLevelCb wdiSetTmLevelCb;
24196 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24197
24198 /*-------------------------------------------------------------------------
24199 Sanity check
24200 -------------------------------------------------------------------------*/
24201 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24202 ( NULL == pEventData->pEventData ))
24203 {
24204 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24205 "%s: Invalid parameters", __FUNCTION__);
24206 WDI_ASSERT(0);
24207 return WDI_STATUS_E_FAILURE;
24208 }
24209
24210 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
24211
24212 /*-------------------------------------------------------------------------
24213 Extract response and send it to UMAC
24214 -------------------------------------------------------------------------*/
24215 halStatus = *((eHalStatus*)pEventData->pEventData);
24216 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24217
24218 /*Notify UMAC*/
24219 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
24220
24221 return WDI_STATUS_SUCCESS;
24222}/*WDI_ProcessSetTmLevelRsp*/
24223
24224/**
24225 @brief Process Set Thermal Mitigation level Changed request
24226
24227 @param pWDICtx: pointer to the WLAN DAL context
24228 pEventData: pointer to the event information structure
24229
24230 @see
24231 @return Result of the function call
24232*/
24233WDI_Status
24234WDI_ProcessSetTmLevelReq
24235(
24236 WDI_ControlBlockType* pWDICtx,
24237 WDI_EventInfoType* pEventData
24238)
24239{
24240 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
24241 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
24242 wpt_uint8* pSendBuffer = NULL;
24243 wpt_uint16 usDataOffset = 0;
24244 wpt_uint16 usSendSize = 0;
24245 tSetThermalMitgationType halTmMsg;
24246
24247 /*-------------------------------------------------------------------------
24248 Sanity check
24249 -------------------------------------------------------------------------*/
24250 if (( NULL == pEventData ) ||
24251 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
24252 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
24253 {
24254 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24255 "%s: Invalid parameters", __FUNCTION__);
24256 WDI_ASSERT(0);
24257 return WDI_STATUS_E_FAILURE;
24258 }
24259
24260 /*-----------------------------------------------------------------------
24261 Get message buffer
24262 -----------------------------------------------------------------------*/
24263 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
24264 sizeof(halTmMsg),
24265 &pSendBuffer, &usDataOffset, &usSendSize))||
24266 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
24267 {
24268 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24269 "Unable to get send buffer in Set PNO req %x %x %x",
24270 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
24271 WDI_ASSERT(0);
24272 return WDI_STATUS_E_FAILURE;
24273 }
24274
24275 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
24276 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
24277
24278 wpalMemoryCopy( pSendBuffer+usDataOffset,
24279 &halTmMsg,
24280 sizeof(halTmMsg));
24281
24282 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
24283 pWDICtx->pfncRspCB = NULL;
24284 /*-------------------------------------------------------------------------
24285 Send Get STA Request to HAL
24286 -------------------------------------------------------------------------*/
24287 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24288 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
24289}
24290
24291/* Fill the value from the global features enabled array to the global capabilities
24292 * bitmap struct
24293 */
24294static void
24295FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
24296{
24297 wpt_int8 i;
24298 for (i=0; i<len; i++)
24299 {
24300 setFeatCaps(fCaps, enabledFeat[i]);
24301 }
24302}
24303
24304/**
24305 @brief WDI_featureCapsExchangeReq
24306 Post feature capability bitmap exchange event.
24307 Host will send its own capability to FW in this req and
24308 expect FW to send its capability back as a bitmap in Response
24309
24310 @param
24311
24312 wdiFeatureCapsExchangeCb: callback called on getting the response.
24313 It is kept to mantain similarity between WDI reqs and if needed, can
24314 be used in future. Currently, It is set to NULL
24315
24316 pUserData: user data will be passed back with the
24317 callback
24318
24319 @see
24320 @return Result of the function call
24321*/
24322WDI_Status
24323WDI_featureCapsExchangeReq
24324(
24325 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
24326 void* pUserData
24327)
24328{
24329 WDI_EventInfoType wdiEventData;
24330 wpt_int32 fCapsStructSize;
24331
24332 /*------------------------------------------------------------------------
24333 Sanity Check
24334 ------------------------------------------------------------------------*/
24335 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24336 {
24337 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24338 "WDI API call before module is initialized - Fail request");
24339
24340 return WDI_STATUS_E_NOT_ALLOWED;
24341 }
24342
24343 /* Allocate memory separately for global variable carrying FW caps */
24344 fCapsStructSize = sizeof(tWlanFeatCaps);
24345 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24346 if ( NULL == gpHostWlanFeatCaps )
24347 {
24348 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24349 "Cannot allocate memory for host capability info\n");
24350 WDI_ASSERT(0);
24351 return WDI_STATUS_MEM_FAILURE;
24352 }
24353
24354 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
24355
24356 /*------------------------------------------------------------------------
24357 Fill in Event data and post to the Main FSM
24358 ------------------------------------------------------------------------*/
24359 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
24360 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
Jeff Johnsone7245742012-09-05 17:12:55 -070024361 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24362 "Host caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024363 gpHostWlanFeatCaps->featCaps[0],
24364 gpHostWlanFeatCaps->featCaps[1],
24365 gpHostWlanFeatCaps->featCaps[2],
24366 gpHostWlanFeatCaps->featCaps[3]
24367 );
24368
24369 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
24370 wdiEventData.pEventData = gpHostWlanFeatCaps;
24371 wdiEventData.uEventDataSize = fCapsStructSize;
24372 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
24373 wdiEventData.pUserData = pUserData;
24374
24375 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24376}
24377
24378/**
24379 @brief Process Host-FW Capability Exchange Request function
24380
24381 @param pWDICtx: pointer to the WLAN DAL context
24382 pEventData: pointer to the event information structure
24383
24384 @see
24385 @return Result of the function call
24386*/
24387WDI_Status
24388WDI_ProcessFeatureCapsExchangeReq
24389(
24390 WDI_ControlBlockType* pWDICtx,
24391 WDI_EventInfoType* pEventData
24392)
24393{
24394 wpt_uint8* pSendBuffer = NULL;
24395 wpt_uint16 usDataOffset = 0;
24396 wpt_uint16 usSendSize = 0;
24397 wpt_uint16 usLen = 0;
24398
24399 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24400
24401 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24402 "%s", __FUNCTION__);
24403
24404 /*-------------------------------------------------------------------------
24405 Sanity check
24406 -------------------------------------------------------------------------*/
24407 /* Call back function is NULL since not required for cap exchange req */
24408 if (( NULL == pEventData ) ||
24409 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
24410 {
24411 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24412 "%s: Invalid parameters", __FUNCTION__);
24413 WDI_ASSERT(0);
24414 return WDI_STATUS_E_FAILURE;
24415 }
24416
24417 /*-----------------------------------------------------------------------
24418 Get message buffer
24419 -----------------------------------------------------------------------*/
24420 usLen = sizeof(tWlanFeatCaps);
24421
24422 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
24423 WDI_FEATURE_CAPS_EXCHANGE_REQ,
24424 usLen,
24425 &pSendBuffer, &usDataOffset, &usSendSize))||
24426 ( usSendSize < (usDataOffset + usLen )))
24427 {
24428 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24429 "Unable to get send buffer in feat caps exchange req %x %x",
24430 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
24431 WDI_ASSERT(0);
24432 return WDI_STATUS_E_FAILURE;
24433 }
24434
24435 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070024436 "Host Caps - %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024437 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
24438 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
24439 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
24440 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
24441 );
24442
24443 /* Copy host caps after the offset in the send buffer */
24444 wpalMemoryCopy( pSendBuffer+usDataOffset,
24445 (tWlanFeatCaps *)pEventData->pEventData,
24446 usLen);
24447
24448 /*-------------------------------------------------------------------------
24449 Send Start Request to HAL
24450 -------------------------------------------------------------------------*/
24451 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24452 (WDI_StartRspCb)pEventData->pCBfnc,
24453 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
24454
24455}/*WDI_ProcessFeatureCapsExchangeReq*/
24456
24457/**
24458 @brief Process Host-FW Capability Exchange Response function
24459
24460 @param pWDICtx: pointer to the WLAN DAL context
24461 pEventData: pointer to the event information structure
24462
24463 @see
24464 @return Result of the function call
24465*/
24466WDI_Status
24467WDI_ProcessFeatureCapsExchangeRsp
24468(
24469 WDI_ControlBlockType* pWDICtx,
24470 WDI_EventInfoType* pEventData
24471)
24472{
24473 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
24474 wpt_int32 fCapsStructSize;
24475 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24476
24477 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24478 "%s", __FUNCTION__);
24479
24480 /*-------------------------------------------------------------------------
24481 Sanity check
24482 -------------------------------------------------------------------------*/
24483 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24484 ( NULL == pEventData->pEventData ))
24485 {
24486 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24487 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24488 "%s: Invalid parameters", __FUNCTION__);
24489 WDI_ASSERT(0);
24490 return WDI_STATUS_E_FAILURE;
24491 }
24492
24493 /* Allocate memory separately for global variable carrying FW caps */
24494 fCapsStructSize = sizeof(tWlanFeatCaps);
24495 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24496 if ( NULL == gpFwWlanFeatCaps )
24497 {
24498 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24499 "Cannot allocate memory for host capability info\n");
24500 WDI_ASSERT(0);
24501 return WDI_STATUS_MEM_FAILURE;
24502 }
24503
24504 /*-------------------------------------------------------------------------
24505 Unpack HAL Response Message - the header was already extracted by the
24506 main Response Handling procedure
24507 -------------------------------------------------------------------------*/
24508 /*-------------------------------------------------------------------------
24509 Extract response and send it to UMAC
24510 -------------------------------------------------------------------------*/
24511
24512 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
24513 fCapsStructSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070024514 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24515 "FW caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024516 gpFwWlanFeatCaps->featCaps[0],
24517 gpFwWlanFeatCaps->featCaps[1],
24518 gpFwWlanFeatCaps->featCaps[2],
24519 gpFwWlanFeatCaps->featCaps[3]
24520 );
Jeff Johnsone7245742012-09-05 17:12:55 -070024521
Jeff Johnson295189b2012-06-20 16:38:30 -070024522 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
24523
24524 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
24525 if (wdiFeatureCapsExchangeCb != NULL)
24526 wdiFeatureCapsExchangeCb(NULL, NULL);
24527
24528 return WDI_STATUS_SUCCESS;
24529}
24530
Mohit Khanna4a70d262012-09-11 16:30:12 -070024531#ifdef WLAN_FEATURE_11AC
24532WDI_Status
24533WDI_ProcessUpdateVHTOpModeRsp
24534(
24535 WDI_ControlBlockType* pWDICtx,
24536 WDI_EventInfoType* pEventData
24537)
24538{
24539 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
24540 WDI_Status wdiStatus;
24541 eHalStatus halStatus;
24542
24543 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24544
24545 /*-------------------------------------------------------------------------
24546 Sanity check
24547 -------------------------------------------------------------------------*/
24548 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24549 ( NULL == pEventData->pEventData))
24550 {
24551 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24552 "%s: Invalid parameters", __FUNCTION__);
24553 WDI_ASSERT(0);
24554 return WDI_STATUS_E_FAILURE;
24555 }
24556 wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc;
24557
24558 /*-------------------------------------------------------------------------
24559 Extract response and send it to UMAC
24560 -------------------------------------------------------------------------*/
24561 halStatus = *((eHalStatus*)pEventData->pEventData);
24562 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24563
24564 /*Notify UMAC*/
24565 wdiVHTOpModeCb( wdiStatus, pEventData->pUserData);
24566
24567 return WDI_STATUS_SUCCESS;
24568}
24569#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070024570/**
24571 @brief WDI_getHostWlanFeatCaps
24572 WDI API that returns whether the feature passed to it as enum value in
24573 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
24574 variable storing host capability bitmap to find this. This can be used by
24575 other moduels to decide certain things like call different APIs based on
24576 whether a particular feature is supported.
24577
24578 @param
24579
24580 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
24581
24582 @see
24583 @return
24584 0 - if the feature is NOT supported in host
24585 any non-zero value - if the feature is SUPPORTED in host.
24586*/
24587wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
24588{
24589 wpt_uint8 featSupported = 0;
24590 if (gpHostWlanFeatCaps != NULL)
24591 {
24592 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
24593 }
24594 else
24595 {
24596 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070024597 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070024598 }
24599 return featSupported;
24600}
24601
24602/**
24603 @brief WDI_getFwWlanFeatCaps
24604 WDI API that returns whether the feature passed to it as enum value in
24605 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
24606 variable storing host capability bitmap to find this. This can be used by
24607 other moduels to decide certain things like call different APIs based on
24608 whether a particular feature is supported.
24609
24610 @param
24611
24612 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
24613 in wlan_hal_msg.h.
24614
24615 @see
24616 @return
24617 0 - if the feature is NOT supported in FW
24618 any non-zero value - if the feature is SUPPORTED in FW.
24619*/
24620wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
24621{
24622 wpt_uint8 featSupported = 0;
24623 if (gpFwWlanFeatCaps != NULL)
24624 {
24625 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
24626 }
24627 else
24628 {
24629 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070024630 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070024631 }
24632 return featSupported;
24633}
Mohit Khanna4a70d262012-09-11 16:30:12 -070024634
24635#ifdef WLAN_FEATURE_11AC
24636WDI_Status
24637WDI_ProcessUpdateVHTOpModeReq
24638(
24639 WDI_ControlBlockType* pWDICtx,
24640 WDI_EventInfoType* pEventData
24641)
24642{
24643 WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL;
24644 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
24645 wpt_uint8* pSendBuffer = NULL;
24646 wpt_uint16 usDataOffset = 0;
24647 wpt_uint16 usSendSize = 0;
24648
24649 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24650
24651 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24652 "%s", __FUNCTION__);
24653
24654 /*-------------------------------------------------------------------------
24655 Sanity check
24656 -------------------------------------------------------------------------*/
24657 if (( NULL == pEventData ) ||
24658 ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) ||
24659 ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc)))
24660 {
24661 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24662 "%s: Invalid parameters", __FUNCTION__);
24663 WDI_ASSERT(0);
24664 return WDI_STATUS_E_FAILURE;
24665 }
24666
24667 /*-----------------------------------------------------------------------
24668 Get message buffer
24669 -----------------------------------------------------------------------*/
24670 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ,
24671 sizeof(WDI_UpdateVHTOpMode),
24672 &pSendBuffer, &usDataOffset, &usSendSize))||
24673 ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) )))
24674 {
24675 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24676 "Unable to get send buffer in update vht opMode req");
24677 WDI_ASSERT(0);
24678 return WDI_STATUS_E_FAILURE;
24679 }
24680
24681 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24682 "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId);
24683
24684 wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams,
24685 sizeof(WDI_UpdateVHTOpMode));
24686
24687 /*-------------------------------------------------------------------------
24688 Send Start Request to HAL
24689 -------------------------------------------------------------------------*/
24690 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24691 wdiVHTOpModeCb,
24692 pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP);
24693
24694}
24695
24696WDI_Status
24697WDI_UpdateVHTOpModeReq
24698(
24699 WDI_UpdateVHTOpMode *pData,
24700 WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb,
24701 void* pUserData
24702)
24703{
24704 WDI_EventInfoType wdiEventData;
24705
24706 /*------------------------------------------------------------------------
24707 Sanity Check
24708 ------------------------------------------------------------------------*/
24709 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24710 {
24711 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24712 "WDI API call before module is initialized - Fail request");
24713
24714 return WDI_STATUS_E_NOT_ALLOWED;
24715 }
24716
24717 /*------------------------------------------------------------------------
24718 Fill in Event data and post to the Main FSM
24719 ------------------------------------------------------------------------*/
24720 wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ;
24721 wdiEventData.pEventData = pData;
24722 wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode);
24723 wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb;
24724 wdiEventData.pUserData = pUserData;
24725
24726 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24727 "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId);
24728
24729 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24730
24731}
24732#endif