blob: 550069181d4829f9a03cda00682a3f51ad49dee6 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*===========================================================================
23
24 W L A N _ Q C T _ W D I. C
25
26 OVERVIEW:
27
Jeff Johnsone7245742012-09-05 17:12:55 -070028 This software unit holds the implementation of the WLAN Device Abstraction
Jeff Johnson295189b2012-06-20 16:38:30 -070029 Layer Interface.
30
Jeff Johnsone7245742012-09-05 17:12:55 -070031 The functions externalized by this module are to be called by any upper
Jeff Johnson295189b2012-06-20 16:38:30 -070032 MAC implementation that wishes to use the WLAN Device.
33
34 DEPENDENCIES:
35
36 Are listed for each API below.
37
38
39 Copyright (c) 2008 QUALCOMM Incorporated.
40 All Rights Reserved.
41 Qualcomm Confidential and Proprietary
42===========================================================================*/
43
44/*===========================================================================
45
46 EDIT HISTORY FOR FILE
47
48
49 This section contains comments describing changes made to the module.
50 Notice that changes are listed in reverse chronological order.
51
52
53 $Header$$DateTime$$Author$
54
55
56 when who what, where, why
57---------- --- --------------------------------------------------------
5810/05/11 hap Adding support for Keep Alive
592010-08-09 lti Created module
60
61===========================================================================*/
62
63/*----------------------------------------------------------------------------
64 * Include Files
65 * -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070066#include "wlan_qct_wdi.h"
67#include "wlan_qct_wdi_i.h"
68#include "wlan_qct_wdi_sta.h"
69#include "wlan_qct_wdi_dp.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070070
Jeff Johnsone7245742012-09-05 17:12:55 -070071#include "wlan_qct_wdi_cts.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070072
73#include "wlan_qct_pal_api.h"
74#include "wlan_qct_pal_type.h"
75#include "wlan_qct_pal_status.h"
76#include "wlan_qct_pal_sync.h"
77#include "wlan_qct_pal_msg.h"
78#include "wlan_qct_pal_trace.h"
79#include "wlan_qct_pal_packet.h"
80
Jeff Johnsone7245742012-09-05 17:12:55 -070081#include "wlan_qct_wdi_dts.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070082
83#include "wlan_hal_msg.h"
84
85#ifdef ANI_MANF_DIAG
86#include "pttMsgApi.h"
87#endif /* ANI_MANF_DIAG */
88
89/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070090 WLAN DAL Control Path Internal Data Definitions and Declarations
Jeff Johnson295189b2012-06-20 16:38:30 -070091 ===========================================================================*/
92#define WDI_WCTS_ACTION_TIMEOUT 2000 /* in msec a very high upper limit */
93
Jeff Johnsone7245742012-09-05 17:12:55 -070094#define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
95#define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x"
96
Jeff Johnson295189b2012-06-20 16:38:30 -070097
98#ifdef FEATURE_WLAN_SCAN_PNO
99#define WDI_PNO_VERSION_MASK 0x8000
100#endif
101
102/* host capability bitmap global */
103static tWlanFeatCaps *gpHostWlanFeatCaps = NULL;
104/* FW capability bitmap global */
105static tWlanFeatCaps *gpFwWlanFeatCaps = NULL;
106/* array of features supported. Need to add a new feature
107 * and other two places - wlan_hal_msg.h and halMsg.c (FW file)
108 */
109static placeHolderInCapBitmap supportEnabledFeatures[] =
Mohit Khanna4a70d262012-09-11 16:30:12 -0700110 {MCC, P2P, DOT11AC, SLM_SESSIONIZATION, DOT11AC_OPMODE};
Jeff Johnson295189b2012-06-20 16:38:30 -0700111
112/*--------------------------------------------------------------------------
113 WLAN DAL State Machine
114 --------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700115WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] =
Jeff Johnson295189b2012-06-20 16:38:30 -0700116{
117 /*WDI_INIT_ST*/
118 {{
119 WDI_MainStart, /*WDI_START_EVENT*/
120 NULL, /*WDI_STOP_EVENT*/
121 WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/
122 WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/
123 WDI_MainClose, /*WDI_CLOSE_EVENT*/
124 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
125 }},
126
127 /*WDI_STARTED_ST*/
128 {{
129 WDI_MainStartStarted, /*WDI_START_EVENT*/
130 WDI_MainStopStarted, /*WDI_STOP_EVENT*/
131 WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/
132 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
133 NULL, /*WDI_CLOSE_EVENT*/
134 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
135 }},
136
137 /*WDI_STOPPED_ST*/
138 {{
139 WDI_MainStart, /*WDI_START_EVENT*/
140 WDI_MainStopStopped, /*WDI_STOP_EVENT*/
141 NULL, /*WDI_REQUEST_EVENT*/
142 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
143 WDI_MainClose, /*WDI_CLOSE_EVENT*/
144 NULL /*WDI_SHUTDOWN_EVENT*/
145 }},
146
147 /*WDI_BUSY_ST*/
148 {{
149 WDI_MainStartBusy, /*WDI_START_EVENT*/
150 WDI_MainStopBusy, /*WDI_STOP_EVENT*/
151 WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/
152 WDI_MainRsp, /*WDI_RESPONSE_EVENT*/
153 WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/
154 WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/
155 }}
156};
157
Jeff Johnsone7245742012-09-05 17:12:55 -0700158/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700159 DAL Request Processing Array - the functions in this table will only be
160 called when the processing of the specific request is allowed by the
Jeff Johnsone7245742012-09-05 17:12:55 -0700161 Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -0700162 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700163WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] =
Jeff Johnson295189b2012-06-20 16:38:30 -0700164{
165 /*INIT*/
166 WDI_ProcessStartReq, /* WDI_START_REQ */
167 WDI_ProcessStopReq, /* WDI_STOP_REQ */
168 WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */
169
170 /*SCAN*/
171 WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */
172 WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */
173 WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */
174 WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */
175
176 /*ASSOCIATION*/
177 WDI_ProcessJoinReq, /* WDI_JOIN_REQ */
178 WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */
179 WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */
180 WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */
181 WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */
182
183 /* Security */
184 WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */
185 WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */
186 WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */
187 WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */
188
189 /* QoS and BA APIs */
190 WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */
191 WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */
192 WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */
193 WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */
194 WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */
195
196 /* Miscellaneous Control APIs */
197 WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */
198 WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */
199 WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */
200 WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */
201 WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */
202
203 /*BA APIs*/
204 WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */
205 WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */
206
207 /*Beacon processing APIs*/
208 WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */
209 WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */
210
211 WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */
212 WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */
213 WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */
214 WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/
215#ifdef WLAN_FEATURE_P2P
216 WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */
217#else
218 NULL,
219#endif
220 /* PowerSave APIs */
221 WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */
222 WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */
223 WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */
224 WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */
225 WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */
226 WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */
227 WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */
228 WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */
229 WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */
230 WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */
231 WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */
232 WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */
233 WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */
234 WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */
235 WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */
236 WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */
237 WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */
238 WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */
239 /*NV Download APIs*/
240 WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/
241 WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */
242 WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */
243#ifdef WLAN_FEATURE_VOWIFI_11R
244 WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */
245#else
246 NULL,
247#endif /* WLAN_FEATURE_VOWIFI_11R */
248 WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */
249 WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */
250#ifdef ANI_MANF_DIAG
251 WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */
252#else
253 NULL,
254#endif /* ANI_MANF_DIAG */
Jeff Johnsone7245742012-09-05 17:12:55 -0700255
256#ifdef FEATURE_OEM_DATA_SUPPORT
257 WDI_ProcessStartOemDataReq, /*WDI_START_OEM_DATA_REQ*/
258#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700259 NULL,
Jeff Johnsone7245742012-09-05 17:12:55 -0700260#endif /*FEATURE_OEM_DATA_SUPPORT*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700261 WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700262
263 WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */
Jeff Johnson295189b2012-06-20 16:38:30 -0700264
265#ifdef FEATURE_WLAN_SCAN_PNO
266 WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */
267 WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */
268 WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */
269#else
270 NULL,
271 NULL,
272 NULL,
273#endif /* FEATURE_WLAN_SCAN_PNO */
274
275 WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700276
Jeff Johnson295189b2012-06-20 16:38:30 -0700277#ifdef WLAN_FEATURE_PACKET_FILTERING
278 /* WDI_8023_MULTICAST_LIST_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700279 WDI_Process8023MulticastListReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700280 /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700281 WDI_ProcessReceiveFilterSetFilterReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700283 WDI_ProcessFilterMatchCountReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700284 /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */
Jeff Johnsone7245742012-09-05 17:12:55 -0700285 WDI_ProcessReceiveFilterClearFilterReq,
Jeff Johnson295189b2012-06-20 16:38:30 -0700286#else
287 NULL,
288 NULL,
289 NULL,
290 NULL,
291#endif // WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -0700292 WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */
Jeff Johnson295189b2012-06-20 16:38:30 -0700293 WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */
294 WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */
295
296 WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/
297#ifdef FEATURE_WLAN_CCX
298 WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */
299#else
300 NULL,
301#endif
302
303#ifdef WLAN_FEATURE_GTK_OFFLOAD
304 WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */
305 WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */
306#else
307 NULL,
308 NULL,
309#endif // WLAN_FEATURE_GTK_OFFLOAD
310
311 WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/
312 WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */
Mohit Khanna4a70d262012-09-11 16:30:12 -0700313#ifdef WLAN_FEATURE_11AC
314 WDI_ProcessUpdateVHTOpModeReq, /* WDI_UPDATE_VHT_OP_MODE_REQ */
315#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700316 /*-------------------------------------------------------------------------
317 Indications
318 -------------------------------------------------------------------------*/
319 WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/
320};
321
322
Jeff Johnsone7245742012-09-05 17:12:55 -0700323/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700324 DAL Request Processing Array - the functions in this table will only be
325 called when the processing of the specific request is allowed by the
Jeff Johnsone7245742012-09-05 17:12:55 -0700326 Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -0700327 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700328WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] =
Jeff Johnson295189b2012-06-20 16:38:30 -0700329{
330 /*INIT*/
331 WDI_ProcessStartRsp, /* WDI_START_RESP */
332 WDI_ProcessStopRsp, /* WDI_STOP_RESP */
333 WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */
334
335 /*SCAN*/
336 WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */
337 WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */
338 WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */
339 WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */
340
341 /* ASSOCIATION*/
342 WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */
343 WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */
344 WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */
345 WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */
346 WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */
347
348 /* Security */
349 WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */
350 WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */
351 WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */
352 WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */
353
354 /* QoS and BA APIs */
355 WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */
356 WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */
357 WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */
358 WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */
359 WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */
360
361 /* Miscellaneous Control APIs */
362 WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */
363 WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */
364 WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */
365 WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */
366 WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */
367
368 /* BA APIs*/
369 WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */
370 WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700371
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 /* IBSS APIs*/
373 WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */
374 WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */
375
376 /*Soft AP APIs*/
377 WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */
378 WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */
379 WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */
380 WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */
381
382 /* PowerSave APIs */
383 WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */
384 WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */
385 WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */
386 WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */
387 WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */
388 WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */
389 WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */
390 WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */
391 WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */
392 WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */
393 WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */
394 WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */
395 WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */
396 WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */
397 WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */
398 WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */
399 WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */
400 WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700401
Jeff Johnson295189b2012-06-20 16:38:30 -0700402
403 WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/
404
405 WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */
406 WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */
407#ifdef WLAN_FEATURE_VOWIFI_11R
408 WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */
409#else
410 NULL,
411#endif /* WLAN_FEATURE_VOWIFI_11R */
412 WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */
413 WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700414#ifdef FEATURE_OEM_DATA_SUPPORT
415 WDI_ProcessStartOemDataRsp, /*WDI_START_OEM_DATA_RESP*/
416#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700417 NULL,
Jeff Johnsone7245742012-09-05 17:12:55 -0700418#endif /*FEATURE_OEM_DATA_SUPPORT*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700419 WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/
420
421#ifdef WLAN_FEATURE_P2P
422 WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */
423#else
424 NULL,
425#endif
426
427#ifdef ANI_MANF_DIAG
428 WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */
429#else
430 NULL,
431#endif /* ANI_MANF_DIAG */
432
Jeff Johnsone7245742012-09-05 17:12:55 -0700433 WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */
434
Jeff Johnson295189b2012-06-20 16:38:30 -0700435#ifdef FEATURE_WLAN_SCAN_PNO
436 WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */
437 WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */
438 WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */
439#else
440 NULL,
441 NULL,
442 NULL,
443#endif // FEATURE_WLAN_SCAN_PNO
444
445 WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */
446
447 /*---------------------------------------------------------------------
448 Indications
449 ---------------------------------------------------------------------*/
450#ifdef WLAN_FEATURE_PACKET_FILTERING
451 /* WDI_8023_MULTICAST_LIST_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700452 WDI_Process8023MulticastListRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700453 /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700454 WDI_ProcessReceiveFilterSetFilterRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700455 /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700456 WDI_ProcessFilterMatchCountRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700457 /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */
Jeff Johnsone7245742012-09-05 17:12:55 -0700458 WDI_ProcessReceiveFilterClearFilterRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -0700459#else
460 NULL,
461 NULL,
462 NULL,
463 NULL,
464#endif // WLAN_FEATURE_PACKET_FILTERING
465
466 WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */
467 WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */
468
469 WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/
470#ifdef FEATURE_WLAN_CCX
471 WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */
472#else
473 NULL,
474#endif
475
476#ifdef WLAN_FEATURE_GTK_OFFLOAD
Jeff Johnsone7245742012-09-05 17:12:55 -0700477 WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */
478 WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */
Jeff Johnson295189b2012-06-20 16:38:30 -0700479#else
480 NULL,
481 NULL,
482#endif // WLAN_FEATURE_GTK_OFFLOAD
Jeff Johnsone7245742012-09-05 17:12:55 -0700483 WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */
484 WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */
Mohit Khanna4a70d262012-09-11 16:30:12 -0700485#ifdef WLAN_FEATURE_11AC
486 WDI_ProcessUpdateVHTOpModeRsp, /* WDI_UPDATE_VHT_OP_MODE_RESP */
487#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700488
489 /*---------------------------------------------------------------------
490 Indications
491 ---------------------------------------------------------------------*/
492 WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */
493 WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */
494 WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */
495 WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */
496 WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */
497 WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */
498
499 WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */
500
501 WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */
502
503#ifdef WLAN_FEATURE_P2P
504 WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/
505#else
506 NULL,
507#endif
508
509#ifdef FEATURE_WLAN_SCAN_PNO
510 WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */
511#else
512 NULL,
513#endif // FEATURE_WLAN_SCAN_PNO
514
515#ifdef WLAN_WAKEUP_EVENTS
516 WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */
517#else // WLAN_WAKEUP_EVENTS
518 NULL,
519#endif // WLAN_WAKEUP_EVENTS
520
521 WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */
522};
523
524
Jeff Johnsone7245742012-09-05 17:12:55 -0700525/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700526 WLAN DAL Global Control Block
527 ---------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700528WDI_ControlBlockType gWDICb;
Jeff Johnson295189b2012-06-20 16:38:30 -0700529static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE;
530
Jeff Johnsone7245742012-09-05 17:12:55 -0700531const wpt_uint8 szTransportChName[] = "WLAN_CTRL";
Jeff Johnson295189b2012-06-20 16:38:30 -0700532
533/*Helper routine for retrieving the PAL Context from WDI*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700534WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -0700535void* WDI_GET_PAL_CTX( void )
536{
Jeff Johnsone7245742012-09-05 17:12:55 -0700537 return gWDICb.pPALContext;
Jeff Johnson295189b2012-06-20 16:38:30 -0700538}/*WDI_GET_PAL_CTX*/
539
Jeff Johnsone7245742012-09-05 17:12:55 -0700540/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 Helper inline converters
542 ============================================================================*/
543/*Convert WDI driver type into HAL driver type*/
544WPT_STATIC WPT_INLINE WDI_Status
545WDI_HAL_2_WDI_STATUS
546(
547 eHalStatus halStatus
548);
549
550/*Convert WDI request type into HAL request type*/
551WPT_STATIC WPT_INLINE tHalHostMsgType
552WDI_2_HAL_REQ_TYPE
553(
554 WDI_RequestEnumType wdiReqType
555);
556
557/*Convert WDI response type into HAL response type*/
558WPT_STATIC WPT_INLINE WDI_ResponseEnumType
559HAL_2_WDI_RSP_TYPE
560(
561 tHalHostMsgType halMsg
562);
563
564/*Convert WDI driver type into HAL driver type*/
565WPT_STATIC WPT_INLINE tDriverType
566WDI_2_HAL_DRV_TYPE
567(
568 WDI_DriverType wdiDriverType
569);
570
571/*Convert WDI stop reason into HAL stop reason*/
572WPT_STATIC WPT_INLINE tHalStopType
573WDI_2_HAL_STOP_REASON
574(
575 WDI_StopType wdiStopType
576);
577
578/*Convert WDI scan mode type into HAL scan mode type*/
579WPT_STATIC WPT_INLINE eHalSysMode
580WDI_2_HAL_SCAN_MODE
581(
582 WDI_ScanMode wdiScanMode
583);
584
585/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700586WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -0700587WDI_2_HAL_SEC_CH_OFFSET
588(
589 WDI_HTSecondaryChannelOffset wdiSecChOffset
590);
591
592/*Convert WDI BSS type into HAL BSS type*/
593WPT_STATIC WPT_INLINE tSirBssType
594WDI_2_HAL_BSS_TYPE
595(
596 WDI_BssType wdiBSSType
597);
598
599/*Convert WDI NW type into HAL NW type*/
600WPT_STATIC WPT_INLINE tSirNwType
601WDI_2_HAL_NW_TYPE
602(
603 WDI_NwType wdiNWType
604);
605
606/*Convert WDI chanel bonding type into HAL cb type*/
607WPT_STATIC WPT_INLINE ePhyChanBondState
608WDI_2_HAL_CB_STATE
609(
610 WDI_PhyChanBondState wdiCbState
611);
612
613/*Convert WDI chanel bonding type into HAL cb type*/
614WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
615WDI_2_HAL_HT_OPER_MODE
616(
617 WDI_HTOperatingMode wdiHTOperMode
618);
619
620/*Convert WDI mimo PS type into HAL mimo PS type*/
621WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
622WDI_2_HAL_MIMO_PS
623(
624 WDI_HTMIMOPowerSaveState wdiHTOperMode
625);
626
627/*Convert WDI ENC type into HAL ENC type*/
628WPT_STATIC WPT_INLINE tAniEdType
629WDI_2_HAL_ENC_TYPE
630(
631 WDI_EncryptType wdiEncType
632);
633
634/*Convert WDI WEP type into HAL WEP type*/
635WPT_STATIC WPT_INLINE tAniWepType
636WDI_2_HAL_WEP_TYPE
637(
638 WDI_WepType wdiWEPType
639);
640
641/*Convert WDI Link State into HAL Link State*/
642WPT_STATIC WPT_INLINE tSirLinkState
643WDI_2_HAL_LINK_STATE
644(
645 WDI_LinkStateType wdiLinkState
646);
647
Jeff Johnsone7245742012-09-05 17:12:55 -0700648/*Translate a STA Context from WDI into HAL*/
649WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -0700650void
651WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -0700652(
Jeff Johnson295189b2012-06-20 16:38:30 -0700653 tConfigStaParams* phalConfigSta,
654 WDI_ConfigStaReqInfoType* pwdiConfigSta
655);
Jeff Johnsone7245742012-09-05 17:12:55 -0700656
657/*Translate a Rate set info from WDI into HAL*/
658WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -0700659WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -0700660(
Jeff Johnson295189b2012-06-20 16:38:30 -0700661 tSirMacRateSet* pHalRateSet,
662 WDI_RateSet* pwdiRateSet
663);
664
665/*Translate an EDCA Parameter Record from WDI into HAL*/
666WPT_STATIC WPT_INLINE void
667WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -0700668(
Jeff Johnson295189b2012-06-20 16:38:30 -0700669 tSirMacEdcaParamRecord* phalEdcaParam,
670 WDI_EdcaParamRecord* pWDIEdcaParam
671);
672
673/*Copy a management frame header from WDI fmt into HAL fmt*/
674WPT_STATIC WPT_INLINE void
675WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
676(
677 tSirMacMgmtHdr* pmacMgmtHdr,
678 WDI_MacMgmtHdr* pwdiMacMgmtHdr
679);
680
681/*Copy config bss parameters from WDI fmt into HAL fmt*/
682WPT_STATIC WPT_INLINE void
683WDI_CopyWDIConfigBSSToHALConfigBSS
684(
685 tConfigBssParams* phalConfigBSS,
686 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
687);
688
Jeff Johnsone7245742012-09-05 17:12:55 -0700689/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 pointed to by user data */
691WPT_STATIC WPT_INLINE void
692WDI_ExtractRequestCBFromEvent
693(
694 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -0700695 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -0700696 void** ppUserData
697);
698
699wpt_uint8
700WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -0700701(
Jeff Johnson295189b2012-06-20 16:38:30 -0700702 WDI_ControlBlockType* pWDICtx,
703 WDI_BSSSessionType** ppSession
704);
705
706void
707WDI_AddBcastSTAtoSTATable
708(
709 WDI_ControlBlockType* pWDICtx,
710 WDI_AddStaParams * staParams,
711 wpt_uint16 usBcastStaIdx
712);
713
714WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -0700715(
Jeff Johnson295189b2012-06-20 16:38:30 -0700716 WDI_ControlBlockType* pWDICtx,
717 WDI_EventInfoType* pEventData
718);
719
720void
721WDI_SetPowerStateCb
722(
723 wpt_status status,
724 unsigned int dxePhyAddr,
725 void *pContext
726);
727
728#define CASE_RETURN_STRING( str ) \
729 case ( ( str ) ): return( #str ); break \
730
731/**
732 @brief WDI_getReqMsgString prints the WDI request message in string.
Jeff Johnsone7245742012-09-05 17:12:55 -0700733
734 @param wdiReqMsgId: WDI Message request Id
735
736 @see
Jeff Johnson295189b2012-06-20 16:38:30 -0700737 @return Result of the function call
738*/
739static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId)
740{
741 switch (wdiReqMsgId)
742 {
743 CASE_RETURN_STRING( WDI_START_REQ );
744 CASE_RETURN_STRING( WDI_STOP_REQ );
745 CASE_RETURN_STRING( WDI_CLOSE_REQ );
746 CASE_RETURN_STRING( WDI_INIT_SCAN_REQ );
747 CASE_RETURN_STRING( WDI_START_SCAN_REQ );
748 CASE_RETURN_STRING( WDI_END_SCAN_REQ );
749 CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ );
750 CASE_RETURN_STRING( WDI_JOIN_REQ );
751 CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ );
752 CASE_RETURN_STRING( WDI_DEL_BSS_REQ );
753 CASE_RETURN_STRING( WDI_POST_ASSOC_REQ );
754 CASE_RETURN_STRING( WDI_DEL_STA_REQ );
755 CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ );
756 CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ );
757 CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ );
758 CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ );
759 CASE_RETURN_STRING( WDI_ADD_TS_REQ );
760 CASE_RETURN_STRING( WDI_DEL_TS_REQ );
761 CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ );
762 CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ );
763 CASE_RETURN_STRING( WDI_DEL_BA_REQ );
764 CASE_RETURN_STRING( WDI_CH_SWITCH_REQ );
765 CASE_RETURN_STRING( WDI_CONFIG_STA_REQ );
766 CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ );
767 CASE_RETURN_STRING( WDI_GET_STATS_REQ );
768 CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ );
769 CASE_RETURN_STRING( WDI_ADD_BA_REQ );
770 CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ );
771 CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ );
772 CASE_RETURN_STRING( WDI_SND_BCON_REQ );
773 CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ );
774 CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ );
775 CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ );
776 CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ );
777 CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ );
778 CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ );
779 CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ );
780 CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ );
781 CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ );
782 CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ );
783 CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ );
784 CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ );
785 CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ );
786 CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ );
787 CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ);
788 CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ );
789 CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ );
790 CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ );
791 CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ );
792 CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ );
793 CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ );
794 CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ );
795 CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ );
796 CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ );
797 CASE_RETURN_STRING( WDI_FLUSH_AC_REQ );
798 CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ );
799 CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ );
800 CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ );
801 CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ );
802 CASE_RETURN_STRING( WDI_FTM_CMD_REQ );
Jeff Johnsone7245742012-09-05 17:12:55 -0700803 CASE_RETURN_STRING( WDI_START_OEM_DATA_REQ );
Jeff Johnson295189b2012-06-20 16:38:30 -0700804 CASE_RETURN_STRING( WDI_HOST_RESUME_REQ );
805 CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ);
806 #ifdef FEATURE_WLAN_SCAN_PNO
807 CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ );
808 CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ );
809 CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ );
810 #endif
811 CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ );
812 CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ );
813 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ );
814 CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ );
815 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ );
816 CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ );
817 CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ );
818 CASE_RETURN_STRING( WDI_SHUTDOWN_REQ );
819 CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ );
820 default:
821 return "Unknown WDI MessageId";
822 }
823}
824
825
826
827/**
828 @brief WDI_getRespMsgString prints the WDI resonse message in string.
Jeff Johnsone7245742012-09-05 17:12:55 -0700829
830 @param wdiRespMsgId: WDI Message response Id
831
832 @see
Jeff Johnson295189b2012-06-20 16:38:30 -0700833 @return Result of the function call
834*/
835static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId)
836{
837 switch (wdiRespMsgId)
838 {
839 CASE_RETURN_STRING( WDI_START_RESP );
840 CASE_RETURN_STRING( WDI_STOP_RESP );
841 CASE_RETURN_STRING( WDI_CLOSE_RESP );
842 CASE_RETURN_STRING( WDI_INIT_SCAN_RESP );
843 CASE_RETURN_STRING( WDI_START_SCAN_RESP );
844 CASE_RETURN_STRING( WDI_END_SCAN_RESP );
845 CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP );
846 CASE_RETURN_STRING( WDI_JOIN_RESP );
847 CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP );
848 CASE_RETURN_STRING( WDI_DEL_BSS_RESP );
849 CASE_RETURN_STRING( WDI_POST_ASSOC_RESP );
850 CASE_RETURN_STRING( WDI_DEL_STA_RESP );
851 CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP );
852 CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP );
853 CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP );
854 CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP );
855 CASE_RETURN_STRING( WDI_ADD_TS_RESP );
856 CASE_RETURN_STRING( WDI_DEL_TS_RESP );
857 CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP );
858 CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP );
859 CASE_RETURN_STRING( WDI_DEL_BA_RESP );
860 CASE_RETURN_STRING( WDI_CH_SWITCH_RESP );
861 CASE_RETURN_STRING( WDI_CONFIG_STA_RESP );
862 CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP );
863 CASE_RETURN_STRING( WDI_GET_STATS_RESP );
864 CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP );
865 CASE_RETURN_STRING( WDI_ADD_BA_RESP );
866 CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP );
867 CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP );
868 CASE_RETURN_STRING( WDI_SND_BCON_RESP );
869 CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP );
870 CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP );
871 CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP );
872 CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP );
873 CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP );
874 CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP );
875 CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP );
876 CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP );
877 CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP );
878 CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP );
879 CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP );
880 CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP );
881 CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP );
882 CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP );
883 CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP);
884 CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP );
885 CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP );
886 CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP );
887 CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP );
888 CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP );
889 CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP );
890 CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP );
891 CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP );
892 CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP );
893 CASE_RETURN_STRING( WDI_FLUSH_AC_RESP );
894 CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP );
895 CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP );
896 CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP );
897 CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP );
898 CASE_RETURN_STRING( WDI_FTM_CMD_RESP );
Jeff Johnsone7245742012-09-05 17:12:55 -0700899 CASE_RETURN_STRING( WDI_START_OEM_DATA_RESP );
Jeff Johnson295189b2012-06-20 16:38:30 -0700900 CASE_RETURN_STRING( WDI_HOST_RESUME_RESP );
901 CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP);
902 #ifdef FEATURE_WLAN_SCAN_PNO
903 CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP );
904 CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP );
905 CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP );
906 #endif
907 CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP );
908 CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP );
909 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP );
910 CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP );
911 CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP );
912 CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP );
913 CASE_RETURN_STRING( WDI_SHUTDOWN_RESP );
914 CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP );
915 default:
916 return "Unknown WDI MessageId";
917 }
918}
919
920/**
921 @brief WDI_getHALStatusMsgString prints the HAL status in string.
Jeff Johnsone7245742012-09-05 17:12:55 -0700922
923 @param halStatusId: HAL status Id
924
925 @see
Jeff Johnson295189b2012-06-20 16:38:30 -0700926 @return Result of the function call
927*/
928static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId)
929{
930 switch (halStatusId)
931 {
932 CASE_RETURN_STRING( eHAL_STATUS_SUCCESS );
933 CASE_RETURN_STRING( PAL_STATUS_INVAL );
934 CASE_RETURN_STRING( PAL_STATUS_ALREADY );
935 CASE_RETURN_STRING( PAL_STATUS_EMPTY );
936 CASE_RETURN_STRING( PAL_STATUS_FAILURE );
937 CASE_RETURN_STRING( eHAL_STATUS_FAILURE );
938 CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER );
939 CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX );
940 CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL );
941 CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS );
942 CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT );
943 CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL );
944 CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA );
945 CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID );
946 CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID );
947 CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID );
948 CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX );
949 CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL );
950 CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE );
951 CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID );
952 CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN );
953 CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL );
954 CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL );
955 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL );
956 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED );
957 CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID );
958 CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED );
959 CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED );
960 CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC );
961 CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL );
962 CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO );
963 CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO );
964 CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED );
965 default:
966 return "Unknown HAL status";
967 }
968}
969
Jeff Johnsone7245742012-09-05 17:12:55 -0700970/*========================================================================
971
Jeff Johnson295189b2012-06-20 16:38:30 -0700972 INITIALIZATION APIs
Jeff Johnsone7245742012-09-05 17:12:55 -0700973
Jeff Johnson295189b2012-06-20 16:38:30 -0700974==========================================================================*/
975
976/**
977 @brief WDI_Init is used to initialize the DAL.
Jeff Johnsone7245742012-09-05 17:12:55 -0700978
Jeff Johnson295189b2012-06-20 16:38:30 -0700979 DAL will allocate all the resources it needs. It will open PAL, it will also
980 open both the data and the control transport which in their turn will open
Jeff Johnsone7245742012-09-05 17:12:55 -0700981 DXE/SMD or any other drivers that they need.
982
Jeff Johnson295189b2012-06-20 16:38:30 -0700983 @param pOSContext: pointer to the OS context provided by the UMAC
984 will be passed on to PAL on Open
985 ppWDIGlobalCtx: output pointer of Global Context
986 pWdiDevCapability: output pointer of device capability
987
988 @return Result of the function call
989*/
Jeff Johnsone7245742012-09-05 17:12:55 -0700990WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -0700991WDI_Init
Jeff Johnsone7245742012-09-05 17:12:55 -0700992(
Jeff Johnson295189b2012-06-20 16:38:30 -0700993 void* pOSContext,
994 void** ppWDIGlobalCtx,
995 WDI_DeviceCapabilityType* pWdiDevCapability,
996 unsigned int driverType
997)
998{
999 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -07001000 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001001 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -07001002 WCTS_TransportCBsType wctsCBs;
Jeff Johnson295189b2012-06-20 16:38:30 -07001003 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
1004
1005 /*---------------------------------------------------------------------
1006 Sanity check
1007 ---------------------------------------------------------------------*/
1008 if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability ))
1009 {
1010 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1011 "Invalid input parameters in WDI_Init");
1012
Jeff Johnsone7245742012-09-05 17:12:55 -07001013 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001014 }
1015
1016 /*---------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001017 Check to see if the module has already been initialized or not
Jeff Johnson295189b2012-06-20 16:38:30 -07001018 ---------------------------------------------------------------------*/
1019 if ( eWLAN_PAL_FALSE != gWDIInitialized )
1020 {
1021 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1022 "WDI module already initialized - return");
1023
Jeff Johnsone7245742012-09-05 17:12:55 -07001024 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07001025 }
1026
1027 /*Module is now initialized - this flag is to ensure the fact that multiple
1028 init will not happen on WDI
1029 !! - potential race does exist because read and set are not atomic,
1030 however an atomic operation would be closely here - reanalyze if necessary*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001031 gWDIInitialized = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001032
1033 /*Setup the control block */
1034 WDI_CleanCB(&gWDICb);
Jeff Johnsone7245742012-09-05 17:12:55 -07001035 gWDICb.pOSContext = pOSContext;
Jeff Johnson295189b2012-06-20 16:38:30 -07001036
1037 /*Setup the STA Table*/
1038 wdiStatus = WDI_STATableInit(&gWDICb);
1039 if ( WDI_STATUS_SUCCESS != wdiStatus )
1040 {
1041 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1042 "%s: Failure while initializing STA Table, status %d",
1043 __FUNCTION__, wdiStatus);
1044 goto fail_STATableInit;
1045 }
1046
1047 /*------------------------------------------------------------------------
1048 Open the PAL
1049 ------------------------------------------------------------------------*/
1050 wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext);
1051 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1052 {
1053 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1054 "%s: Failed to open PAL, status %d",
1055 __FUNCTION__, wptStatus);
1056 goto fail_wpalOpen;
1057 }
1058
1059 /*Initialize main synchro mutex - it will be used to ensure integrity of
1060 the main WDI Control Block*/
1061 wptStatus = wpalMutexInit(&gWDICb.wptMutex);
1062 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1063 {
1064 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1065 "%s: Failed to init mutex, status %d",
1066 __FUNCTION__, wptStatus);
1067 goto fail_mutex;
1068 }
1069
1070 /*Initialize the response timer - it will be used to time all messages
1071 expected as response from device*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001072 wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer,
1073 WDI_ResponseTimerCB,
Jeff Johnson295189b2012-06-20 16:38:30 -07001074 &gWDICb);
1075 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1076 {
1077 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1078 "%s: Failed to init response timer, status %d",
1079 __FUNCTION__, wptStatus);
1080 goto fail_timer;
1081 }
1082
1083 /* Initialize the WDI Pending Request Queue*/
1084 wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue));
1085 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1086 {
1087 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1088 "%s: Failed to init pending request queue, status %d",
1089 __FUNCTION__, wptStatus);
1090 goto fail_pend_queue;
1091 }
1092
1093 /*Init WDI Pending Assoc Id Queue */
1094 wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue));
1095 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1096 {
1097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1098 "%s: Failed to init assoc session queue, status %d",
1099 __FUNCTION__, wptStatus);
1100 goto fail_assoc_queue;
1101 }
1102
1103 /*Initialize the BSS sessions pending Queue */
1104 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1105 {
1106 wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1107 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1108 {
1109 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1110 "%s: Failed to init BSS %d pending queue, status %d",
1111 __FUNCTION__, i, wptStatus);
1112 goto fail_bss_queue;
1113 }
1114 }
1115
1116 /*Indicate the control block is sufficiently initialized for callbacks*/
1117 gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC;
1118
1119 /*------------------------------------------------------------------------
1120 Initialize the Data Path Utility Module
1121 ------------------------------------------------------------------------*/
1122 wdiStatus = WDI_DP_UtilsInit(&gWDICb);
1123 if ( WDI_STATUS_SUCCESS != wdiStatus )
1124 {
1125 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1126 "%s: Failed to initialize the DP Util Module, status %d",
1127 __FUNCTION__, wdiStatus);
1128 goto fail_dp_util_init;
1129 }
1130
1131 /* Init Set power state event */
1132 wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001133 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001134 {
1135 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1136 "%s: Failed to initialize power state event, status %d",
1137 __FUNCTION__, wptStatus);
1138 goto fail_power_event;
1139 }
1140
1141 /* Init WCTS action event */
1142 wptStatus = wpalEventInit(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001143 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001144 {
1145 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1146 "%s: Failed to initialize WCTS action event, status %d",
1147 __FUNCTION__, wptStatus);
1148 goto fail_wcts_event;
1149 }
1150
1151 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001152 Open the Transport Services for Control and Data
Jeff Johnson295189b2012-06-20 16:38:30 -07001153 ------------------------------------------------------------------------*/
1154 wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB;
1155 wctsCBs.wctsNotifyCBData = &gWDICb;
Jeff Johnsone7245742012-09-05 17:12:55 -07001156 wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB;
Jeff Johnson295189b2012-06-20 16:38:30 -07001157 wctsCBs.wctsRxMsgCBData = &gWDICb;
1158
Jeff Johnsone7245742012-09-05 17:12:55 -07001159 gWDICb.bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001160 gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName ,
Jeff Johnsone7245742012-09-05 17:12:55 -07001161 WDI_CT_CHANNEL_SIZE,
1162 &wctsCBs );
Jeff Johnson295189b2012-06-20 16:38:30 -07001163
1164 if ( NULL == gWDICb.wctsHandle )
1165 {
1166 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1167 "%s: Failed to open WCTS transport", __FUNCTION__);
1168 goto fail_wcts_open;
1169 }
1170
1171 gWDICb.driverMode = (tDriverType)driverType;
1172 /* FTM mode not need to open Transport Driver */
1173 if(eDRIVER_TYPE_MFG != (tDriverType)driverType)
Jeff Johnsone7245742012-09-05 17:12:55 -07001174 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001175 /*------------------------------------------------------------------------
1176 Open the Data Transport
1177 ------------------------------------------------------------------------*/
1178 if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb))
1179 {
1180 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1181 "%s: Failed to open the DT Transport", __FUNCTION__);
1182 goto fail_wdts_open;
1183 }
1184 }
1185
1186 /*The WDI is initialized - set state to init */
Jeff Johnsone7245742012-09-05 17:12:55 -07001187 gWDICb.uGlobalState = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07001188
1189 /*Send the context as a ptr to the global WDI Control Block*/
1190 *ppWDIGlobalCtx = &gWDICb;
1191
1192 /*Fill in the device capabilities*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001193 pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001194 pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations;
1195 pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids;
1196 return WDI_STATUS_SUCCESS;
1197
1198 /* ERROR handlers
1199 Undo everything that completed successfully */
1200
1201 fail_wdts_open:
1202 {
1203 wpt_status eventStatus;
1204
1205 /* Closing WCTS in this scenario is tricky since it has to close
1206 the SMD channel and then we get notified asynchronously when
1207 the channel has been closed. So we take some of the logic from
1208 the "normal" close procedure in WDI_Close()
1209 */
1210
1211 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001212 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001213 {
1214 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1215 "%s: Failed to reset WCTS action event", __FUNCTION__);
1216 }
1217
1218 WCTS_CloseTransport(gWDICb.wctsHandle);
1219
1220 /* Wait for WCTS to close the control transport. If we were able
1221 to reset the event flag, then we'll wait for the event,
1222 otherwise we'll wait for a maximum amount of time required for
1223 the channel to be closed */
1224 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1225 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001226 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
Jeff Johnson295189b2012-06-20 16:38:30 -07001227 WDI_WCTS_ACTION_TIMEOUT);
1228 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1229 {
1230 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1231 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1232 }
1233 }
1234 else
1235 {
1236 wpalSleep(WDI_WCTS_ACTION_TIMEOUT);
1237 }
1238 }
1239 fail_wcts_open:
1240 wpalEventDelete(&gWDICb.wctsActionEvent);
1241 fail_wcts_event:
1242 wpalEventDelete(&gWDICb.setPowerStateEvent);
1243 fail_power_event:
1244 WDI_DP_UtilsExit(&gWDICb);
1245 fail_dp_util_init:
1246 gWDICb.magic = 0;
1247 fail_bss_queue:
1248 /* entries 0 thru i-1 were successfully initialized */
1249 while (0 < i)
1250 {
1251 i--;
1252 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1253 }
1254 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1255 fail_assoc_queue:
1256 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1257 fail_pend_queue:
1258 wpalTimerDelete(&gWDICb.wptResponseTimer);
1259 fail_timer:
1260 wpalMutexDelete(&gWDICb.wptMutex);
1261 fail_mutex:
1262 wpalClose(gWDICb.pPALContext);
1263 fail_wpalOpen:
1264 WDI_STATableClose(&gWDICb);
1265 fail_STATableInit:
1266 gWDIInitialized = eWLAN_PAL_FALSE;
1267
1268 return WDI_STATUS_E_FAILURE;
1269
1270}/*WDI_Init*/;
1271
1272/**
1273 @brief WDI_Start will be called when the upper MAC is ready to
1274 commence operation with the WLAN Device. Upon the call
1275 of this API the WLAN DAL will pack and send a HAL Start
1276 message to the lower RIVA sub-system if the SMD channel
1277 has been fully opened and the RIVA subsystem is up.
1278
1279 If the RIVA sub-system is not yet up and running DAL
1280 will queue the request for Open and will wait for the
1281 SMD notification before attempting to send down the
Jeff Johnsone7245742012-09-05 17:12:55 -07001282 message to HAL.
Jeff Johnson295189b2012-06-20 16:38:30 -07001283
1284 WDI_Init must have been called.
1285
Jeff Johnsone7245742012-09-05 17:12:55 -07001286 @param wdiStartParams: the start parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001288
Jeff Johnson295189b2012-06-20 16:38:30 -07001289 wdiStartRspCb: callback for passing back the response of
1290 the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001291
Jeff Johnson295189b2012-06-20 16:38:30 -07001292 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001293 callback
1294
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 @see WDI_Start
1296 @return Result of the function call
1297*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001298WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001299WDI_Start
1300(
1301 WDI_StartReqParamsType* pwdiStartParams,
1302 WDI_StartRspCb wdiStartRspCb,
1303 void* pUserData
1304)
1305{
1306 WDI_EventInfoType wdiEventData;
1307 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1308
1309 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001310 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001311 ------------------------------------------------------------------------*/
1312 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1313 {
1314 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1315 "WDI API call before module is initialized - Fail request");
1316
Jeff Johnsone7245742012-09-05 17:12:55 -07001317 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001318 }
1319
1320 /*------------------------------------------------------------------------
1321 Fill in Event data and post to the Main FSM
1322 ------------------------------------------------------------------------*/
1323 wdiEventData.wdiRequest = WDI_START_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001324 wdiEventData.pEventData = pwdiStartParams;
1325 wdiEventData.uEventDataSize = sizeof(*pwdiStartParams);
1326 wdiEventData.pCBfnc = wdiStartRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001327 wdiEventData.pUserData = pUserData;
1328
1329 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1330
1331}/*WDI_Start*/
1332
1333/**
1334 @brief WDI_Stop will be called when the upper MAC is ready to
1335 stop any operation with the WLAN Device. Upon the call
1336 of this API the WLAN DAL will pack and send a HAL Stop
1337 message to the lower RIVA sub-system if the DAL Core is
1338 in started state.
1339
1340 In state BUSY this request will be queued.
Jeff Johnsone7245742012-09-05 17:12:55 -07001341
1342 Request will not be accepted in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001343
1344 WDI_Start must have been called.
1345
Jeff Johnsone7245742012-09-05 17:12:55 -07001346 @param wdiStopParams: the stop parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001347 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001348
Jeff Johnson295189b2012-06-20 16:38:30 -07001349 wdiStopRspCb: callback for passing back the response of
1350 the stop operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001351
Jeff Johnson295189b2012-06-20 16:38:30 -07001352 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001353 callback
1354
Jeff Johnson295189b2012-06-20 16:38:30 -07001355 @see WDI_Start
1356 @return Result of the function call
1357*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001358WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001359WDI_Stop
1360(
1361 WDI_StopReqParamsType* pwdiStopParams,
1362 WDI_StopRspCb wdiStopRspCb,
1363 void* pUserData
1364)
1365{
1366 WDI_EventInfoType wdiEventData;
Jeff Johnson43971f52012-07-17 12:26:56 -07001367 WDI_ControlBlockType* pWDICtx = &gWDICb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001368 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1369
1370 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001371 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001372 ------------------------------------------------------------------------*/
1373 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1374 {
1375 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1376 "WDI API call before module is initialized - Fail request");
1377
Jeff Johnsone7245742012-09-05 17:12:55 -07001378 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001379 }
1380
Jeff Johnson43971f52012-07-17 12:26:56 -07001381 /*Access to the global state must be locked before cleaning */
1382 wpalMutexAcquire(&pWDICtx->wptMutex);
1383
1384 /*Clear all pending request*/
1385 WDI_ClearPendingRequests(pWDICtx);
1386
1387 /*We have completed cleaning unlock now*/
1388 wpalMutexRelease(&pWDICtx->wptMutex);
1389
Jeff Johnson295189b2012-06-20 16:38:30 -07001390 /* Free the global variables */
1391 wpalMemoryFree(gpHostWlanFeatCaps);
1392 wpalMemoryFree(gpFwWlanFeatCaps);
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -07001393 gpHostWlanFeatCaps = NULL;
1394 gpFwWlanFeatCaps = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001395
1396 /*------------------------------------------------------------------------
1397 Fill in Event data and post to the Main FSM
1398 ------------------------------------------------------------------------*/
1399 wdiEventData.wdiRequest = WDI_STOP_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001400 wdiEventData.pEventData = pwdiStopParams;
1401 wdiEventData.uEventDataSize = sizeof(*pwdiStopParams);
1402 wdiEventData.pCBfnc = wdiStopRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001403 wdiEventData.pUserData = pUserData;
1404
1405 return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData);
1406
1407}/*WDI_Stop*/
1408
1409
1410
1411/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001412 @brief WDI_Close will be called when the upper MAC no longer
Jeff Johnson295189b2012-06-20 16:38:30 -07001413 needs to interact with DAL. DAL will free its control
1414 block.
Jeff Johnsone7245742012-09-05 17:12:55 -07001415
1416 It is only accepted in state STOPPED.
Jeff Johnson295189b2012-06-20 16:38:30 -07001417
1418 WDI_Stop must have been called.
1419
1420 @param none
Jeff Johnsone7245742012-09-05 17:12:55 -07001421
Jeff Johnson295189b2012-06-20 16:38:30 -07001422 @see WDI_Stop
1423 @return Result of the function call
1424*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001425WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001426WDI_Close
1427(
1428 void
1429)
1430{
1431 wpt_uint8 i;
1432 WDI_EventInfoType wdiEventData;
1433 wpt_status wptStatus;
1434 wpt_status eventStatus;
1435 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1436
1437 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001438 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001439 ------------------------------------------------------------------------*/
1440 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1441 {
1442 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1443 "WDI API call before module is initialized - Fail request");
1444
Jeff Johnsone7245742012-09-05 17:12:55 -07001445 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001446 }
1447
1448 /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ
1449 (the control transport will be closed by the FSM and we'll want
1450 to wait until that completes)*/
1451 eventStatus = wpalEventReset(&gWDICb.wctsActionEvent);
Jeff Johnsone7245742012-09-05 17:12:55 -07001452 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -07001453 {
1454 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1455 "%s: Failed to reset WCTS action event", __FUNCTION__);
1456 /* fall through and try to finish closing via the FSM */
1457 }
1458
1459 /*------------------------------------------------------------------------
1460 Fill in Event data and post to the Main FSM
1461 ------------------------------------------------------------------------*/
1462 wdiEventData.wdiRequest = WDI_CLOSE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001463 wdiEventData.pEventData = NULL;
1464 wdiEventData.uEventDataSize = 0;
1465 wdiEventData.pCBfnc = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001466 wdiEventData.pUserData = NULL;
1467
1468 gWDIInitialized = eWLAN_PAL_FALSE;
1469
1470 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData);
1471
1472 /*Wait for WCTS to close the control transport
1473 (but only if we were able to reset the event flag*/
1474 if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus )
1475 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001476 eventStatus = wpalEventWait(&gWDICb.wctsActionEvent,
Jeff Johnson295189b2012-06-20 16:38:30 -07001477 WDI_WCTS_ACTION_TIMEOUT);
1478 if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus )
1479 {
1480 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1481 "%s: Failed to wait on WCTS action event", __FUNCTION__);
1482 }
1483 }
1484
1485 /* Destroy the WCTS action event */
1486 wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent);
1487 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1488 {
1489 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1490 "WDI Close failed to destroy an event");
Jeff Johnsone7245742012-09-05 17:12:55 -07001491 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001492 }
1493
1494 /* Destroy the Set Power State event */
1495 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1496 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1497 {
1498 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1499 "WDI Close failed to destroy an event");
1500
Jeff Johnsone7245742012-09-05 17:12:55 -07001501 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001502 }
1503
1504 /*------------------------------------------------------------------------
1505 Closes the Data Path Utility Module
1506 ------------------------------------------------------------------------*/
1507 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1508 {
1509 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1510 "WDI Init failed to close the DP Util Module");
1511
Jeff Johnsone7245742012-09-05 17:12:55 -07001512 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001513 }
1514
1515 /*destroy the BSS sessions pending Queue */
1516 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1517 {
1518 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1519 }
1520
1521 /* destroy the WDI Pending Assoc Id Request Queue*/
1522 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1523
1524 /* destroy the WDI Pending Request Queue*/
1525 wpal_list_destroy(&(gWDICb.wptPendingQueue));
Jeff Johnsone7245742012-09-05 17:12:55 -07001526
Jeff Johnson295189b2012-06-20 16:38:30 -07001527 /*destroy the response timer */
1528 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1529
1530 /*invalidate the main synchro mutex */
1531 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1532 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1533 {
1534 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1535 "Failed to delete mutex %d", wptStatus);
1536 WDI_ASSERT(0);
1537 }
1538
1539 /*Clear control block. note that this will clear the "magic"
1540 which will inhibit all asynchronous callbacks*/
1541 WDI_CleanCB(&gWDICb);
1542
1543 return wptStatus;
1544
1545}/*WDI_Close*/
1546
1547/**
1548 @brief WDI_Shutdown will be called during 'SSR shutdown' operation.
1549 This will do most of the WDI stop & close
1550 operations without doing any handshake with Riva
1551
1552 This will also make sure that the control transport
1553 will NOT be closed.
1554
1555 This request will not be queued.
1556
1557
1558 WDI_Start must have been called.
1559
1560 @param closeTransport: Close control channel if this is set
1561
1562 @return Result of the function call
1563*/
1564WDI_Status
1565WDI_Shutdown
1566(
1567 wpt_boolean closeTransport
1568)
1569{
1570 WDI_EventInfoType wdiEventData;
1571 wpt_status wptStatus;
1572 int i = 0;
1573 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1574
1575 /*------------------------------------------------------------------------
1576 Sanity Check
1577 ------------------------------------------------------------------------*/
1578 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1579 {
1580 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1581 "WDI API call before module is initialized - Fail request");
1582
1583 return WDI_STATUS_E_NOT_ALLOWED;
1584 }
1585
1586 /*------------------------------------------------------------------------
1587 Fill in Event data and post to the Main FSM
1588 ------------------------------------------------------------------------*/
1589 wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ;
1590 wdiEventData.pEventData = NULL;
1591 wdiEventData.uEventDataSize = 0;
1592
1593 /* Shutdown will not be queued, if the state is busy timer will be
1594 * stopped & this message will be processed.*/
1595 wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData);
1596 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1597 {
1598 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
1599 "%s: Failed to process shutdown event", __FUNCTION__);
1600 }
1601 /* Destroy the Set Power State event */
1602 wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent);
1603 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1604 {
1605 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1606 "WDI Close failed to destroy an event");
1607
1608 WDI_ASSERT(0);
1609 }
1610 /*------------------------------------------------------------------------
1611 Closes the Data Path Utility Module
1612 ------------------------------------------------------------------------*/
1613 if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb))
1614 {
1615 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
1616 "WDI Init failed to close the DP Util Module");
1617
1618 WDI_ASSERT(0);
1619 }
1620 if ( closeTransport )
1621 {
1622 /* Close control transport, called from module unload */
1623 WCTS_CloseTransport(gWDICb.wctsHandle);
1624 }
Madan Mohan Koyyalamudifab2a7e2012-09-28 15:20:00 -07001625 else
1626 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -07001627 /* Riva is crashed then SMD is already closed so cleaning all
Madan Mohan Koyyalamudifab2a7e2012-09-28 15:20:00 -07001628 the pending messages in the transport queue */
1629 WCTS_ClearPendingQueue(gWDICb.wctsHandle);
1630 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001631 /*destroy the BSS sessions pending Queue */
1632 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
1633 {
1634 wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue));
1635 }
1636
1637 /* destroy the WDI Pending Assoc Id Request Queue*/
1638 wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue));
1639 /* destroy the WDI Pending Request Queue*/
1640 wpal_list_destroy(&(gWDICb.wptPendingQueue));
1641 /*destroy the response timer */
1642 wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer);
1643
1644 /*invalidate the main synchro mutex */
1645 wptStatus = wpalMutexDelete(&gWDICb.wptMutex);
1646 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
1647 {
1648 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1649 "%s: Failed to delete mutex %d", __FUNCTION__, wptStatus);
1650 WDI_ASSERT(0);
1651 }
Madan Mohan Koyyalamudi3513bf52012-09-18 17:35:53 -07001652 /* Free the global variables */
1653 wpalMemoryFree(gpHostWlanFeatCaps);
1654 wpalMemoryFree(gpFwWlanFeatCaps);
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -07001655 gpHostWlanFeatCaps = NULL;
1656 gpFwWlanFeatCaps = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001657 /*Clear control block. note that this will clear the "magic"
1658 which will inhibit all asynchronous callbacks*/
1659 WDI_CleanCB(&gWDICb);
1660 return wptStatus;
1661
1662}/*WDI_Shutdown*/
1663
1664
Jeff Johnsone7245742012-09-05 17:12:55 -07001665/*========================================================================
1666
Jeff Johnson295189b2012-06-20 16:38:30 -07001667 SCAN APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07001668
Jeff Johnson295189b2012-06-20 16:38:30 -07001669==========================================================================*/
1670
1671/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001672 @brief WDI_InitScanReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07001673 the WLAN Device to get ready for a scan procedure. Upon
1674 the call of this API the WLAN DAL will pack and send a
1675 HAL Init Scan request message to the lower RIVA
1676 sub-system if DAL is in state STARTED.
1677
1678 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001679 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001680
1681 WDI_Start must have been called.
1682
1683 @param wdiInitScanParams: the init scan parameters as specified
1684 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001685
Jeff Johnson295189b2012-06-20 16:38:30 -07001686 wdiInitScanRspCb: callback for passing back the response
1687 of the init scan operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001688
Jeff Johnson295189b2012-06-20 16:38:30 -07001689 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001690 callback
1691
Jeff Johnson295189b2012-06-20 16:38:30 -07001692 @see WDI_Start
1693 @return Result of the function call
1694*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001695WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001696WDI_InitScanReq
1697(
1698 WDI_InitScanReqParamsType* pwdiInitScanParams,
1699 WDI_InitScanRspCb wdiInitScanRspCb,
1700 void* pUserData
1701)
1702{
1703 WDI_EventInfoType wdiEventData;
1704 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1705
1706 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001707 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001708 ------------------------------------------------------------------------*/
1709 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1710 {
1711 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1712 "WDI API call before module is initialized - Fail request");
1713
Jeff Johnsone7245742012-09-05 17:12:55 -07001714 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001715 }
1716
1717 /*------------------------------------------------------------------------
1718 Fill in Event data and post to the Main FSM
1719 ------------------------------------------------------------------------*/
1720 wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001721 wdiEventData.pEventData = pwdiInitScanParams;
1722 wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams);
1723 wdiEventData.pCBfnc = wdiInitScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001724 wdiEventData.pUserData = pUserData;
1725
1726 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1727
1728}/*WDI_InitScanReq*/
1729
1730/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001731 @brief WDI_StartScanReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07001732 wishes to change the Scan channel on the WLAN Device.
1733 Upon the call of this API the WLAN DAL will pack and
1734 send a HAL Start Scan request message to the lower RIVA
1735 sub-system if DAL is in state STARTED.
1736
1737 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001738 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001739
1740 WDI_InitScanReq must have been called.
1741
Jeff Johnsone7245742012-09-05 17:12:55 -07001742 @param wdiStartScanParams: the start scan parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001743 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001744
Jeff Johnson295189b2012-06-20 16:38:30 -07001745 wdiStartScanRspCb: callback for passing back the
1746 response of the start scan operation received from the
1747 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001748
Jeff Johnson295189b2012-06-20 16:38:30 -07001749 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001750 callback
1751
Jeff Johnson295189b2012-06-20 16:38:30 -07001752 @see WDI_InitScanReq
1753 @return Result of the function call
1754*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001755WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001756WDI_StartScanReq
1757(
1758 WDI_StartScanReqParamsType* pwdiStartScanParams,
1759 WDI_StartScanRspCb wdiStartScanRspCb,
1760 void* pUserData
1761)
1762{
1763 WDI_EventInfoType wdiEventData;
1764 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1765
1766 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001767 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001768 ------------------------------------------------------------------------*/
1769 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1770 {
1771 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1772 "WDI API call before module is initialized - Fail request");
1773
Jeff Johnsone7245742012-09-05 17:12:55 -07001774 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001775 }
1776
1777 /*------------------------------------------------------------------------
1778 Fill in Event data and post to the Main FSM
1779 ------------------------------------------------------------------------*/
1780 wdiEventData.wdiRequest = WDI_START_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001781 wdiEventData.pEventData = pwdiStartScanParams;
1782 wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams);
1783 wdiEventData.pCBfnc = wdiStartScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001784 wdiEventData.pUserData = pUserData;
1785
1786 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1787
1788}/*WDI_StartScanReq*/
1789
1790
1791/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001792 @brief WDI_EndScanReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07001793 wants to end scanning for a particular channel that it
1794 had set before by calling Scan Start on the WLAN Device.
1795 Upon the call of this API the WLAN DAL will pack and
1796 send a HAL End Scan request message to the lower RIVA
1797 sub-system if DAL is in state STARTED.
1798
1799 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001800 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001801
1802 WDI_StartScanReq must have been called.
1803
Jeff Johnsone7245742012-09-05 17:12:55 -07001804 @param wdiEndScanParams: the end scan parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07001805 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001806
Jeff Johnson295189b2012-06-20 16:38:30 -07001807 wdiEndScanRspCb: callback for passing back the response
1808 of the end scan operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001809
Jeff Johnson295189b2012-06-20 16:38:30 -07001810 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001811 callback
1812
Jeff Johnson295189b2012-06-20 16:38:30 -07001813 @see WDI_StartScanReq
1814 @return Result of the function call
1815*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001816WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001817WDI_EndScanReq
1818(
1819 WDI_EndScanReqParamsType* pwdiEndScanParams,
1820 WDI_EndScanRspCb wdiEndScanRspCb,
1821 void* pUserData
1822)
1823{
1824 WDI_EventInfoType wdiEventData;
1825 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1826
1827 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001828 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001829 ------------------------------------------------------------------------*/
1830 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1831 {
1832 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1833 "WDI API call before module is initialized - Fail request");
1834
Jeff Johnsone7245742012-09-05 17:12:55 -07001835 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001836 }
1837
1838 /*------------------------------------------------------------------------
1839 Fill in Event data and post to the Main FSM
1840 ------------------------------------------------------------------------*/
1841 wdiEventData.wdiRequest = WDI_END_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001842 wdiEventData.pEventData = pwdiEndScanParams;
1843 wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams);
1844 wdiEventData.pCBfnc = wdiEndScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001845 wdiEventData.pUserData = pUserData;
1846
1847 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1848
1849}/*WDI_EndScanReq*/
1850
1851
1852/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001853 @brief WDI_FinishScanReq will be called when the upper MAC has
Jeff Johnson295189b2012-06-20 16:38:30 -07001854 completed the scan process on the WLAN Device. Upon the
1855 call of this API the WLAN DAL will pack and send a HAL
1856 Finish Scan Request request message to the lower RIVA
1857 sub-system if DAL is in state STARTED.
1858
1859 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001860 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001861
1862 WDI_InitScanReq must have been called.
1863
Jeff Johnsone7245742012-09-05 17:12:55 -07001864 @param wdiFinishScanParams: the finish scan parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001865 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001866
Jeff Johnson295189b2012-06-20 16:38:30 -07001867 wdiFinishScanRspCb: callback for passing back the
1868 response of the finish scan operation received from the
1869 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001870
Jeff Johnson295189b2012-06-20 16:38:30 -07001871 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001872 callback
1873
Jeff Johnson295189b2012-06-20 16:38:30 -07001874 @see WDI_InitScanReq
1875 @return Result of the function call
1876*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001877WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001878WDI_FinishScanReq
1879(
1880 WDI_FinishScanReqParamsType* pwdiFinishScanParams,
1881 WDI_FinishScanRspCb wdiFinishScanRspCb,
1882 void* pUserData
1883)
1884{
1885 WDI_EventInfoType wdiEventData;
1886 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1887
1888 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001889 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 ------------------------------------------------------------------------*/
1891 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1892 {
1893 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1894 "WDI API call before module is initialized - Fail request");
1895
Jeff Johnsone7245742012-09-05 17:12:55 -07001896 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001897 }
1898
1899 /*------------------------------------------------------------------------
1900 Fill in Event data and post to the Main FSM
1901 ------------------------------------------------------------------------*/
1902 wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001903 wdiEventData.pEventData = pwdiFinishScanParams;
1904 wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams);
1905 wdiEventData.pCBfnc = wdiFinishScanRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001906 wdiEventData.pUserData = pUserData;
1907
1908 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1909
1910}/*WDI_FinishScanReq*/
1911
Jeff Johnsone7245742012-09-05 17:12:55 -07001912/*========================================================================
1913
Jeff Johnson295189b2012-06-20 16:38:30 -07001914 ASSOCIATION APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07001915
Jeff Johnson295189b2012-06-20 16:38:30 -07001916==========================================================================*/
1917
1918/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001919 @brief WDI_JoinReq will be called when the upper MAC is ready
Jeff Johnson295189b2012-06-20 16:38:30 -07001920 to start an association procedure to a BSS. Upon the
1921 call of this API the WLAN DAL will pack and send a HAL
1922 Join request message to the lower RIVA sub-system if
1923 DAL is in state STARTED.
1924
1925 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001926 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001927
1928 WDI_Start must have been called.
1929
Jeff Johnsone7245742012-09-05 17:12:55 -07001930 @param wdiJoinParams: the join parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07001931 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001932
Jeff Johnson295189b2012-06-20 16:38:30 -07001933 wdiJoinRspCb: callback for passing back the response of
1934 the join operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07001935
Jeff Johnson295189b2012-06-20 16:38:30 -07001936 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001937 callback
1938
Jeff Johnson295189b2012-06-20 16:38:30 -07001939 @see WDI_Start
1940 @return Result of the function call
1941*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001942WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07001943WDI_JoinReq
1944(
1945 WDI_JoinReqParamsType* pwdiJoinParams,
1946 WDI_JoinRspCb wdiJoinRspCb,
1947 void* pUserData
1948)
1949{
1950 WDI_EventInfoType wdiEventData;
1951 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1952
1953 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07001954 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07001955 ------------------------------------------------------------------------*/
1956 if ( eWLAN_PAL_FALSE == gWDIInitialized )
1957 {
1958 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
1959 "WDI API call before module is initialized - Fail request");
1960
Jeff Johnsone7245742012-09-05 17:12:55 -07001961 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07001962 }
1963
1964 /*------------------------------------------------------------------------
1965 Fill in Event data and post to the Main FSM
1966 ------------------------------------------------------------------------*/
1967 wdiEventData.wdiRequest = WDI_JOIN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07001968 wdiEventData.pEventData = pwdiJoinParams;
1969 wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams);
1970 wdiEventData.pCBfnc = wdiJoinRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001971 wdiEventData.pUserData = pUserData;
1972
1973 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
1974
1975}/*WDI_JoinReq*/
1976
1977/**
Jeff Johnsone7245742012-09-05 17:12:55 -07001978 @brief WDI_ConfigBSSReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07001979 wishes to configure the newly acquired or in process of
1980 being acquired BSS to the HW . Upon the call of this API
1981 the WLAN DAL will pack and send a HAL Config BSS request
1982 message to the lower RIVA sub-system if DAL is in state
1983 STARTED.
1984
1985 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07001986 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07001987
1988 WDI_JoinReq must have been called.
1989
Jeff Johnsone7245742012-09-05 17:12:55 -07001990 @param wdiConfigBSSParams: the config BSS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07001991 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07001992
Jeff Johnson295189b2012-06-20 16:38:30 -07001993 wdiConfigBSSRspCb: callback for passing back the
1994 response of the config BSS operation received from the
1995 device
Jeff Johnsone7245742012-09-05 17:12:55 -07001996
Jeff Johnson295189b2012-06-20 16:38:30 -07001997 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07001998 callback
1999
Jeff Johnson295189b2012-06-20 16:38:30 -07002000 @see WDI_JoinReq
2001 @return Result of the function call
2002*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002003WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002004WDI_ConfigBSSReq
2005(
2006 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams,
2007 WDI_ConfigBSSRspCb wdiConfigBSSRspCb,
2008 void* pUserData
2009)
2010{
2011 WDI_EventInfoType wdiEventData;
2012 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2013
2014 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002015 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002016 ------------------------------------------------------------------------*/
2017 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2018 {
2019 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2020 "WDI API call before module is initialized - Fail request");
2021
Jeff Johnsone7245742012-09-05 17:12:55 -07002022 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002023 }
2024
2025 /*------------------------------------------------------------------------
2026 Fill in Event data and post to the Main FSM
2027 ------------------------------------------------------------------------*/
2028 wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002029 wdiEventData.pEventData = pwdiConfigBSSParams;
2030 wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams);
2031 wdiEventData.pCBfnc = wdiConfigBSSRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002032 wdiEventData.pUserData = pUserData;
2033
2034 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2035
2036}/*WDI_ConfigBSSReq*/
2037
2038/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002039 @brief WDI_DelBSSReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07002040 disassociating from the BSS and wishes to notify HW.
2041 Upon the call of this API the WLAN DAL will pack and
2042 send a HAL Del BSS request message to the lower RIVA
2043 sub-system if DAL is in state STARTED.
2044
2045 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002046 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002047
2048 WDI_ConfigBSSReq or WDI_PostAssocReq must have been called.
2049
Jeff Johnsone7245742012-09-05 17:12:55 -07002050 @param wdiDelBSSParams: the del BSS parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002052
Jeff Johnson295189b2012-06-20 16:38:30 -07002053 wdiDelBSSRspCb: callback for passing back the response
2054 of the del bss operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002055
Jeff Johnson295189b2012-06-20 16:38:30 -07002056 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002057 callback
2058
2059 @see WDI_ConfigBSSReq, WDI_PostAssocReq
Jeff Johnson295189b2012-06-20 16:38:30 -07002060 @return Result of the function call
2061*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002062WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002063WDI_DelBSSReq
2064(
2065 WDI_DelBSSReqParamsType* pwdiDelBSSParams,
2066 WDI_DelBSSRspCb wdiDelBSSRspCb,
2067 void* pUserData
2068)
2069{
2070 WDI_EventInfoType wdiEventData;
2071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2072
2073 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002074 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002075 ------------------------------------------------------------------------*/
2076 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2077 {
2078 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2079 "WDI API call before module is initialized - Fail request");
2080
Jeff Johnsone7245742012-09-05 17:12:55 -07002081 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002082 }
2083
2084 /*------------------------------------------------------------------------
2085 Fill in Event data and post to the Main FSM
2086 ------------------------------------------------------------------------*/
2087 wdiEventData.wdiRequest = WDI_DEL_BSS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002088 wdiEventData.pEventData = pwdiDelBSSParams;
2089 wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams);
2090 wdiEventData.pCBfnc = wdiDelBSSRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002091 wdiEventData.pUserData = pUserData;
2092
2093 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2094
2095}/*WDI_DelBSSReq*/
2096
2097/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002098 @brief WDI_PostAssocReq will be called when the upper MAC has
Jeff Johnson295189b2012-06-20 16:38:30 -07002099 associated to a BSS and wishes to configure HW for
2100 associated state. Upon the call of this API the WLAN DAL
2101 will pack and send a HAL Post Assoc request message to
2102 the lower RIVA sub-system if DAL is in state STARTED.
2103
2104 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002105 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002106
2107 WDI_JoinReq must have been called.
2108
2109 @param wdiPostAssocReqParams: the assoc parameters as specified
2110 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002111
Jeff Johnson295189b2012-06-20 16:38:30 -07002112 wdiPostAssocRspCb: callback for passing back the
2113 response of the post assoc operation received from the
2114 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002115
Jeff Johnson295189b2012-06-20 16:38:30 -07002116 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002117 callback
2118
Jeff Johnson295189b2012-06-20 16:38:30 -07002119 @see WDI_JoinReq
2120 @return Result of the function call
2121*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002122WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002123WDI_PostAssocReq
2124(
2125 WDI_PostAssocReqParamsType* pwdiPostAssocReqParams,
2126 WDI_PostAssocRspCb wdiPostAssocRspCb,
2127 void* pUserData
2128)
2129{
2130 WDI_EventInfoType wdiEventData;
2131 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2132
2133 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002134 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002135 ------------------------------------------------------------------------*/
2136 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2137 {
2138 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2139 "WDI API call before module is initialized - Fail request");
2140
Jeff Johnsone7245742012-09-05 17:12:55 -07002141 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002142 }
2143
2144 /*------------------------------------------------------------------------
2145 Fill in Event data and post to the Main FSM
2146 ------------------------------------------------------------------------*/
2147 wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002148 wdiEventData.pEventData = pwdiPostAssocReqParams;
2149 wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams);
2150 wdiEventData.pCBfnc = wdiPostAssocRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002151 wdiEventData.pUserData = pUserData;
2152
2153 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2154
2155}/*WDI_PostAssocReq*/
2156
2157/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002158 @brief WDI_DelSTAReq will be called when the upper MAC when an
Jeff Johnson295189b2012-06-20 16:38:30 -07002159 association with another STA has ended and the station
2160 must be deleted from HW. Upon the call of this API the
2161 WLAN DAL will pack and send a HAL Del STA request
2162 message to the lower RIVA sub-system if DAL is in state
2163 STARTED.
2164
2165 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002166 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002167
2168 WDI_PostAssocReq must have been called.
2169
Jeff Johnsone7245742012-09-05 17:12:55 -07002170 @param wdiDelSTAParams: the Del STA parameters as specified by
Jeff Johnson295189b2012-06-20 16:38:30 -07002171 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002172
Jeff Johnson295189b2012-06-20 16:38:30 -07002173 wdiDelSTARspCb: callback for passing back the response
2174 of the del STA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002175
Jeff Johnson295189b2012-06-20 16:38:30 -07002176 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002177 callback
2178
Jeff Johnson295189b2012-06-20 16:38:30 -07002179 @see WDI_PostAssocReq
2180 @return Result of the function call
2181*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002182WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002183WDI_DelSTAReq
2184(
2185 WDI_DelSTAReqParamsType* pwdiDelSTAParams,
2186 WDI_DelSTARspCb wdiDelSTARspCb,
2187 void* pUserData
2188)
2189{
2190 WDI_EventInfoType wdiEventData;
2191 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2192
2193 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002194 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002195 ------------------------------------------------------------------------*/
2196 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2197 {
2198 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2199 "WDI API call before module is initialized - Fail request");
2200
Jeff Johnsone7245742012-09-05 17:12:55 -07002201 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002202 }
2203
2204 /*------------------------------------------------------------------------
2205 Fill in Event data and post to the Main FSM
2206 ------------------------------------------------------------------------*/
2207 wdiEventData.wdiRequest = WDI_DEL_STA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002208 wdiEventData.pEventData = pwdiDelSTAParams;
2209 wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams);
2210 wdiEventData.pCBfnc = wdiDelSTARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002211 wdiEventData.pUserData = pUserData;
2212
2213 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2214
2215}/*WDI_DelSTAReq*/
2216
Jeff Johnsone7245742012-09-05 17:12:55 -07002217/*========================================================================
2218
Jeff Johnson295189b2012-06-20 16:38:30 -07002219 SECURITY APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002220
Jeff Johnson295189b2012-06-20 16:38:30 -07002221==========================================================================*/
2222
2223/**
2224 @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to
2225 install a BSS encryption key on the HW. Upon the call of this
2226 API the WLAN DAL will pack and send a Set BSS Key request
2227 message to the lower RIVA sub-system if DAL is in state
2228 STARTED.
2229
2230 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002231 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002232
2233 WDI_PostAssocReq must have been called.
2234
Jeff Johnsone7245742012-09-05 17:12:55 -07002235 @param wdiSetBSSKeyParams: the BSS Key set parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002236 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002237
Jeff Johnson295189b2012-06-20 16:38:30 -07002238 wdiSetBSSKeyRspCb: callback for passing back the
2239 response of the set BSS Key operation received from the
2240 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002241
Jeff Johnson295189b2012-06-20 16:38:30 -07002242 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002243 callback
2244
Jeff Johnson295189b2012-06-20 16:38:30 -07002245 @see WDI_PostAssocReq
2246 @return Result of the function call
2247*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002248WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002249WDI_SetBSSKeyReq
2250(
2251 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams,
2252 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb,
2253 void* pUserData
2254)
2255{
2256 WDI_EventInfoType wdiEventData;
2257 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2258
2259 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002260 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002261 ------------------------------------------------------------------------*/
2262 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2263 {
2264 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2265 "WDI API call before module is initialized - Fail request");
2266
Jeff Johnsone7245742012-09-05 17:12:55 -07002267 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002268 }
2269
2270 /*------------------------------------------------------------------------
2271 Fill in Event data and post to the Main FSM
2272 ------------------------------------------------------------------------*/
2273 wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002274 wdiEventData.pEventData = pwdiSetBSSKeyParams;
2275 wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams);
2276 wdiEventData.pCBfnc = wdiSetBSSKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002277 wdiEventData.pUserData = pUserData;
2278
2279 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2280
2281}/*WDI_SetBSSKeyReq*/
2282
2283/**
2284 @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to
2285 uninstall a BSS key from HW. Upon the call of this API the
2286 WLAN DAL will pack and send a HAL Remove BSS Key request
2287 message to the lower RIVA sub-system if DAL is in state
2288 STARTED.
2289
2290 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002291 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002292
2293 WDI_SetBSSKeyReq must have been called.
2294
Jeff Johnsone7245742012-09-05 17:12:55 -07002295 @param wdiRemoveBSSKeyParams: the remove BSS key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002296 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002297
Jeff Johnson295189b2012-06-20 16:38:30 -07002298 wdiRemoveBSSKeyRspCb: callback for passing back the
2299 response of the remove BSS key operation received from
2300 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002301
Jeff Johnson295189b2012-06-20 16:38:30 -07002302 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002303 callback
2304
Jeff Johnson295189b2012-06-20 16:38:30 -07002305 @see WDI_SetBSSKeyReq
2306 @return Result of the function call
2307*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002308WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002309WDI_RemoveBSSKeyReq
2310(
2311 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams,
2312 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb,
2313 void* pUserData
2314)
2315{
2316 WDI_EventInfoType wdiEventData;
2317 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2318
2319 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002320 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002321 ------------------------------------------------------------------------*/
2322 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2323 {
2324 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2325 "WDI API call before module is initialized - Fail request");
2326
Jeff Johnsone7245742012-09-05 17:12:55 -07002327 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002328 }
2329
2330 /*------------------------------------------------------------------------
2331 Fill in Event data and post to the Main FSM
2332 ------------------------------------------------------------------------*/
2333 wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002334 wdiEventData.pEventData = pwdiRemoveBSSKeyParams;
2335 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams);
2336 wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002337 wdiEventData.pUserData = pUserData;
2338
2339 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2340
2341}/*WDI_RemoveBSSKeyReq*/
2342
2343
2344/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002345 @brief WDI_SetSTAKeyReq will be called when the upper MAC is
Jeff Johnson295189b2012-06-20 16:38:30 -07002346 ready to install a STA(ast) encryption key in HW. Upon
2347 the call of this API the WLAN DAL will pack and send a
2348 HAL Set STA Key request message to the lower RIVA
2349 sub-system if DAL is in state STARTED.
2350
2351 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002352 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002353
2354 WDI_PostAssocReq must have been called.
2355
Jeff Johnsone7245742012-09-05 17:12:55 -07002356 @param wdiSetSTAKeyParams: the set STA key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002357 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002358
Jeff Johnson295189b2012-06-20 16:38:30 -07002359 wdiSetSTAKeyRspCb: callback for passing back the
2360 response of the set STA key operation received from the
2361 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002362
Jeff Johnson295189b2012-06-20 16:38:30 -07002363 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002364 callback
2365
Jeff Johnson295189b2012-06-20 16:38:30 -07002366 @see WDI_PostAssocReq
2367 @return Result of the function call
2368*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002369WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002370WDI_SetSTAKeyReq
2371(
2372 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams,
2373 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb,
2374 void* pUserData
2375)
2376{
2377 WDI_EventInfoType wdiEventData;
2378 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2379
2380 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002381 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002382 ------------------------------------------------------------------------*/
2383 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2384 {
2385 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2386 "WDI API call before module is initialized - Fail request");
2387
Jeff Johnsone7245742012-09-05 17:12:55 -07002388 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002389 }
2390
2391 /*------------------------------------------------------------------------
2392 Fill in Event data and post to the Main FSM
2393 ------------------------------------------------------------------------*/
2394 wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002395 wdiEventData.pEventData = pwdiSetSTAKeyParams;
2396 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams);
2397 wdiEventData.pCBfnc = wdiSetSTAKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002398 wdiEventData.pUserData = pUserData;
2399
2400 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2401
2402}/*WDI_SetSTAKeyReq*/
2403
2404
2405/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002406 @brief WDI_RemoveSTAKeyReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002407 wants to uninstall a previously set STA key in HW. Upon
2408 the call of this API the WLAN DAL will pack and send a
2409 HAL Remove STA Key request message to the lower RIVA
2410 sub-system if DAL is in state STARTED.
2411
2412 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002413 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002414
2415 WDI_SetSTAKeyReq must have been called.
2416
Jeff Johnsone7245742012-09-05 17:12:55 -07002417 @param wdiRemoveSTAKeyParams: the remove STA key parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002418 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002419
Jeff Johnson295189b2012-06-20 16:38:30 -07002420 wdiRemoveSTAKeyRspCb: callback for passing back the
2421 response of the remove STA key operation received from
2422 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002423
Jeff Johnson295189b2012-06-20 16:38:30 -07002424 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002425 callback
2426
Jeff Johnson295189b2012-06-20 16:38:30 -07002427 @see WDI_SetSTAKeyReq
2428 @return Result of the function call
2429*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002430WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002431WDI_RemoveSTAKeyReq
2432(
2433 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams,
2434 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb,
2435 void* pUserData
2436)
2437{
2438 WDI_EventInfoType wdiEventData;
2439 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2440
2441 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002442 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002443 ------------------------------------------------------------------------*/
2444 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2445 {
2446 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2447 "WDI API call before module is initialized - Fail request");
2448
Jeff Johnsone7245742012-09-05 17:12:55 -07002449 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002450 }
2451
2452 /*------------------------------------------------------------------------
2453 Fill in Event data and post to the Main FSM
2454 ------------------------------------------------------------------------*/
2455 wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002456 wdiEventData.pEventData = pwdiRemoveSTAKeyParams;
2457 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams);
2458 wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002459 wdiEventData.pUserData = pUserData;
2460
2461 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2462
2463}/*WDI_RemoveSTAKeyReq*/
2464
2465
2466/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002467 @brief WDI_SetSTABcastKeyReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002468 wants to install a STA Bcast encryption key on the HW.
2469 Upon the call of this API the WLAN DAL will pack and
2470 send a HAL Start request message to the lower RIVA
2471 sub-system if DAL is in state STARTED.
2472
2473 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002474 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002475
2476 WDI_PostAssocReq must have been called.
2477
Jeff Johnsone7245742012-09-05 17:12:55 -07002478 @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07002479 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002480
Jeff Johnson295189b2012-06-20 16:38:30 -07002481 wdiSetSTABcastKeyRspCb: callback for passing back the
2482 response of the set BSS Key operation received from the
2483 device
Jeff Johnsone7245742012-09-05 17:12:55 -07002484
Jeff Johnson295189b2012-06-20 16:38:30 -07002485 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002486 callback
2487
Jeff Johnson295189b2012-06-20 16:38:30 -07002488 @see WDI_PostAssocReq
2489 @return Result of the function call
2490*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002491WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002492WDI_SetSTABcastKeyReq
2493(
2494 WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams,
2495 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb,
2496 void* pUserData
2497)
2498
2499{
2500 WDI_EventInfoType wdiEventData;
2501 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2502
2503 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002504 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002505 ------------------------------------------------------------------------*/
2506 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2507 {
2508 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2509 "WDI API call before module is initialized - Fail request");
2510
Jeff Johnsone7245742012-09-05 17:12:55 -07002511 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002512 }
2513
2514 /*------------------------------------------------------------------------
2515 Fill in Event data and post to the Main FSM
2516 ------------------------------------------------------------------------*/
2517 wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002518 wdiEventData.pEventData = pwdiSetSTABcastKeyParams;
2519 wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams);
2520 wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002521 wdiEventData.pUserData = pUserData;
2522
2523 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2524
2525}/*WDI_SetSTABcastKeyReq*/
2526
2527/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002528 @brief WDI_RemoveSTABcastKeyReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07002529 MAC wants to uninstall a STA Bcast key from HW. Upon the
2530 call of this API the WLAN DAL will pack and send a HAL
2531 Remove STA Bcast Key request message to the lower RIVA
2532 sub-system if DAL is in state STARTED.
2533
2534 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002535 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002536
2537 WDI_SetSTABcastKeyReq must have been called.
2538
Jeff Johnsone7245742012-09-05 17:12:55 -07002539 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
Jeff Johnson295189b2012-06-20 16:38:30 -07002540 parameters as specified by the Device
2541 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002542
Jeff Johnson295189b2012-06-20 16:38:30 -07002543 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2544 response of the remove STA Bcast key operation received
2545 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002546
Jeff Johnson295189b2012-06-20 16:38:30 -07002547 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002548 callback
2549
Jeff Johnson295189b2012-06-20 16:38:30 -07002550 @see WDI_SetSTABcastKeyReq
2551 @return Result of the function call
2552*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002553WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002554WDI_RemoveSTABcastKeyReq
2555(
2556 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams,
2557 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb,
2558 void* pUserData
2559)
2560{
2561 WDI_EventInfoType wdiEventData;
2562 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2563
2564 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002565 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002566 ------------------------------------------------------------------------*/
2567 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2568 {
2569 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2570 "WDI API call before module is initialized - Fail request");
2571
Jeff Johnsone7245742012-09-05 17:12:55 -07002572 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002573 }
2574
2575 /*------------------------------------------------------------------------
2576 Fill in Event data and post to the Main FSM
2577 ------------------------------------------------------------------------*/
2578 wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002579 wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams;
2580 wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams);
2581 wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002582 wdiEventData.pUserData = pUserData;
2583
2584 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2585
2586}/*WDI_RemoveSTABcastKeyReq*/
2587
2588/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002589 @brief WDI_SetMaxTxPowerReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07002590 MAC wants to set Max Tx Power to HW. Upon the
2591 call of this API the WLAN DAL will pack and send a HAL
2592 Remove STA Bcast Key request message to the lower RIVA
2593 sub-system if DAL is in state STARTED.
2594
2595 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002596 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002597
2598 WDI_SetSTABcastKeyReq must have been called.
2599
Jeff Johnsone7245742012-09-05 17:12:55 -07002600 @param pwdiRemoveSTABcastKeyParams: the remove BSS key
Jeff Johnson295189b2012-06-20 16:38:30 -07002601 parameters as specified by the Device
2602 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002603
Jeff Johnson295189b2012-06-20 16:38:30 -07002604 wdiRemoveSTABcastKeyRspCb: callback for passing back the
2605 response of the remove STA Bcast key operation received
2606 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002607
Jeff Johnson295189b2012-06-20 16:38:30 -07002608 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002609 callback
2610
Jeff Johnson295189b2012-06-20 16:38:30 -07002611 @see WDI_SetMaxTxPowerReq
2612 @return Result of the function call
2613*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002614WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002615WDI_SetMaxTxPowerReq
2616(
2617 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams,
2618 WDA_SetMaxTxPowerRspCb wdiReqStatusCb,
2619 void* pUserData
2620)
2621{
2622 WDI_EventInfoType wdiEventData;
2623 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2624
2625 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002626 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002627 ------------------------------------------------------------------------*/
2628 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2629 {
2630 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2631 "WDI API call before module is initialized - Fail request");
2632
Jeff Johnsone7245742012-09-05 17:12:55 -07002633 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002634 }
2635
2636 /*------------------------------------------------------------------------
2637 Fill in Event data and post to the Main FSM
2638 ------------------------------------------------------------------------*/
2639 wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002640 wdiEventData.pEventData = pwdiSetMaxTxPowerParams;
2641 wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams);
2642 wdiEventData.pCBfnc = wdiReqStatusCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002643 wdiEventData.pUserData = pUserData;
2644
2645 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2646}
2647
2648#ifdef FEATURE_WLAN_CCX
2649WDI_Status
2650WDI_TSMStatsReq
2651(
2652 WDI_TSMStatsReqParamsType* pwdiTsmReqParams,
2653 WDI_TsmRspCb wdiReqStatusCb,
2654 void* pUserData
2655)
2656{
2657 WDI_EventInfoType wdiEventData;
2658 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -07002659 /*------------------------------------------------------------------------
2660 Sanity Check
2661 ------------------------------------------------------------------------*/
2662 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2663 {
2664 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2665 "WDI API call before module is initialized - Fail request");
2666
2667 return WDI_STATUS_E_NOT_ALLOWED;
2668 }
2669
2670 /*------------------------------------------------------------------------
2671 Fill in Event data and post to the Main FSM
2672 ------------------------------------------------------------------------*/
2673 wdiEventData.wdiRequest = WDI_TSM_STATS_REQ;
2674 wdiEventData.pEventData = pwdiTsmReqParams;
2675 wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams);
2676 wdiEventData.pCBfnc = wdiReqStatusCb;
2677 wdiEventData.pUserData = pUserData;
2678
2679 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2680
2681}
2682#endif
2683
2684/*========================================================================
2685
2686 QoS and BA APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002687
Jeff Johnson295189b2012-06-20 16:38:30 -07002688==========================================================================*/
2689
2690/**
2691 @brief WDI_AddTSReq will be called when the upper MAC to inform
2692 the device of a successful add TSpec negotiation. HW
2693 needs to receive the TSpec Info from the UMAC in order
2694 to configure properly the QoS data traffic. Upon the
2695 call of this API the WLAN DAL will pack and send a HAL
2696 Add TS request message to the lower RIVA sub-system if
2697 DAL is in state STARTED.
2698
2699 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002700 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002701
2702 WDI_PostAssocReq must have been called.
2703
2704 @param wdiAddTsReqParams: the add TS parameters as specified by
2705 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002706
Jeff Johnson295189b2012-06-20 16:38:30 -07002707 wdiAddTsRspCb: callback for passing back the response of
2708 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002709
Jeff Johnson295189b2012-06-20 16:38:30 -07002710 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002711 callback
2712
Jeff Johnson295189b2012-06-20 16:38:30 -07002713 @see WDI_PostAssocReq
2714 @return Result of the function call
2715*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002716WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002717WDI_AddTSReq
2718(
2719 WDI_AddTSReqParamsType* pwdiAddTsReqParams,
2720 WDI_AddTsRspCb wdiAddTsRspCb,
2721 void* pUserData
2722)
2723{
2724 WDI_EventInfoType wdiEventData;
2725 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2726
2727 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002728 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002729 ------------------------------------------------------------------------*/
2730 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2731 {
2732 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2733 "WDI API call before module is initialized - Fail request");
2734
Jeff Johnsone7245742012-09-05 17:12:55 -07002735 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002736 }
2737
2738 /*------------------------------------------------------------------------
2739 Fill in Event data and post to the Main FSM
2740 ------------------------------------------------------------------------*/
2741 wdiEventData.wdiRequest = WDI_ADD_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002742 wdiEventData.pEventData = pwdiAddTsReqParams;
2743 wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams);
2744 wdiEventData.pCBfnc = wdiAddTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002745 wdiEventData.pUserData = pUserData;
2746
2747 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2748
2749}/*WDI_AddTSReq*/
2750
2751
2752
2753/**
2754 @brief WDI_DelTSReq will be called when the upper MAC has ended
2755 admission on a specific AC. This is to inform HW that
2756 QoS traffic parameters must be rest. Upon the call of
2757 this API the WLAN DAL will pack and send a HAL Del TS
2758 request message to the lower RIVA sub-system if DAL is
2759 in state STARTED.
2760
2761 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002762 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002763
2764 WDI_AddTSReq must have been called.
2765
2766 @param wdiDelTsReqParams: the del TS parameters as specified by
2767 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002768
Jeff Johnson295189b2012-06-20 16:38:30 -07002769 wdiDelTsRspCb: callback for passing back the response of
2770 the del TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002771
Jeff Johnson295189b2012-06-20 16:38:30 -07002772 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002773 callback
2774
Jeff Johnson295189b2012-06-20 16:38:30 -07002775 @see WDI_AddTSReq
2776 @return Result of the function call
2777*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002778WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002779WDI_DelTSReq
2780(
2781 WDI_DelTSReqParamsType* pwdiDelTsReqParams,
2782 WDI_DelTsRspCb wdiDelTsRspCb,
2783 void* pUserData
2784)
2785{
2786 WDI_EventInfoType wdiEventData;
2787 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2788
2789 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002790 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002791 ------------------------------------------------------------------------*/
2792 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2793 {
2794 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2795 "WDI API call before module is initialized - Fail request");
2796
Jeff Johnsone7245742012-09-05 17:12:55 -07002797 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002798 }
2799
2800 /*------------------------------------------------------------------------
2801 Fill in Event data and post to the Main FSM
2802 ------------------------------------------------------------------------*/
2803 wdiEventData.wdiRequest = WDI_DEL_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002804 wdiEventData.pEventData = pwdiDelTsReqParams;
2805 wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams);
2806 wdiEventData.pCBfnc = wdiDelTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002807 wdiEventData.pUserData = pUserData;
2808
2809 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2810
2811}/*WDI_DelTSReq*/
2812
2813
2814
2815/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002816 @brief WDI_UpdateEDCAParams will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07002817 wishes to update the EDCA parameters used by HW for QoS
2818 data traffic. Upon the call of this API the WLAN DAL
2819 will pack and send a HAL Update EDCA Params request
2820 message to the lower RIVA sub-system if DAL is in state
2821 STARTED.
2822
2823 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002824 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002825
2826 WDI_PostAssocReq must have been called.
2827
Jeff Johnsone7245742012-09-05 17:12:55 -07002828 @param wdiUpdateEDCAParams: the start parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07002829 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002830
Jeff Johnson295189b2012-06-20 16:38:30 -07002831 wdiUpdateEDCAParamsRspCb: callback for passing back the
2832 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002833
Jeff Johnson295189b2012-06-20 16:38:30 -07002834 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002835 callback
2836
Jeff Johnson295189b2012-06-20 16:38:30 -07002837 @see WDI_PostAssocReq
2838 @return Result of the function call
2839*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002840WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002841WDI_UpdateEDCAParams
2842(
2843 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams,
2844 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb,
2845 void* pUserData
2846)
2847{
2848 WDI_EventInfoType wdiEventData;
2849 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2850
2851 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002852 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002853 ------------------------------------------------------------------------*/
2854 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2855 {
2856 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2857 "WDI API call before module is initialized - Fail request");
2858
Jeff Johnsone7245742012-09-05 17:12:55 -07002859 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002860 }
2861
2862 /*------------------------------------------------------------------------
2863 Fill in Event data and post to the Main FSM
2864 ------------------------------------------------------------------------*/
2865 wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002866 wdiEventData.pEventData = pwdiUpdateEDCAParams;
2867 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams);
2868 wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002869 wdiEventData.pUserData = pUserData;
2870
2871 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2872
2873}/*WDI_UpdateEDCAParams*/
2874
2875
2876/**
2877 @brief WDI_AddBASessionReq will be called when the upper MAC has setup
2878 successfully a BA session and needs to notify the HW for
2879 the appropriate settings to take place. Upon the call of
2880 this API the WLAN DAL will pack and send a HAL Add BA
2881 request message to the lower RIVA sub-system if DAL is
2882 in state STARTED.
2883
2884 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002885 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002886
2887 WDI_PostAssocReq must have been called.
2888
2889 @param wdiAddBAReqParams: the add BA parameters as specified by
2890 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002891
Jeff Johnson295189b2012-06-20 16:38:30 -07002892 wdiAddBARspCb: callback for passing back the response of
2893 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002894
Jeff Johnson295189b2012-06-20 16:38:30 -07002895 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002896 callback
2897
Jeff Johnson295189b2012-06-20 16:38:30 -07002898 @see WDI_PostAssocReq
2899 @return Result of the function call
2900*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002901WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002902WDI_AddBASessionReq
2903(
2904 WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams,
2905 WDI_AddBASessionRspCb wdiAddBASessionRspCb,
2906 void* pUserData
2907)
2908{
2909 WDI_EventInfoType wdiEventData;
2910 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2911
2912 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002913 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002914 ------------------------------------------------------------------------*/
2915 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2916 {
2917 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2918 "WDI API call before module is initialized - Fail request");
2919
Jeff Johnsone7245742012-09-05 17:12:55 -07002920 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002921 }
2922
2923 /*------------------------------------------------------------------------
2924 Fill in Event data and post to the Main FSM
2925 ------------------------------------------------------------------------*/
2926 wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002927 wdiEventData.pEventData = pwdiAddBASessionReqParams;
2928 wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams);
2929 wdiEventData.pCBfnc = wdiAddBASessionRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002930 wdiEventData.pUserData = pUserData;
2931
2932 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2933
2934}/*WDI_AddBASessionReq*/
2935
2936/**
Jeff Johnsone7245742012-09-05 17:12:55 -07002937 @brief WDI_DelBAReq will be called when the upper MAC wants to
Jeff Johnson295189b2012-06-20 16:38:30 -07002938 inform HW that it has deleted a previously created BA
2939 session. Upon the call of this API the WLAN DAL will
2940 pack and send a HAL Del BA request message to the lower
2941 RIVA sub-system if DAL is in state STARTED.
2942
2943 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07002944 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07002945
2946 WDI_AddBAReq must have been called.
2947
2948 @param wdiDelBAReqParams: the del BA parameters as specified by
2949 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07002950
Jeff Johnson295189b2012-06-20 16:38:30 -07002951 wdiDelBARspCb: callback for passing back the response of
2952 the del BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07002953
Jeff Johnson295189b2012-06-20 16:38:30 -07002954 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07002955 callback
2956
Jeff Johnson295189b2012-06-20 16:38:30 -07002957 @see WDI_AddBAReq
2958 @return Result of the function call
2959*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002960WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07002961WDI_DelBAReq
2962(
2963 WDI_DelBAReqParamsType* pwdiDelBAReqParams,
2964 WDI_DelBARspCb wdiDelBARspCb,
2965 void* pUserData
2966)
2967{
2968 WDI_EventInfoType wdiEventData;
2969 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
2970
2971 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07002972 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07002973 ------------------------------------------------------------------------*/
2974 if ( eWLAN_PAL_FALSE == gWDIInitialized )
2975 {
2976 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
2977 "WDI API call before module is initialized - Fail request");
2978
Jeff Johnsone7245742012-09-05 17:12:55 -07002979 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002980 }
2981
2982 /*------------------------------------------------------------------------
2983 Fill in Event data and post to the Main FSM
2984 ------------------------------------------------------------------------*/
2985 wdiEventData.wdiRequest = WDI_DEL_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07002986 wdiEventData.pEventData = pwdiDelBAReqParams;
2987 wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams);
2988 wdiEventData.pCBfnc = wdiDelBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07002989 wdiEventData.pUserData = pUserData;
2990
2991 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
2992
2993}/*WDI_DelBAReq*/
2994
Jeff Johnsone7245742012-09-05 17:12:55 -07002995/*========================================================================
2996
Jeff Johnson295189b2012-06-20 16:38:30 -07002997 Power Save APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07002998
Jeff Johnson295189b2012-06-20 16:38:30 -07002999==========================================================================*/
3000
3001/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003002 @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003003 wants to set the power save related configurations of
3004 the WLAN Device. Upon the call of this API the WLAN DAL
3005 will pack and send a HAL Update CFG request message to
3006 the lower RIVA sub-system if DAL is in state STARTED.
3007
3008 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003009 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003010
3011 WDI_Start must have been called.
3012
Jeff Johnsone7245742012-09-05 17:12:55 -07003013 @param pwdiPowerSaveCfg: the power save cfg parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003014 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003015
Jeff Johnson295189b2012-06-20 16:38:30 -07003016 wdiSetPwrSaveCfgCb: callback for passing back the
3017 response of the set power save cfg operation received
3018 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003019
Jeff Johnson295189b2012-06-20 16:38:30 -07003020 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003021 callback
3022
Jeff Johnson295189b2012-06-20 16:38:30 -07003023 @see WDI_Start
Jeff Johnsone7245742012-09-05 17:12:55 -07003024 @return Result of the function call
3025*/
3026WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003027WDI_SetPwrSaveCfgReq
3028(
3029 WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg,
3030 WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb,
3031 void* pUserData
3032)
3033{
3034 WDI_EventInfoType wdiEventData;
3035 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3036
3037 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003038 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003039 ------------------------------------------------------------------------*/
3040 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3041 {
3042 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3043 "WDI API call before module is initialized - Fail request");
3044
Jeff Johnsone7245742012-09-05 17:12:55 -07003045 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003046 }
3047
3048 /*------------------------------------------------------------------------
3049 Fill in Event data and post to the Main FSM
3050 ------------------------------------------------------------------------*/
3051 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003052 wdiEventData.pEventData = pwdiPowerSaveCfg;
3053 wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg);
3054 wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003055 wdiEventData.pUserData = pUserData;
3056
3057 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3058
3059}/*WDI_SetPwrSaveCfgReq*/
3060
3061/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003062 @brief WDI_EnterImpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003063 request the device to get into IMPS power state. Upon
3064 the call of this API the WLAN DAL will send a HAL Enter
3065 IMPS request message to the lower RIVA sub-system if DAL
3066 is in state STARTED.
3067
3068 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003069 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003070
Jeff Johnsone7245742012-09-05 17:12:55 -07003071
3072 @param wdiEnterImpsRspCb: callback for passing back the
Jeff Johnson295189b2012-06-20 16:38:30 -07003073 response of the Enter IMPS operation received from the
3074 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003075
Jeff Johnson295189b2012-06-20 16:38:30 -07003076 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003077 callback
3078
Jeff Johnson295189b2012-06-20 16:38:30 -07003079 @see WDI_Start
3080 @return Result of the function call
3081*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003082WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003083WDI_EnterImpsReq
3084(
3085 WDI_EnterImpsRspCb wdiEnterImpsRspCb,
3086 void* pUserData
3087)
3088{
3089 WDI_EventInfoType wdiEventData;
3090 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3091
3092 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003093 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003094 ------------------------------------------------------------------------*/
3095 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3096 {
3097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3098 "WDI API call before module is initialized - Fail request");
3099
Jeff Johnsone7245742012-09-05 17:12:55 -07003100 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003101 }
3102
3103 /*------------------------------------------------------------------------
3104 Fill in Event data and post to the Main FSM
3105 ------------------------------------------------------------------------*/
3106 wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003107 wdiEventData.pEventData = NULL;
3108 wdiEventData.uEventDataSize = 0;
3109 wdiEventData.pCBfnc = wdiEnterImpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003110 wdiEventData.pUserData = pUserData;
3111
3112 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3113
3114}/*WDI_EnterImpsReq*/
3115
3116/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003117 @brief WDI_ExitImpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003118 request the device to get out of IMPS power state. Upon
3119 the call of this API the WLAN DAL will send a HAL Exit
3120 IMPS request message to the lower RIVA sub-system if DAL
3121 is in state STARTED.
3122
3123 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003124 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003125
Jeff Johnson295189b2012-06-20 16:38:30 -07003126
Jeff Johnsone7245742012-09-05 17:12:55 -07003127
3128 @param wdiExitImpsRspCb: callback for passing back the response
Jeff Johnson295189b2012-06-20 16:38:30 -07003129 of the Exit IMPS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003130
Jeff Johnson295189b2012-06-20 16:38:30 -07003131 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003132 callback
3133
Jeff Johnson295189b2012-06-20 16:38:30 -07003134 @see WDI_Start
3135 @return Result of the function call
3136*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003137WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003138WDI_ExitImpsReq
3139(
3140 WDI_ExitImpsRspCb wdiExitImpsRspCb,
3141 void* pUserData
3142)
3143{
3144 WDI_EventInfoType wdiEventData;
3145 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3146
3147 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003148 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003149 ------------------------------------------------------------------------*/
3150 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3151 {
3152 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3153 "WDI API call before module is initialized - Fail request");
3154
Jeff Johnsone7245742012-09-05 17:12:55 -07003155 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003156 }
3157
3158 /*------------------------------------------------------------------------
3159 Fill in Event data and post to the Main FSM
3160 ------------------------------------------------------------------------*/
3161 wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003162 wdiEventData.pEventData = NULL;
3163 wdiEventData.uEventDataSize = 0;
3164 wdiEventData.pCBfnc = wdiExitImpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003165 wdiEventData.pUserData = pUserData;
3166
3167 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3168
3169}/*WDI_ExitImpsReq*/
3170
3171/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003172 @brief WDI_EnterBmpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003173 request the device to get into BMPS power state. Upon
3174 the call of this API the WLAN DAL will pack and send a
3175 HAL Enter BMPS request message to the lower RIVA
3176 sub-system if DAL is in state STARTED.
3177
3178 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003179 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003180
3181 WDI_PostAssocReq must have been called.
3182
Jeff Johnsone7245742012-09-05 17:12:55 -07003183 @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003184 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003185
Jeff Johnson295189b2012-06-20 16:38:30 -07003186 wdiEnterBmpsRspCb: callback for passing back the
3187 response of the Enter BMPS operation received from the
3188 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003189
Jeff Johnson295189b2012-06-20 16:38:30 -07003190 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003191 callback
3192
Jeff Johnson295189b2012-06-20 16:38:30 -07003193 @see WDI_PostAssocReq
3194 @return Result of the function call
3195*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003196WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003197WDI_EnterBmpsReq
3198(
3199 WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams,
3200 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb,
3201 void* pUserData
3202)
3203{
3204 WDI_EventInfoType wdiEventData;
3205 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3206
3207 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003208 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003209 ------------------------------------------------------------------------*/
3210 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3211 {
3212 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3213 "WDI API call before module is initialized - Fail request");
3214
Jeff Johnsone7245742012-09-05 17:12:55 -07003215 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003216 }
3217
3218 /*------------------------------------------------------------------------
3219 Fill in Event data and post to the Main FSM
3220 ------------------------------------------------------------------------*/
3221 wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003222 wdiEventData.pEventData = pwdiEnterBmpsReqParams;
3223 wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams);
3224 wdiEventData.pCBfnc = wdiEnterBmpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003225 wdiEventData.pUserData = pUserData;
3226
3227 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3228
3229}/*WDI_EnterBmpsReq*/
3230
3231/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003232 @brief WDI_ExitBmpsReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003233 request the device to get out of BMPS power state. Upon
3234 the call of this API the WLAN DAL will pack and send a
3235 HAL Exit BMPS request message to the lower RIVA
3236 sub-system if DAL is in state STARTED.
3237
3238 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003239 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003240
3241 WDI_PostAssocReq must have been called.
3242
Jeff Johnsone7245742012-09-05 17:12:55 -07003243 @param pwdiExitBmpsReqParams: the Exit BMPS parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003244 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003245
Jeff Johnson295189b2012-06-20 16:38:30 -07003246 wdiExitBmpsRspCb: callback for passing back the response
3247 of the Exit BMPS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003248
Jeff Johnson295189b2012-06-20 16:38:30 -07003249 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003250 callback
3251
Jeff Johnson295189b2012-06-20 16:38:30 -07003252 @see WDI_PostAssocReq
3253 @return Result of the function call
3254*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003255WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003256WDI_ExitBmpsReq
3257(
3258 WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams,
3259 WDI_ExitBmpsRspCb wdiExitBmpsRspCb,
3260 void* pUserData
3261)
3262{
3263 WDI_EventInfoType wdiEventData;
3264 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3265
3266 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003267 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003268 ------------------------------------------------------------------------*/
3269 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3270 {
3271 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3272 "WDI API call before module is initialized - Fail request");
3273
Jeff Johnsone7245742012-09-05 17:12:55 -07003274 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003275 }
3276
3277 /*------------------------------------------------------------------------
3278 Fill in Event data and post to the Main FSM
3279 ------------------------------------------------------------------------*/
3280 wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003281 wdiEventData.pEventData = pwdiExitBmpsReqParams;
3282 wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams);
3283 wdiEventData.pCBfnc = wdiExitBmpsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003284 wdiEventData.pUserData = pUserData;
3285
3286 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3287
3288}/*WDI_ExitBmpsReq*/
3289
3290/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003291 @brief WDI_EnterUapsdReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003292 request the device to get into UAPSD power state. Upon
3293 the call of this API the WLAN DAL will pack and send a
3294 HAL Enter UAPSD request message to the lower RIVA
3295 sub-system if DAL is in state STARTED.
3296
3297 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003298 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003299
3300 WDI_PostAssocReq must have been called.
3301 WDI_SetUapsdAcParamsReq must have been called.
Jeff Johnsone7245742012-09-05 17:12:55 -07003302
3303 @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07003304 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003305
Jeff Johnson295189b2012-06-20 16:38:30 -07003306 wdiEnterUapsdRspCb: callback for passing back the
3307 response of the Enter UAPSD operation received from the
3308 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003309
Jeff Johnson295189b2012-06-20 16:38:30 -07003310 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003311 callback
3312
Jeff Johnson295189b2012-06-20 16:38:30 -07003313 @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq
3314 @return Result of the function call
3315*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003316WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003317WDI_EnterUapsdReq
3318(
3319 WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams,
3320 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb,
3321 void* pUserData
3322)
3323{
3324 WDI_EventInfoType wdiEventData;
3325 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3326
3327 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003328 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003329 ------------------------------------------------------------------------*/
3330 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3331 {
3332 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3333 "WDI API call before module is initialized - Fail request");
3334
Jeff Johnsone7245742012-09-05 17:12:55 -07003335 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003336 }
3337
3338 /*------------------------------------------------------------------------
3339 Fill in Event data and post to the Main FSM
3340 ------------------------------------------------------------------------*/
3341 wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003342 wdiEventData.pEventData = pwdiEnterUapsdReqParams;
3343 wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams);
3344 wdiEventData.pCBfnc = wdiEnterUapsdRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003345 wdiEventData.pUserData = pUserData;
3346
3347 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3348
3349}/*WDI_EnterUapsdReq*/
3350
3351/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003352 @brief WDI_ExitUapsdReq will be called when the upper MAC to
Jeff Johnson295189b2012-06-20 16:38:30 -07003353 request the device to get out of UAPSD power state. Upon
3354 the call of this API the WLAN DAL will send a HAL Exit
3355 UAPSD request message to the lower RIVA sub-system if
3356 DAL is in state STARTED.
3357
3358 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003359 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003360
3361 WDI_PostAssocReq must have been called.
3362
Jeff Johnsone7245742012-09-05 17:12:55 -07003363 @param wdiExitUapsdRspCb: callback for passing back the
Jeff Johnson295189b2012-06-20 16:38:30 -07003364 response of the Exit UAPSD operation received from the
3365 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003366
Jeff Johnson295189b2012-06-20 16:38:30 -07003367 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003368 callback
3369
Jeff Johnson295189b2012-06-20 16:38:30 -07003370 @see WDI_PostAssocReq
3371 @return Result of the function call
3372*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003373WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003374WDI_ExitUapsdReq
3375(
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07003376 WDI_ExitUapsdReqParamsType *pwdiExitUapsdReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07003377 WDI_ExitUapsdRspCb wdiExitUapsdRspCb,
3378 void* pUserData
3379)
3380{
3381 WDI_EventInfoType wdiEventData;
3382 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3383
3384 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003385 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003386 ------------------------------------------------------------------------*/
3387 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3388 {
3389 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3390 "WDI API call before module is initialized - Fail request");
3391
Jeff Johnsone7245742012-09-05 17:12:55 -07003392 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003393 }
3394
3395 /*------------------------------------------------------------------------
3396 Fill in Event data and post to the Main FSM
3397 ------------------------------------------------------------------------*/
3398 wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07003399 wdiEventData.pEventData = pwdiExitUapsdReqParams;
3400 wdiEventData.uEventDataSize = sizeof(*pwdiExitUapsdReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -07003401 wdiEventData.pCBfnc = wdiExitUapsdRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003402 wdiEventData.pUserData = pUserData;
3403
3404 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3405
3406}/*WDI_ExitUapsdReq*/
3407
3408/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003409 @brief WDI_UpdateUapsdParamsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003410 MAC wants to set the UAPSD related configurations
3411 of an associated STA (while acting as an AP) to the WLAN
3412 Device. Upon the call of this API the WLAN DAL will pack
3413 and send a HAL Update UAPSD params request message to
3414 the lower RIVA sub-system if DAL is in state STARTED.
3415
3416 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003417 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003418
3419 WDI_ConfigBSSReq must have been called.
3420
Jeff Johnsone7245742012-09-05 17:12:55 -07003421 @param pwdiUpdateUapsdReqParams: the UAPSD parameters
Jeff Johnson295189b2012-06-20 16:38:30 -07003422 as specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003423
Jeff Johnson295189b2012-06-20 16:38:30 -07003424 wdiUpdateUapsdParamsCb: callback for passing back the
3425 response of the update UAPSD params operation received
3426 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003427
Jeff Johnson295189b2012-06-20 16:38:30 -07003428 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003429 callback
3430
Jeff Johnson295189b2012-06-20 16:38:30 -07003431 @see WDI_ConfigBSSReq
3432 @return Result of the function call
3433*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003434WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003435WDI_UpdateUapsdParamsReq
3436(
3437 WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams,
3438 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb,
3439 void* pUserData
3440)
3441{
3442 WDI_EventInfoType wdiEventData;
3443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3444
3445 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003446 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003447 ------------------------------------------------------------------------*/
3448 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3449 {
3450 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3451 "WDI API call before module is initialized - Fail request");
3452
Jeff Johnsone7245742012-09-05 17:12:55 -07003453 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003454 }
3455
3456 /*------------------------------------------------------------------------
3457 Fill in Event data and post to the Main FSM
3458 ------------------------------------------------------------------------*/
3459 wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003460 wdiEventData.pEventData = pwdiUpdateUapsdReqParams;
3461 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams);;
3462 wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003463 wdiEventData.pUserData = pUserData;
3464
3465 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3466
3467}/*WDI_UpdateUapsdParamsReq*/
3468
3469/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003470 @brief WDI_SetUapsdAcParamsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003471 MAC wants to set the UAPSD related configurations before
3472 requesting for enter UAPSD power state to the WLAN
3473 Device. Upon the call of this API the WLAN DAL will pack
3474 and send a HAL Set UAPSD params request message to
3475 the lower RIVA sub-system if DAL is in state STARTED.
3476
3477 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003478 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003479
3480 WDI_PostAssocReq must have been called.
3481
3482 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3483 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003484
Jeff Johnson295189b2012-06-20 16:38:30 -07003485 wdiSetUapsdAcParamsCb: callback for passing back the
3486 response of the set UAPSD params operation received from
3487 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003488
Jeff Johnson295189b2012-06-20 16:38:30 -07003489 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003490 callback
3491
Jeff Johnson295189b2012-06-20 16:38:30 -07003492 @see WDI_PostAssocReq
3493 @return Result of the function call
3494*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003495WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003496WDI_SetUapsdAcParamsReq
3497(
3498 WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo,
3499 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb,
3500 void* pUserData
3501)
3502{
3503 WDI_EventInfoType wdiEventData;
3504 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3505
3506 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003507 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003508 ------------------------------------------------------------------------*/
3509 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3510 {
3511 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3512 "WDI API call before module is initialized - Fail request");
3513
Jeff Johnsone7245742012-09-05 17:12:55 -07003514 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003515 }
3516
3517 /*------------------------------------------------------------------------
3518 Fill in Event data and post to the Main FSM
3519 ------------------------------------------------------------------------*/
3520 wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003521 wdiEventData.pEventData = pwdiUapsdInfo;
3522 wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo);
3523 wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003524 wdiEventData.pUserData = pUserData;
3525
3526 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3527
3528}/*WDI_SetUapsdAcParamsReq*/
3529
3530/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003531 @brief WDI_ConfigureRxpFilterReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003532 MAC wants to set/reset the RXP filters for received pkts
3533 (MC, BC etc.). Upon the call of this API the WLAN DAL will pack
3534 and send a HAL configure RXP filter request message to
3535 the lower RIVA sub-system.
3536
3537 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003538 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003539
Jeff Johnsone7245742012-09-05 17:12:55 -07003540
3541 @param pwdiConfigureRxpFilterReqParams: the RXP
Jeff Johnson295189b2012-06-20 16:38:30 -07003542 filter as specified by the Device
3543 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003544
Jeff Johnson295189b2012-06-20 16:38:30 -07003545 wdiConfigureRxpFilterCb: callback for passing back the
3546 response of the configure RXP filter operation received
3547 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003548
Jeff Johnson295189b2012-06-20 16:38:30 -07003549 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003550 callback
3551
Jeff Johnson295189b2012-06-20 16:38:30 -07003552 @return Result of the function call
3553*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003554WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003555WDI_ConfigureRxpFilterReq
3556(
3557 WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams,
3558 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb,
3559 void* pUserData
3560)
3561{
3562 WDI_EventInfoType wdiEventData;
3563 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3564
3565 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003566 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003567 ------------------------------------------------------------------------*/
3568 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3569 {
3570 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3571 "WDI API call before module is initialized - Fail request");
3572
Jeff Johnsone7245742012-09-05 17:12:55 -07003573 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003574 }
3575
3576 /*------------------------------------------------------------------------
3577 Fill in Event data and post to the Main FSM
3578 ------------------------------------------------------------------------*/
3579 wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003580 wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams;
3581 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams);
3582 wdiEventData.pCBfnc = wdiConfigureRxpFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003583 wdiEventData.pUserData = pUserData;
3584
3585 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3586}/*WDI_ConfigureRxpFilterReq*/
3587
3588/**
3589 @brief WDI_SetBeaconFilterReq will be called when the upper MAC
3590 wants to set the beacon filters while in power save.
3591 Upon the call of this API the WLAN DAL will pack and
3592 send a Beacon filter request message to the
3593 lower RIVA sub-system.
3594
3595 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003596 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003597
Jeff Johnsone7245742012-09-05 17:12:55 -07003598
3599 @param pwdiBeaconFilterReqParams: the beacon
Jeff Johnson295189b2012-06-20 16:38:30 -07003600 filter as specified by the Device
3601 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003602
Jeff Johnson295189b2012-06-20 16:38:30 -07003603 wdiBeaconFilterCb: callback for passing back the
3604 response of the set beacon filter operation received
3605 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003606
Jeff Johnson295189b2012-06-20 16:38:30 -07003607 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003608 callback
3609
Jeff Johnson295189b2012-06-20 16:38:30 -07003610 @return Result of the function call
3611*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003612WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003613WDI_SetBeaconFilterReq
3614(
3615 WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3616 WDI_SetBeaconFilterCb wdiBeaconFilterCb,
3617 void* pUserData
3618)
3619{
3620 WDI_EventInfoType wdiEventData;
3621 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3622
3623 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003624 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003625 ------------------------------------------------------------------------*/
3626 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3627 {
3628 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3629 "WDI API call before module is initialized - Fail request");
3630
Jeff Johnsone7245742012-09-05 17:12:55 -07003631 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003632 }
3633
3634 /*------------------------------------------------------------------------
3635 Fill in Event data and post to the Main FSM
3636 ------------------------------------------------------------------------*/
3637 wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003638 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3639 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3640 wdiEventData.pCBfnc = wdiBeaconFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003641 wdiEventData.pUserData = pUserData;
3642
3643 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3644}/*WDI_SetBeaconFilterReq*/
3645
3646/**
3647 @brief WDI_RemBeaconFilterReq will be called when the upper MAC
3648 wants to remove the beacon filter for particular IE
3649 while in power save. Upon the call of this API the WLAN
3650 DAL will pack and send a remove Beacon filter request
3651 message to the lower RIVA sub-system.
3652
3653 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003654 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003655
Jeff Johnsone7245742012-09-05 17:12:55 -07003656
3657 @param pwdiBeaconFilterReqParams: the beacon
Jeff Johnson295189b2012-06-20 16:38:30 -07003658 filter as specified by the Device
3659 Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003660
Jeff Johnson295189b2012-06-20 16:38:30 -07003661 wdiBeaconFilterCb: callback for passing back the
3662 response of the remove beacon filter operation received
3663 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003664
Jeff Johnson295189b2012-06-20 16:38:30 -07003665 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003666 callback
3667
Jeff Johnson295189b2012-06-20 16:38:30 -07003668 @return Result of the function call
3669*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003670WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003671WDI_RemBeaconFilterReq
3672(
3673 WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams,
3674 WDI_RemBeaconFilterCb wdiBeaconFilterCb,
3675 void* pUserData
3676)
3677{
3678 WDI_EventInfoType wdiEventData;
3679 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3680
3681 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003682 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003683 ------------------------------------------------------------------------*/
3684 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3685 {
3686 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3687 "WDI API call before module is initialized - Fail request");
3688
Jeff Johnsone7245742012-09-05 17:12:55 -07003689 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003690 }
3691
3692 /*------------------------------------------------------------------------
3693 Fill in Event data and post to the Main FSM
3694 ------------------------------------------------------------------------*/
3695 wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003696 wdiEventData.pEventData = pwdiBeaconFilterReqParams;
3697 wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);;
3698 wdiEventData.pCBfnc = wdiBeaconFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003699 wdiEventData.pUserData = pUserData;
3700
3701 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3702}/*WDI_RemBeaconFilterReq*/
3703
3704/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003705 @brief WDI_SetRSSIThresholdsReq will be called when the upper
Jeff Johnson295189b2012-06-20 16:38:30 -07003706 MAC wants to set the RSSI thresholds related
3707 configurations while in power save. Upon the call of
3708 this API the WLAN DAL will pack and send a HAL Set RSSI
3709 thresholds request message to the lower RIVA
3710 sub-system if DAL is in state STARTED.
3711
3712 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003713 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003714
3715 WDI_PostAssocReq must have been called.
3716
3717 @param pwdiUapsdInfo: the UAPSD parameters as specified by
3718 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003719
Jeff Johnson295189b2012-06-20 16:38:30 -07003720 wdiSetUapsdAcParamsCb: callback for passing back the
3721 response of the set UAPSD params operation received from
3722 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003723
Jeff Johnson295189b2012-06-20 16:38:30 -07003724 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003725 callback
3726
Jeff Johnson295189b2012-06-20 16:38:30 -07003727 @see WDI_PostAssocReq
3728 @return Result of the function call
3729*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003730WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003731WDI_SetRSSIThresholdsReq
3732(
3733 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams,
3734 WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb,
3735 void* pUserData
3736)
3737{
3738 WDI_EventInfoType wdiEventData;
3739 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3740
3741 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003742 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003743 ------------------------------------------------------------------------*/
3744 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3745 {
3746 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3747 "WDI API call before module is initialized - Fail request");
3748
Jeff Johnsone7245742012-09-05 17:12:55 -07003749 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003750 }
3751
3752 /*------------------------------------------------------------------------
3753 Fill in Event data and post to the Main FSM
3754 ------------------------------------------------------------------------*/
3755 wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003756 wdiEventData.pEventData = pwdiRSSIThresholdsParams;
3757 wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams);;
3758 wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003759 wdiEventData.pUserData = pUserData;
3760
3761 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3762}/* WDI_SetRSSIThresholdsReq*/
3763
3764/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003765 @brief WDI_HostOffloadReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003766 wants to set the filter to minimize unnecessary host
3767 wakeup due to broadcast traffic while in power save.
3768 Upon the call of this API the WLAN DAL will pack and
3769 send a HAL host offload request message to the
3770 lower RIVA sub-system if DAL is in state STARTED.
3771
3772 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003773 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003774
3775 WDI_PostAssocReq must have been called.
3776
Jeff Johnsone7245742012-09-05 17:12:55 -07003777 @param pwdiHostOffloadParams: the host offload as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07003778 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003779
Jeff Johnson295189b2012-06-20 16:38:30 -07003780 wdiHostOffloadCb: callback for passing back the response
3781 of the host offload operation received from the
3782 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003783
Jeff Johnson295189b2012-06-20 16:38:30 -07003784 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003785 callback
3786
Jeff Johnson295189b2012-06-20 16:38:30 -07003787 @see WDI_PostAssocReq
3788 @return Result of the function call
3789*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003790WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003791WDI_HostOffloadReq
3792(
3793 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams,
3794 WDI_HostOffloadCb wdiHostOffloadCb,
3795 void* pUserData
3796)
3797{
3798 WDI_EventInfoType wdiEventData;
3799 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3800
3801 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003802 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003803 ------------------------------------------------------------------------*/
3804 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3805 {
3806 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3807 "WDI API call before module is initialized - Fail request");
3808
Jeff Johnsone7245742012-09-05 17:12:55 -07003809 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003810 }
3811
3812 /*------------------------------------------------------------------------
3813 Fill in Event data and post to the Main FSM
3814 ------------------------------------------------------------------------*/
3815 wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003816 wdiEventData.pEventData = pwdiHostOffloadParams;
3817 wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams);;
3818 wdiEventData.pCBfnc = wdiHostOffloadCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003819 wdiEventData.pUserData = pUserData;
3820
3821 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3822}/*WDI_HostOffloadReq*/
3823
3824/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003825 @brief WDI_KeepAliveReq will be called when the upper MAC
3826 wants to set the filter to send NULL or unsolicited ARP responses
Jeff Johnson295189b2012-06-20 16:38:30 -07003827 and minimize unnecessary host wakeups due to while in power save.
3828 Upon the call of this API the WLAN DAL will pack and
3829 send a HAL Keep Alive request message to the
3830 lower RIVA sub-system if DAL is in state STARTED.
3831
3832 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003833 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003834
3835 WDI_PostAssocReq must have been called.
3836
Jeff Johnsone7245742012-09-05 17:12:55 -07003837 @param pwdiKeepAliveParams: the Keep Alive as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07003838 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003839
Jeff Johnson295189b2012-06-20 16:38:30 -07003840 wdiKeepAliveCb: callback for passing back the response
3841 of the Keep Alive operation received from the
3842 device
Jeff Johnsone7245742012-09-05 17:12:55 -07003843
Jeff Johnson295189b2012-06-20 16:38:30 -07003844 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003845 callback
3846
Jeff Johnson295189b2012-06-20 16:38:30 -07003847 @see WDI_PostAssocReq
3848 @return Result of the function call
3849*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003850WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003851WDI_KeepAliveReq
3852(
3853 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams,
3854 WDI_KeepAliveCb wdiKeepAliveCb,
3855 void* pUserData
3856)
3857{
3858 WDI_EventInfoType wdiEventData;
3859 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3860
3861 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003862 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003863 ------------------------------------------------------------------------*/
3864 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3865 {
3866 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3867 "WDI_KeepAliveReq: WDI API call before module "
3868 "is initialized - Fail request");
3869
Jeff Johnsone7245742012-09-05 17:12:55 -07003870 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003871 }
3872
3873 /*------------------------------------------------------------------------
3874 Fill in Event data and post to the Main FSM
3875 ------------------------------------------------------------------------*/
3876 wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003877 wdiEventData.pEventData = pwdiKeepAliveParams;
3878 wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams);
3879 wdiEventData.pCBfnc = wdiKeepAliveCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003880 wdiEventData.pUserData = pUserData;
3881
3882 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3883}/*WDI_KeepAliveReq*/
3884
3885/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003886 @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003887 wants to set the Wowl Bcast ptrn to minimize unnecessary
3888 host wakeup due to broadcast traffic while in power
3889 save. Upon the call of this API the WLAN DAL will pack
3890 and send a HAL Wowl Bcast ptrn request message to the
3891 lower RIVA sub-system if DAL is in state STARTED.
3892
3893 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003894 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003895
3896 WDI_PostAssocReq must have been called.
3897
Jeff Johnsone7245742012-09-05 17:12:55 -07003898 @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as
Jeff Johnson295189b2012-06-20 16:38:30 -07003899 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003900
Jeff Johnson295189b2012-06-20 16:38:30 -07003901 wdiWowlAddBcPtrnCb: callback for passing back the
3902 response of the add Wowl bcast ptrn operation received
3903 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003904
Jeff Johnson295189b2012-06-20 16:38:30 -07003905 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003906 callback
3907
Jeff Johnson295189b2012-06-20 16:38:30 -07003908 @see WDI_PostAssocReq
3909 @return Result of the function call
3910*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003911WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003912WDI_WowlAddBcPtrnReq
3913(
3914 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams,
3915 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb,
3916 void* pUserData
3917)
3918{
3919 WDI_EventInfoType wdiEventData;
3920 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3921
3922 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003923 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003924 ------------------------------------------------------------------------*/
3925 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3926 {
3927 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3928 "WDI API call before module is initialized - Fail request");
3929
Jeff Johnsone7245742012-09-05 17:12:55 -07003930 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003931 }
3932
3933 /*------------------------------------------------------------------------
3934 Fill in Event data and post to the Main FSM
3935 ------------------------------------------------------------------------*/
3936 wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003937 wdiEventData.pEventData = pwdiWowlAddBcPtrnParams;
3938 wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams);;
3939 wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003940 wdiEventData.pUserData = pUserData;
3941
3942 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
3943}/*WDI_WowlAddBcPtrnReq*/
3944
3945/**
Jeff Johnsone7245742012-09-05 17:12:55 -07003946 @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07003947 wants to clear the Wowl Bcast ptrn. Upon the call of
3948 this API the WLAN DAL will pack and send a HAL delete
3949 Wowl Bcast ptrn request message to the lower RIVA
3950 sub-system if DAL is in state STARTED.
3951
3952 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07003953 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07003954
3955 WDI_WowlAddBcPtrnReq must have been called.
3956
Jeff Johnsone7245742012-09-05 17:12:55 -07003957 @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as
Jeff Johnson295189b2012-06-20 16:38:30 -07003958 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07003959
Jeff Johnson295189b2012-06-20 16:38:30 -07003960 wdiWowlDelBcPtrnCb: callback for passing back the
3961 response of the del Wowl bcast ptrn operation received
3962 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07003963
Jeff Johnson295189b2012-06-20 16:38:30 -07003964 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07003965 callback
3966
Jeff Johnson295189b2012-06-20 16:38:30 -07003967 @see WDI_WowlAddBcPtrnReq
3968 @return Result of the function call
3969*/
Jeff Johnsone7245742012-09-05 17:12:55 -07003970WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07003971WDI_WowlDelBcPtrnReq
3972(
3973 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams,
3974 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb,
3975 void* pUserData
3976)
3977{
3978 WDI_EventInfoType wdiEventData;
3979 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3980
3981 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07003982 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07003983 ------------------------------------------------------------------------*/
3984 if ( eWLAN_PAL_FALSE == gWDIInitialized )
3985 {
3986 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
3987 "WDI API call before module is initialized - Fail request");
3988
Jeff Johnsone7245742012-09-05 17:12:55 -07003989 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07003990 }
3991
3992 /*------------------------------------------------------------------------
3993 Fill in Event data and post to the Main FSM
3994 ------------------------------------------------------------------------*/
3995 wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07003996 wdiEventData.pEventData = pwdiWowlDelBcPtrnParams;
3997 wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams);;
3998 wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07003999 wdiEventData.pUserData = pUserData;
4000
4001 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4002}/*WDI_WowlDelBcPtrnReq*/
4003
4004/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004005 @brief WDI_WowlEnterReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004006 wants to enter the Wowl state to minimize unnecessary
4007 host wakeup while in power save. Upon the call of this
4008 API the WLAN DAL will pack and send a HAL Wowl enter
4009 request message to the lower RIVA sub-system if DAL is
4010 in state STARTED.
4011
4012 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004013 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004014
4015 WDI_PostAssocReq must have been called.
4016
Jeff Johnsone7245742012-09-05 17:12:55 -07004017 @param pwdiWowlEnterReqParams: the Wowl enter info as
Jeff Johnson295189b2012-06-20 16:38:30 -07004018 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004019
Jeff Johnson295189b2012-06-20 16:38:30 -07004020 wdiWowlEnterReqCb: callback for passing back the
4021 response of the enter Wowl operation received from the
4022 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004023
Jeff Johnson295189b2012-06-20 16:38:30 -07004024 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004025 callback
4026
Jeff Johnson295189b2012-06-20 16:38:30 -07004027 @see WDI_PostAssocReq
4028 @return Result of the function call
4029*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004030WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004031WDI_WowlEnterReq
4032(
4033 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams,
4034 WDI_WowlEnterReqCb wdiWowlEnterCb,
4035 void* pUserData
4036)
4037{
4038 WDI_EventInfoType wdiEventData;
4039 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4040
4041 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004042 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004043 ------------------------------------------------------------------------*/
4044 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4045 {
4046 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4047 "WDI API call before module is initialized - Fail request");
4048
Jeff Johnsone7245742012-09-05 17:12:55 -07004049 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004050 }
4051
4052 /*------------------------------------------------------------------------
4053 Fill in Event data and post to the Main FSM
4054 ------------------------------------------------------------------------*/
4055 wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004056 wdiEventData.pEventData = pwdiWowlEnterParams;
4057 wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams);;
4058 wdiEventData.pCBfnc = wdiWowlEnterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004059 wdiEventData.pUserData = pUserData;
4060
4061 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4062}/*WDI_WowlEnterReq*/
4063
4064/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004065 @brief WDI_WowlExitReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004066 wants to exit the Wowl state. Upon the call of this API
4067 the WLAN DAL will pack and send a HAL Wowl exit request
4068 message to the lower RIVA sub-system if DAL is in state
4069 STARTED.
4070
4071 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004072 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004073
4074 WDI_WowlEnterReq must have been called.
4075
Jeff Johnsone7245742012-09-05 17:12:55 -07004076 @param pwdiWowlExitReqParams: the Wowl exit info as
Jeff Johnson295189b2012-06-20 16:38:30 -07004077 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004078
Jeff Johnson295189b2012-06-20 16:38:30 -07004079 wdiWowlExitReqCb: callback for passing back the response
4080 of the exit Wowl operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004081
Jeff Johnson295189b2012-06-20 16:38:30 -07004082 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004083 callback
4084
Jeff Johnson295189b2012-06-20 16:38:30 -07004085 @see WDI_WowlEnterReq
4086 @return Result of the function call
4087*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004088WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004089WDI_WowlExitReq
4090(
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07004091 WDI_WowlExitReqParamsType* pwdiWowlExitParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07004092 WDI_WowlExitReqCb wdiWowlExitCb,
4093 void* pUserData
4094)
4095{
4096 WDI_EventInfoType wdiEventData;
4097 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4098
4099 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004100 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004101 ------------------------------------------------------------------------*/
4102 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4103 {
4104 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4105 "WDI API call before module is initialized - Fail request");
4106
Jeff Johnsone7245742012-09-05 17:12:55 -07004107 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004108 }
4109
4110 /*------------------------------------------------------------------------
4111 Fill in Event data and post to the Main FSM
4112 ------------------------------------------------------------------------*/
4113 wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07004114 wdiEventData.pEventData = pwdiWowlExitParams;
4115 wdiEventData.uEventDataSize = sizeof(*pwdiWowlExitParams);
Jeff Johnsone7245742012-09-05 17:12:55 -07004116 wdiEventData.pCBfnc = wdiWowlExitCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004117 wdiEventData.pUserData = pUserData;
4118
4119 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4120}/*WDI_WowlExitReq*/
4121
4122/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004123 @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when
Jeff Johnson295189b2012-06-20 16:38:30 -07004124 the upper MAC wants to dynamically adjusts the listen
4125 interval based on the WLAN/MSM activity. Upon the call
4126 of this API the WLAN DAL will pack and send a HAL
4127 configure Apps Cpu Wakeup State request message to the
4128 lower RIVA sub-system.
4129
4130 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004131 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004132
Jeff Johnsone7245742012-09-05 17:12:55 -07004133
4134 @param pwdiConfigureAppsCpuWakeupStateReqParams: the
Jeff Johnson295189b2012-06-20 16:38:30 -07004135 Apps Cpu Wakeup State as specified by the
4136 Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004137
Jeff Johnson295189b2012-06-20 16:38:30 -07004138 wdiConfigureAppsCpuWakeupStateCb: callback for passing
4139 back the response of the configure Apps Cpu Wakeup State
4140 operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004141
Jeff Johnson295189b2012-06-20 16:38:30 -07004142 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004143 callback
4144
Jeff Johnson295189b2012-06-20 16:38:30 -07004145 @return Result of the function call
4146*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004147WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004148WDI_ConfigureAppsCpuWakeupStateReq
4149(
4150 WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams,
4151 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb,
4152 void* pUserData
4153)
4154{
4155 WDI_EventInfoType wdiEventData;
4156 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4157
4158 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004159 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004160 ------------------------------------------------------------------------*/
4161 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4162 {
4163 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4164 "WDI API call before module is initialized - Fail request");
4165
Jeff Johnsone7245742012-09-05 17:12:55 -07004166 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004167 }
4168
4169 /*------------------------------------------------------------------------
4170 Fill in Event data and post to the Main FSM
4171 ------------------------------------------------------------------------*/
4172 wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004173 wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams;
4174 wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams);
4175 wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004176 wdiEventData.pUserData = pUserData;
4177
4178 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4179}/*WDI_ConfigureAppsCpuWakeupStateReq*/
4180/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004181 @brief WDI_FlushAcReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004182 to to perform a flush operation on a given AC. Upon the
4183 call of this API the WLAN DAL will pack and send a HAL
4184 Flush AC request message to the lower RIVA sub-system if
4185 DAL is in state STARTED.
4186
4187 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004188 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004189
4190 WDI_AddBAReq must have been called.
4191
Jeff Johnsone7245742012-09-05 17:12:55 -07004192 @param pwdiFlushAcReqParams: the Flush AC parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004193 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004194
Jeff Johnson295189b2012-06-20 16:38:30 -07004195 wdiFlushAcRspCb: callback for passing back the response
4196 of the Flush AC operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004197
Jeff Johnson295189b2012-06-20 16:38:30 -07004198 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004199 callback
4200
Jeff Johnson295189b2012-06-20 16:38:30 -07004201 @see WDI_AddBAReq
4202 @return Result of the function call
4203*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004204WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004205WDI_FlushAcReq
4206(
4207 WDI_FlushAcReqParamsType* pwdiFlushAcReqParams,
4208 WDI_FlushAcRspCb wdiFlushAcRspCb,
4209 void* pUserData
4210)
4211{
4212 WDI_EventInfoType wdiEventData;
4213 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4214
4215 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004216 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004217 ------------------------------------------------------------------------*/
4218 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4219 {
4220 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4221 "WDI API call before module is initialized - Fail request");
4222
Jeff Johnsone7245742012-09-05 17:12:55 -07004223 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004224 }
4225
4226 /*------------------------------------------------------------------------
4227 Fill in Event data and post to the Main FSM
4228 ------------------------------------------------------------------------*/
4229 wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004230 wdiEventData.pEventData = pwdiFlushAcReqParams;
4231 wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams);
4232 wdiEventData.pCBfnc = wdiFlushAcRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004233 wdiEventData.pUserData = pUserData;
4234
4235 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4236
4237}/*WDI_FlushAcReq*/
4238
4239/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004240 @brief WDI_BtAmpEventReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004241 wants to notify the lower mac on a BT AMP event. This is
4242 to inform BTC-SLM that some BT AMP event occurred. Upon
4243 the call of this API the WLAN DAL will pack and send a
4244 HAL BT AMP event request message to the lower RIVA
4245 sub-system if DAL is in state STARTED.
4246
4247 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004248 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004249
Jeff Johnsone7245742012-09-05 17:12:55 -07004250
4251 @param wdiBtAmpEventReqParams: the BT AMP event parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004252 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004253
Jeff Johnson295189b2012-06-20 16:38:30 -07004254 wdiBtAmpEventRspCb: callback for passing back the
4255 response of the BT AMP event operation received from the
4256 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004257
Jeff Johnson295189b2012-06-20 16:38:30 -07004258 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004259 callback
4260
Jeff Johnson295189b2012-06-20 16:38:30 -07004261 @return Result of the function call
4262*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004263WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004264WDI_BtAmpEventReq
4265(
4266 WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams,
4267 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb,
4268 void* pUserData
4269)
4270{
4271 WDI_EventInfoType wdiEventData;
4272 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4273
4274 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004275 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004276 ------------------------------------------------------------------------*/
4277 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4278 {
4279 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4280 "WDI API call before module is initialized - Fail request");
4281
Jeff Johnsone7245742012-09-05 17:12:55 -07004282 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004283 }
4284
4285 /*------------------------------------------------------------------------
4286 Fill in Event data and post to the Main FSM
4287 ------------------------------------------------------------------------*/
4288 wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004289 wdiEventData.pEventData = pwdiBtAmpEventReqParams;
4290 wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams);
4291 wdiEventData.pCBfnc = wdiBtAmpEventRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004292 wdiEventData.pUserData = pUserData;
4293
4294 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4295
4296}/*WDI_BtAmpEventReq*/
4297
Jeff Johnsone7245742012-09-05 17:12:55 -07004298#ifdef FEATURE_OEM_DATA_SUPPORT
4299/**
4300 @brief WDI_Start Oem Data Req will be called when the upper MAC
4301 wants to notify the lower mac on a oem data Req event.Upon
4302 the call of this API the WLAN DAL will pack and send a
4303 HAL OEM Data Req event request message to the lower RIVA
4304 sub-system if DAL is in state STARTED.
4305
4306 In state BUSY this request will be queued. Request won't
4307 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004308
4309
Jeff Johnsone7245742012-09-05 17:12:55 -07004310
4311 @param pwdiOemDataReqParams: the Oem Data Req as
4312 specified by the Device Interface
4313
4314 wdiStartOemDataRspCb: callback for passing back the
4315 response of the Oem Data Req received from the
4316 device
4317
4318 pUserData: user data will be passed back with the
4319 callback
4320
4321 @return Result of the function call
4322*/
4323WDI_Status
4324WDI_StartOemDataReq
4325(
4326 WDI_oemDataReqParamsType* pwdiOemDataReqParams,
4327 WDI_oemDataRspCb wdiOemDataRspCb,
4328 void* pUserData
4329)
4330{
4331 WDI_EventInfoType wdiEventData;
4332 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4333
4334 /*------------------------------------------------------------------------
4335 Sanity Check
4336 ------------------------------------------------------------------------*/
4337 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4338 {
4339 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4340 "WDI API call before module is initialized - Fail request");
4341
4342 return WDI_STATUS_E_NOT_ALLOWED;
4343 }
4344
4345 /*------------------------------------------------------------------------
4346 Fill in Event data and post to the Main FSM
4347 ------------------------------------------------------------------------*/
4348 wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ;
4349 wdiEventData.pEventData = pwdiOemDataReqParams;
4350 wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams);
4351 wdiEventData.pCBfnc = wdiOemDataRspCb;
4352 wdiEventData.pUserData = pUserData;
4353
4354 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4355
4356
4357}
4358
4359#endif
4360
4361
4362/*========================================================================
4363
Jeff Johnson295189b2012-06-20 16:38:30 -07004364 CONTROL APIs
Jeff Johnsone7245742012-09-05 17:12:55 -07004365
Jeff Johnson295189b2012-06-20 16:38:30 -07004366==========================================================================*/
4367/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004368 @brief WDI_SwitchChReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004369 the WLAN HW to change the current channel of operation.
4370 Upon the call of this API the WLAN DAL will pack and
4371 send a HAL Start request message to the lower RIVA
4372 sub-system if DAL is in state STARTED.
4373
4374 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004375 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004376
4377 WDI_Start must have been called.
4378
Jeff Johnsone7245742012-09-05 17:12:55 -07004379 @param wdiSwitchChReqParams: the switch ch parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004380 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004381
Jeff Johnson295189b2012-06-20 16:38:30 -07004382 wdiSwitchChRspCb: callback for passing back the response
4383 of the switch ch operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004384
Jeff Johnson295189b2012-06-20 16:38:30 -07004385 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004386 callback
4387
Jeff Johnson295189b2012-06-20 16:38:30 -07004388 @see WDI_Start
4389 @return Result of the function call
4390*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004391WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004392WDI_SwitchChReq
4393(
4394 WDI_SwitchChReqParamsType* pwdiSwitchChReqParams,
4395 WDI_SwitchChRspCb wdiSwitchChRspCb,
4396 void* pUserData
4397)
4398{
4399 WDI_EventInfoType wdiEventData;
4400 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4401
4402 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004403 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004404 ------------------------------------------------------------------------*/
4405 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4406 {
4407 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4408 "WDI API call before module is initialized - Fail request");
4409
Jeff Johnsone7245742012-09-05 17:12:55 -07004410 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004411 }
4412
4413 /*------------------------------------------------------------------------
4414 Fill in Event data and post to the Main FSM
4415 ------------------------------------------------------------------------*/
4416 wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004417 wdiEventData.pEventData = pwdiSwitchChReqParams;
4418 wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams);
4419 wdiEventData.pCBfnc = wdiSwitchChRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004420 wdiEventData.pUserData = pUserData;
4421
4422 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4423
4424}/*WDI_SwitchChReq*/
4425
4426
4427/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004428 @brief WDI_ConfigSTAReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004429 wishes to add or update a STA in HW. Upon the call of
4430 this API the WLAN DAL will pack and send a HAL Start
4431 message request message to the lower RIVA sub-system if
4432 DAL is in state STARTED.
4433
4434 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004435 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004436
4437 WDI_Start must have been called.
4438
Jeff Johnsone7245742012-09-05 17:12:55 -07004439 @param wdiConfigSTAReqParams: the config STA parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004440 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004441
Jeff Johnson295189b2012-06-20 16:38:30 -07004442 wdiConfigSTARspCb: callback for passing back the
4443 response of the config STA operation received from the
4444 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004445
Jeff Johnson295189b2012-06-20 16:38:30 -07004446 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004447 callback
4448
Jeff Johnson295189b2012-06-20 16:38:30 -07004449 @see WDI_Start
4450 @return Result of the function call
4451*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004452WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004453WDI_ConfigSTAReq
4454(
4455 WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams,
4456 WDI_ConfigSTARspCb wdiConfigSTARspCb,
4457 void* pUserData
4458)
4459{
4460 WDI_EventInfoType wdiEventData;
4461 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4462
4463 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004464 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004465 ------------------------------------------------------------------------*/
4466 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4467 {
4468 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4469 "WDI API call before module is initialized - Fail request");
4470
Jeff Johnsone7245742012-09-05 17:12:55 -07004471 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004472 }
4473
4474 /*------------------------------------------------------------------------
4475 Fill in Event data and post to the Main FSM
4476 ------------------------------------------------------------------------*/
4477 wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004478 wdiEventData.pEventData = pwdiConfigSTAReqParams;
4479 wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams);
4480 wdiEventData.pCBfnc = wdiConfigSTARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004481 wdiEventData.pUserData = pUserData;
4482
4483 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4484
4485}/*WDI_ConfigSTAReq*/
4486
4487/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004488 @brief WDI_SetLinkStateReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004489 wants to change the state of an ongoing link. Upon the
4490 call of this API the WLAN DAL will pack and send a HAL
4491 Start message request message to the lower RIVA
4492 sub-system if DAL is in state STARTED.
4493
4494 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004495 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004496
4497 WDI_JoinStartReq must have been called.
4498
Jeff Johnsone7245742012-09-05 17:12:55 -07004499 @param wdiSetLinkStateReqParams: the set link state parameters
Jeff Johnson295189b2012-06-20 16:38:30 -07004500 as specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004501
Jeff Johnson295189b2012-06-20 16:38:30 -07004502 wdiSetLinkStateRspCb: callback for passing back the
4503 response of the set link state operation received from
4504 the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004505
Jeff Johnson295189b2012-06-20 16:38:30 -07004506 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004507 callback
4508
Jeff Johnson295189b2012-06-20 16:38:30 -07004509 @see WDI_JoinStartReq
4510 @return Result of the function call
4511*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004512WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004513WDI_SetLinkStateReq
4514(
4515 WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams,
4516 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb,
4517 void* pUserData
4518)
4519{
4520 WDI_EventInfoType wdiEventData;
4521 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4522
4523 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004524 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004525 ------------------------------------------------------------------------*/
4526 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4527 {
4528 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4529 "WDI API call before module is initialized - Fail request");
4530
Jeff Johnsone7245742012-09-05 17:12:55 -07004531 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004532 }
4533
4534 /*------------------------------------------------------------------------
4535 Fill in Event data and post to the Main FSM
4536 ------------------------------------------------------------------------*/
4537 wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004538 wdiEventData.pEventData = pwdiSetLinkStateReqParams;
4539 wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams);
4540 wdiEventData.pCBfnc = wdiSetLinkStateRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004541 wdiEventData.pUserData = pUserData;
4542
4543 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4544
4545}/*WDI_SetLinkStateReq*/
4546
4547
4548/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004549 @brief WDI_GetStatsReq will be called when the upper MAC wants
Jeff Johnson295189b2012-06-20 16:38:30 -07004550 to get statistics (MIB counters) from the device. Upon
4551 the call of this API the WLAN DAL will pack and send a
4552 HAL Start request message to the lower RIVA sub-system
4553 if DAL is in state STARTED.
4554
4555 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004556 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004557
4558 WDI_Start must have been called.
4559
Jeff Johnsone7245742012-09-05 17:12:55 -07004560 @param wdiGetStatsReqParams: the stats parameters to get as
Jeff Johnson295189b2012-06-20 16:38:30 -07004561 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004562
Jeff Johnson295189b2012-06-20 16:38:30 -07004563 wdiGetStatsRspCb: callback for passing back the response
4564 of the get stats operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004565
Jeff Johnson295189b2012-06-20 16:38:30 -07004566 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004567 callback
4568
Jeff Johnson295189b2012-06-20 16:38:30 -07004569 @see WDI_Start
4570 @return Result of the function call
4571*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004572WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004573WDI_GetStatsReq
4574(
4575 WDI_GetStatsReqParamsType* pwdiGetStatsReqParams,
4576 WDI_GetStatsRspCb wdiGetStatsRspCb,
4577 void* pUserData
4578)
4579{
4580 WDI_EventInfoType wdiEventData;
4581 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4582
4583 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004584 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004585 ------------------------------------------------------------------------*/
4586 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4587 {
4588 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4589 "WDI API call before module is initialized - Fail request");
4590
Jeff Johnsone7245742012-09-05 17:12:55 -07004591 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004592 }
4593
4594 /*------------------------------------------------------------------------
4595 Fill in Event data and post to the Main FSM
4596 ------------------------------------------------------------------------*/
4597 wdiEventData.wdiRequest = WDI_GET_STATS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004598 wdiEventData.pEventData = pwdiGetStatsReqParams;
4599 wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams);
4600 wdiEventData.pCBfnc = wdiGetStatsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004601 wdiEventData.pUserData = pUserData;
4602
4603 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4604
4605}/*WDI_GetStatsReq*/
4606
4607
4608/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004609 @brief WDI_UpdateCfgReq will be called when the upper MAC when
Jeff Johnson295189b2012-06-20 16:38:30 -07004610 it wishes to change the configuration of the WLAN
4611 Device. Upon the call of this API the WLAN DAL will pack
4612 and send a HAL Update CFG request message to the lower
4613 RIVA sub-system if DAL is in state STARTED.
4614
4615 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004616 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004617
4618 WDI_Start must have been called.
4619
Jeff Johnsone7245742012-09-05 17:12:55 -07004620 @param wdiUpdateCfgReqParams: the update cfg parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004621 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004622
Jeff Johnson295189b2012-06-20 16:38:30 -07004623 wdiUpdateCfgsRspCb: callback for passing back the
4624 response of the update cfg operation received from the
4625 device
Jeff Johnsone7245742012-09-05 17:12:55 -07004626
Jeff Johnson295189b2012-06-20 16:38:30 -07004627 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004628 callback
4629
Jeff Johnson295189b2012-06-20 16:38:30 -07004630 @see WDI_Start
4631 @return Result of the function call
4632*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004633WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004634WDI_UpdateCfgReq
4635(
4636 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams,
4637 WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb,
4638 void* pUserData
4639)
4640{
4641 WDI_EventInfoType wdiEventData;
4642 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4643
4644 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004645 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004646 ------------------------------------------------------------------------*/
4647 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4648 {
4649 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4650 "WDI API call before module is initialized - Fail request");
4651
Jeff Johnsone7245742012-09-05 17:12:55 -07004652 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004653 }
4654
4655 /*------------------------------------------------------------------------
4656 Fill in Event data and post to the Main FSM
4657 ------------------------------------------------------------------------*/
4658 wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004659 wdiEventData.pEventData = pwdiUpdateCfgReqParams;
4660 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams);
4661 wdiEventData.pCBfnc = wdiUpdateCfgsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004662 wdiEventData.pUserData = pUserData;
4663
4664 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4665
4666}/*WDI_UpdateCfgReq*/
4667
4668
4669
4670/**
4671 @brief WDI_AddBAReq will be called when the upper MAC has setup
4672 successfully a BA session and needs to notify the HW for
4673 the appropriate settings to take place. Upon the call of
4674 this API the WLAN DAL will pack and send a HAL Add BA
4675 request message to the lower RIVA sub-system if DAL is
4676 in state STARTED.
4677
4678 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004679 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004680
4681 WDI_PostAssocReq must have been called.
4682
4683 @param wdiAddBAReqParams: the add BA parameters as specified by
4684 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004685
Jeff Johnson295189b2012-06-20 16:38:30 -07004686 wdiAddBARspCb: callback for passing back the response of
4687 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004688
Jeff Johnson295189b2012-06-20 16:38:30 -07004689 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004690 callback
4691
Jeff Johnson295189b2012-06-20 16:38:30 -07004692 @see WDI_PostAssocReq
4693 @return Result of the function call
4694*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004695WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004696WDI_AddBAReq
4697(
4698 WDI_AddBAReqParamsType* pwdiAddBAReqParams,
4699 WDI_AddBARspCb wdiAddBARspCb,
4700 void* pUserData
4701)
4702{
4703 WDI_EventInfoType wdiEventData;
4704 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4705
4706 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004707 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004708 ------------------------------------------------------------------------*/
4709 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4710 {
4711 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4712 "WDI API call before module is initialized - Fail request");
4713
Jeff Johnsone7245742012-09-05 17:12:55 -07004714 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004715 }
4716
4717 /*------------------------------------------------------------------------
4718 Fill in Event data and post to the Main FSM
4719 ------------------------------------------------------------------------*/
4720 wdiEventData.wdiRequest = WDI_ADD_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004721 wdiEventData.pEventData = pwdiAddBAReqParams;
4722 wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams);
4723 wdiEventData.pCBfnc = wdiAddBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004724 wdiEventData.pUserData = pUserData;
4725
4726 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4727
4728}/*WDI_AddBAReq*/
4729
4730
4731/**
4732 @brief WDI_TriggerBAReq will be called when the upper MAC has setup
4733 successfully a BA session and needs to notify the HW for
4734 the appropriate settings to take place. Upon the call of
4735 this API the WLAN DAL will pack and send a HAL Add BA
4736 request message to the lower RIVA sub-system if DAL is
4737 in state STARTED.
4738
4739 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004740 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004741
4742 WDI_PostAssocReq must have been called.
4743
4744 @param wdiAddBAReqParams: the add BA parameters as specified by
4745 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004746
Jeff Johnson295189b2012-06-20 16:38:30 -07004747 wdiAddBARspCb: callback for passing back the response of
4748 the add BA operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004749
Jeff Johnson295189b2012-06-20 16:38:30 -07004750 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004751 callback
4752
Jeff Johnson295189b2012-06-20 16:38:30 -07004753 @see WDI_PostAssocReq
4754 @return Result of the function call
4755*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004756WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004757WDI_TriggerBAReq
4758(
4759 WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams,
4760 WDI_TriggerBARspCb wdiTriggerBARspCb,
4761 void* pUserData
4762)
4763{
4764 WDI_EventInfoType wdiEventData;
4765 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4766
4767 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004768 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004769 ------------------------------------------------------------------------*/
4770 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4771 {
4772 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4773 "WDI API call before module is initialized - Fail request");
4774
Jeff Johnsone7245742012-09-05 17:12:55 -07004775 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004776 }
4777
4778 /*------------------------------------------------------------------------
4779 Fill in Event data and post to the Main FSM
4780 ------------------------------------------------------------------------*/
4781 wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004782 wdiEventData.pEventData = pwdiTriggerBAReqParams;
4783 wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams);
4784 wdiEventData.pCBfnc = wdiTriggerBARspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004785 wdiEventData.pUserData = pUserData;
4786
4787 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4788
4789}/*WDI_AddBAReq*/
4790
4791/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004792 @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004793 wishes to update any of the Beacon parameters used by HW.
4794 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request
4795 message to the lower RIVA sub-system if DAL is in state
4796 STARTED.
4797
4798 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004799 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004800
4801 WDI_PostAssocReq must have been called.
4802
Jeff Johnsone7245742012-09-05 17:12:55 -07004803 @param wdiUpdateBeaconParams: the Beacon parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07004804 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004805
Jeff Johnson295189b2012-06-20 16:38:30 -07004806 wdiUpdateBeaconParamsRspCb: callback for passing back the
4807 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004808
Jeff Johnson295189b2012-06-20 16:38:30 -07004809 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004810 callback
4811
Jeff Johnson295189b2012-06-20 16:38:30 -07004812 @see WDI_PostAssocReq
4813 @return Result of the function call
4814*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004815WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004816WDI_UpdateBeaconParamsReq
4817(
4818 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams,
4819 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb,
4820 void* pUserData
4821)
4822{
4823 WDI_EventInfoType wdiEventData;
4824 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4825
4826 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004827 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004828 ------------------------------------------------------------------------*/
4829 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4830 {
4831 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4832 "WDI API call before module is initialized - Fail request");
4833
Jeff Johnsone7245742012-09-05 17:12:55 -07004834 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004835 }
4836
4837 /*------------------------------------------------------------------------
4838 Fill in Event data and post to the Main FSM
4839 ------------------------------------------------------------------------*/
4840 wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004841 wdiEventData.pEventData = pwdiUpdateBeaconParams;
4842 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams);
4843 wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004844 wdiEventData.pUserData = pUserData;
4845
4846 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4847
4848}/*WDI_UpdateBeaconParamsReq*/
4849
4850/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004851 @brief WDI_SendBeaconParamsReq will be called when the upper MAC
Jeff Johnson295189b2012-06-20 16:38:30 -07004852 wishes to update the Beacon template used by HW.
4853 Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request
4854 message to the lower RIVA sub-system if DAL is in state
4855 STARTED.
4856
4857 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004858 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004859
4860 WDI_PostAssocReq must have been called.
4861
Jeff Johnsone7245742012-09-05 17:12:55 -07004862 @param wdiSendBeaconParams: the Beacon parameters as specified
Jeff Johnson295189b2012-06-20 16:38:30 -07004863 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004864
Jeff Johnson295189b2012-06-20 16:38:30 -07004865 wdiSendBeaconParamsRspCb: callback for passing back the
4866 response of the start operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004867
Jeff Johnson295189b2012-06-20 16:38:30 -07004868 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004869 callback
4870
Jeff Johnson295189b2012-06-20 16:38:30 -07004871 @see WDI_PostAssocReq
4872 @return Result of the function call
4873*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004874WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004875WDI_SendBeaconParamsReq
4876(
4877 WDI_SendBeaconParamsType* pwdiSendBeaconParams,
4878 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb,
4879 void* pUserData
4880)
4881{
4882 WDI_EventInfoType wdiEventData;
4883 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4884
4885 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004886 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004887 ------------------------------------------------------------------------*/
4888 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4889 {
4890 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4891 "WDI API call before module is initialized - Fail request");
4892
Jeff Johnsone7245742012-09-05 17:12:55 -07004893 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004894 }
4895
4896 /*------------------------------------------------------------------------
4897 Fill in Event data and post to the Main FSM
4898 ------------------------------------------------------------------------*/
4899 wdiEventData.wdiRequest = WDI_SND_BCON_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004900 wdiEventData.pEventData = pwdiSendBeaconParams;
4901 wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams);
4902 wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004903 wdiEventData.pUserData = pUserData;
4904
4905 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4906
4907}/*WDI_SendBeaconParamsReq*/
4908
4909/**
Jeff Johnsone7245742012-09-05 17:12:55 -07004910 @brief WDI_UpdateProbeRspTemplateReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07004911 upper MAC wants to update the probe response template to
4912 be transmitted as Soft AP
4913 Upon the call of this API the WLAN DAL will
4914 pack and send the probe rsp template message to the
4915 lower RIVA sub-system if DAL is in state STARTED.
4916
4917 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07004918 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07004919
4920
Jeff Johnsone7245742012-09-05 17:12:55 -07004921 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07004922 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004923
Jeff Johnson295189b2012-06-20 16:38:30 -07004924 wdiSendBeaconParamsRspCb: callback for passing back the
4925 response of the Send Beacon Params operation received
4926 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004927
Jeff Johnson295189b2012-06-20 16:38:30 -07004928 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004929 callback
4930
Jeff Johnson295189b2012-06-20 16:38:30 -07004931 @see WDI_AddBAReq
4932 @return Result of the function call
4933*/
4934
Jeff Johnsone7245742012-09-05 17:12:55 -07004935WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004936WDI_UpdateProbeRspTemplateReq
4937(
4938 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams,
4939 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb,
4940 void* pUserData
4941)
4942{
4943 WDI_EventInfoType wdiEventData;
4944 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
4945
4946 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004947 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004948 ------------------------------------------------------------------------*/
4949 if ( eWLAN_PAL_FALSE == gWDIInitialized )
4950 {
4951 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
4952 "WDI API call before module is initialized - Fail request");
4953
Jeff Johnsone7245742012-09-05 17:12:55 -07004954 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07004955 }
4956
4957 /*------------------------------------------------------------------------
4958 Fill in Event data and post to the Main FSM
4959 ------------------------------------------------------------------------*/
4960 wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07004961 wdiEventData.pEventData = pwdiUpdateProbeRspParams;
4962 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams);
4963 wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07004964 wdiEventData.pUserData = pUserData;
4965
4966 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
4967
4968}/*WDI_UpdateProbeRspTemplateReq*/
4969
4970/**
4971 @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob
4972 to the NV memory.
4973
4974
4975 @param wdiNvDownloadReqParams: the NV Download parameters as specified by
4976 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07004977
Jeff Johnson295189b2012-06-20 16:38:30 -07004978 wdiNvDownloadRspCb: callback for passing back the response of
4979 the NV Download operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07004980
Jeff Johnson295189b2012-06-20 16:38:30 -07004981 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07004982 callback
4983
Jeff Johnson295189b2012-06-20 16:38:30 -07004984 @see WDI_PostAssocReq
4985 @return Result of the function call
4986*/
Jeff Johnsone7245742012-09-05 17:12:55 -07004987WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07004988WDI_NvDownloadReq
4989(
4990 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams,
4991 WDI_NvDownloadRspCb wdiNvDownloadRspCb,
4992 void* pUserData
4993)
4994{
4995 WDI_EventInfoType wdiEventData;
4996
4997 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07004998 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07004999 ------------------------------------------------------------------------*/
5000 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5001 {
5002 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5003 "WDI API call before module is initialized - Fail request");
5004
Jeff Johnsone7245742012-09-05 17:12:55 -07005005 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005006 }
5007
5008 /*------------------------------------------------------------------------
5009 Fill in Event data and post to the Main FSM
5010 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005011 wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ;
5012 wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams;
5013 wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams);
5014 wdiEventData.pCBfnc = wdiNvDownloadRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005015 wdiEventData.pUserData = pUserData;
5016
5017 return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData);
5018
5019}/*WDI_NVDownloadReq*/
5020
5021#ifdef WLAN_FEATURE_P2P
5022/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005023 @brief WDI_SetP2PGONOAReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07005024 upper MAC wants to send Notice of Absence
5025 Upon the call of this API the WLAN DAL will
5026 pack and send the probe rsp template message to the
5027 lower RIVA sub-system if DAL is in state STARTED.
5028
5029 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005030 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005031
5032
Jeff Johnsone7245742012-09-05 17:12:55 -07005033 @param pwdiUpdateProbeRspParams: the Update Beacon parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07005034 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005035
Jeff Johnson295189b2012-06-20 16:38:30 -07005036 wdiSendBeaconParamsRspCb: callback for passing back the
5037 response of the Send Beacon Params operation received
5038 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005039
Jeff Johnson295189b2012-06-20 16:38:30 -07005040 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005041 callback
5042
Jeff Johnson295189b2012-06-20 16:38:30 -07005043 @see WDI_AddBAReq
5044 @return Result of the function call
5045*/
5046WDI_Status
5047WDI_SetP2PGONOAReq
5048(
5049 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams,
5050 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb,
5051 void* pUserData
5052)
5053{
5054 WDI_EventInfoType wdiEventData;
5055 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5056
5057 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005058 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005059 ------------------------------------------------------------------------*/
5060 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5061 {
5062 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5063 "WDI API call before module is initialized - Fail request");
5064
Jeff Johnsone7245742012-09-05 17:12:55 -07005065 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005066 }
5067
5068 /*------------------------------------------------------------------------
5069 Fill in Event data and post to the Main FSM
5070 ------------------------------------------------------------------------*/
5071 wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005072 wdiEventData.pEventData = pwdiP2PGONOAReqParams;
5073 wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams);
5074 wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005075 wdiEventData.pUserData = pUserData;
5076
5077 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5078
5079}/*WDI_SetP2PGONOAReq*/
5080#endif
5081
5082/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005083 @brief WDI_AddSTASelfReq will be called when the
Jeff Johnson295189b2012-06-20 16:38:30 -07005084 UMAC wanted to add STA self while opening any new session
5085 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005086 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005087
5088
Jeff Johnsone7245742012-09-05 17:12:55 -07005089 @param pwdiAddSTASelfParams: the add sta self parameters as
Jeff Johnson295189b2012-06-20 16:38:30 -07005090 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005091
Jeff Johnson295189b2012-06-20 16:38:30 -07005092 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005093 callback
5094
5095 @see
Jeff Johnson295189b2012-06-20 16:38:30 -07005096 @return Result of the function call
5097*/
5098WDI_Status
5099WDI_AddSTASelfReq
5100(
5101 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams,
5102 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb,
5103 void* pUserData
5104)
5105{
5106 WDI_EventInfoType wdiEventData;
5107 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5108
5109 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005110 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005111 ------------------------------------------------------------------------*/
5112 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5113 {
5114 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5115 "WDI API call before module is initialized - Fail request");
5116
Jeff Johnsone7245742012-09-05 17:12:55 -07005117 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005118 }
5119
5120 /*------------------------------------------------------------------------
5121 Fill in Event data and post to the Main FSM
5122 ------------------------------------------------------------------------*/
5123 wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005124 wdiEventData.pEventData = pwdiAddSTASelfReqParams;
5125 wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams);
5126 wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005127 wdiEventData.pUserData = pUserData;
5128
5129 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5130
5131}/*WDI_AddSTASelfReq*/
5132
5133
Jeff Johnsone7245742012-09-05 17:12:55 -07005134#ifdef WLAN_FEATURE_VOWIFI_11R
Jeff Johnson295189b2012-06-20 16:38:30 -07005135/**
5136 @brief WDI_AggrAddTSReq will be called when the upper MAC to inform
5137 the device of a successful add TSpec negotiation. HW
5138 needs to receive the TSpec Info from the UMAC in order
5139 to configure properly the QoS data traffic. Upon the
5140 call of this API the WLAN DAL will pack and send a HAL
5141 Add TS request message to the lower RIVA sub-system if
5142 DAL is in state STARTED.
5143
5144 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005145 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005146
5147 WDI_PostAssocReq must have been called.
5148
5149 @param wdiAddTsReqParams: the add TS parameters as specified by
5150 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005151
Jeff Johnson295189b2012-06-20 16:38:30 -07005152 wdiAddTsRspCb: callback for passing back the response of
5153 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005154
Jeff Johnson295189b2012-06-20 16:38:30 -07005155 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005156 callback
5157
Jeff Johnson295189b2012-06-20 16:38:30 -07005158 @see WDI_PostAssocReq
5159 @return Result of the function call
5160*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005161WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005162WDI_AggrAddTSReq
5163(
5164 WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams,
5165 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb,
5166 void* pUserData
5167)
5168{
5169 WDI_EventInfoType wdiEventData;
5170 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5171
5172 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005173 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005174 ------------------------------------------------------------------------*/
5175 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5176 {
5177 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5178 "WDI API call before module is initialized - Fail request");
5179
Jeff Johnsone7245742012-09-05 17:12:55 -07005180 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005181 }
5182
5183 /*------------------------------------------------------------------------
5184 Fill in Event data and post to the Main FSM
5185 ------------------------------------------------------------------------*/
5186 wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005187 wdiEventData.pEventData = pwdiAggrAddTsReqParams;
5188 wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams);
5189 wdiEventData.pCBfnc = wdiAggrAddTsRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005190 wdiEventData.pUserData = pUserData;
5191
5192 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5193
5194}/*WDI_AggrAddTSReq*/
5195
5196#endif /* WLAN_FEATURE_VOWIFI_11R */
5197
5198#ifdef ANI_MANF_DIAG
5199/**
5200 @brief WDI_FTMCommandReq
5201 Post FTM Command Event
Jeff Johnsone7245742012-09-05 17:12:55 -07005202
5203 @param ftmCommandReq: FTM Command Body
5204 @param ftmCommandRspCb: FTM Response from HAL CB
Jeff Johnson295189b2012-06-20 16:38:30 -07005205 @param pUserData: Client Data
Jeff Johnsone7245742012-09-05 17:12:55 -07005206
Jeff Johnson295189b2012-06-20 16:38:30 -07005207 @see
5208 @return Result of the function call
5209*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005210WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005211WDI_FTMCommandReq
5212(
5213 WDI_FTMCommandReqType *ftmCommandReq,
5214 WDI_FTMCommandRspCb ftmCommandRspCb,
5215 void *pUserData
5216)
5217{
5218 WDI_EventInfoType wdiEventData;
5219 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5220
5221 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005222 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005223 ------------------------------------------------------------------------*/
5224 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5225 {
5226 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5227 "WDI API call before module is initialized - Fail request");
5228
Jeff Johnsone7245742012-09-05 17:12:55 -07005229 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005230 }
5231
5232 /*------------------------------------------------------------------------
5233 Fill in Event data and post to the Main FSM
5234 ------------------------------------------------------------------------*/
5235 wdiEventData.wdiRequest = WDI_FTM_CMD_REQ;
5236 wdiEventData.pEventData = (void *)ftmCommandReq;
5237 wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32);
5238 wdiEventData.pCBfnc = ftmCommandRspCb;
5239 wdiEventData.pUserData = pUserData;
5240
5241 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5242}
Jeff Johnsone7245742012-09-05 17:12:55 -07005243#endif /* ANI_MANF_DIAG */
Jeff Johnson295189b2012-06-20 16:38:30 -07005244/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005245 @brief WDI_HostResumeReq will be called
Jeff Johnson295189b2012-06-20 16:38:30 -07005246
5247 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005248 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005249
5250
5251 @param pwdiResumeReqParams: as specified by
5252 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005253
Jeff Johnson295189b2012-06-20 16:38:30 -07005254 wdiResumeReqRspCb: callback for passing back the response of
5255 the Resume Req received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005256
Jeff Johnson295189b2012-06-20 16:38:30 -07005257 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005258 callback
5259
5260 @see
Jeff Johnson295189b2012-06-20 16:38:30 -07005261 @return Result of the function call
5262*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005263WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005264WDI_HostResumeReq
5265(
5266 WDI_ResumeParamsType* pwdiResumeReqParams,
5267 WDI_HostResumeEventRspCb wdiResumeReqRspCb,
5268 void* pUserData
5269)
5270{
5271 WDI_EventInfoType wdiEventData;
5272 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5273
5274 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005275 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005276 ------------------------------------------------------------------------*/
5277 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5278 {
5279 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5280 "WDI API call before module is initialized - Fail request");
5281
Jeff Johnsone7245742012-09-05 17:12:55 -07005282 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005283 }
5284
5285 /*------------------------------------------------------------------------
5286 Fill in Event data and post to the Main FSM
5287 ------------------------------------------------------------------------*/
5288 wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005289 wdiEventData.pEventData = pwdiResumeReqParams;
5290 wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams);
5291 wdiEventData.pCBfnc = wdiResumeReqRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005292 wdiEventData.pUserData = pUserData;
5293
5294 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5295
5296}/*WDI_HostResumeReq*/
5297
5298/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005299 @brief WDI_DelSTASelfReq will be called
Jeff Johnson295189b2012-06-20 16:38:30 -07005300
5301 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005302 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005303
5304
5305 @param pwdiDelStaSelfReqParams: as specified by
5306 the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005307
Jeff Johnson295189b2012-06-20 16:38:30 -07005308 wdiDelStaSelfRspCb: callback for passing back the response of
5309 the add TS operation received from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005310
Jeff Johnson295189b2012-06-20 16:38:30 -07005311 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005312 callback
5313
Jeff Johnson295189b2012-06-20 16:38:30 -07005314 @see WDI_PostAssocReq
5315 @return Result of the function call
5316*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005317WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005318WDI_DelSTASelfReq
5319(
5320 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams,
5321 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb,
5322 void* pUserData
5323)
5324{
5325 WDI_EventInfoType wdiEventData;
5326 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5327
5328 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005329 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005330 ------------------------------------------------------------------------*/
5331 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5332 {
5333 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5334 "WDI API call before module is initialized - Fail request");
5335
Jeff Johnsone7245742012-09-05 17:12:55 -07005336 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005337 }
5338
5339 /*------------------------------------------------------------------------
5340 Fill in Event data and post to the Main FSM
5341 ------------------------------------------------------------------------*/
5342 wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005343 wdiEventData.pEventData = pwdiDelStaSelfReqParams;
5344 wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams);
5345 wdiEventData.pCBfnc = wdiDelStaSelfRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005346 wdiEventData.pUserData = pUserData;
5347
5348 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5349
5350}/*WDI_AggrAddTSReq*/
5351
5352/**
Jeff Johnsone7245742012-09-05 17:12:55 -07005353 @brief WDI_SetTxPerTrackingReq will be called when the upper MAC
5354 wants to set the Tx Per Tracking configurations.
Jeff Johnson295189b2012-06-20 16:38:30 -07005355 Upon the call of this API the WLAN DAL will pack
5356 and send a HAL Set Tx Per Tracking request message to the
5357 lower RIVA sub-system if DAL is in state STARTED.
5358
5359 In state BUSY this request will be queued. Request won't
Jeff Johnsone7245742012-09-05 17:12:55 -07005360 be allowed in any other state.
Jeff Johnson295189b2012-06-20 16:38:30 -07005361
Jeff Johnsone7245742012-09-05 17:12:55 -07005362 @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as
Jeff Johnson295189b2012-06-20 16:38:30 -07005363 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -07005364
Jeff Johnson295189b2012-06-20 16:38:30 -07005365 pwdiSetTxPerTrackingRspCb: callback for passing back the
5366 response of the set Tx PER Tracking configurations operation received
5367 from the device
Jeff Johnsone7245742012-09-05 17:12:55 -07005368
Jeff Johnson295189b2012-06-20 16:38:30 -07005369 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -07005370 callback
5371
Jeff Johnson295189b2012-06-20 16:38:30 -07005372 @return Result of the function call
5373*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005374WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005375WDI_SetTxPerTrackingReq
5376(
5377 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams,
5378 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb,
5379 void* pUserData
5380)
5381{
5382 WDI_EventInfoType wdiEventData;
5383 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5384
5385 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005386 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005387 ------------------------------------------------------------------------*/
5388 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5389 {
5390 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5391 "WDI API call before module is initialized - Fail request");
5392
Jeff Johnsone7245742012-09-05 17:12:55 -07005393 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005394 }
5395
5396 /*------------------------------------------------------------------------
5397 Fill in Event data and post to the Main FSM
5398 ------------------------------------------------------------------------*/
5399 wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -07005400 wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07005401 wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -07005402 wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb;
Jeff Johnson295189b2012-06-20 16:38:30 -07005403 wdiEventData.pUserData = pUserData;
5404
5405 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5406
5407}/*WDI_SetTxPerTrackingReq*/
5408
5409/**
5410 @brief WDI_SetTmLevelReq
5411 If HW Thermal condition changed, driver should react based on new
5412 HW thermal condition.
5413
5414 @param pwdiSetTmLevelReq: New thermal condition information
5415
5416 pwdiSetTmLevelRspCb: callback
5417
5418 usrData: user data will be passed back with the
5419 callback
5420
5421 @return Result of the function call
5422*/
5423WDI_Status
5424WDI_SetTmLevelReq
5425(
5426 WDI_SetTmLevelReqType *pwdiSetTmLevelReq,
5427 WDI_SetTmLevelCb pwdiSetTmLevelRspCb,
5428 void *usrData
5429)
5430{
5431 WDI_EventInfoType wdiEventData;
5432 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5433
5434 /*------------------------------------------------------------------------
5435 Sanity Check
5436 ------------------------------------------------------------------------*/
5437 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5438 {
5439 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5440 "WDI API call before module is initialized - Fail request");
5441
5442 return WDI_STATUS_E_NOT_ALLOWED;
5443 }
5444
5445 /*------------------------------------------------------------------------
5446 Fill in Event data and post to the Main FSM
5447 ------------------------------------------------------------------------*/
5448 wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ;
5449 wdiEventData.pEventData = pwdiSetTmLevelReq;
5450 wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq);
5451 wdiEventData.pCBfnc = pwdiSetTmLevelRspCb;
5452 wdiEventData.pUserData = usrData;
5453
5454 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5455}
5456
5457/**
5458 @brief WDI_HostSuspendInd
5459
5460 Suspend Indication from the upper layer will be sent
5461 down to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -07005462
Jeff Johnson295189b2012-06-20 16:38:30 -07005463 @param WDI_SuspendResumeIndParamsType
Jeff Johnsone7245742012-09-05 17:12:55 -07005464
5465 @see
5466
Jeff Johnson295189b2012-06-20 16:38:30 -07005467 @return Status of the request
5468*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005469WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -07005470WDI_HostSuspendInd
5471(
5472 WDI_SuspendParamsType* pwdiSuspendIndParams
5473)
5474{
5475
5476 WDI_EventInfoType wdiEventData;
5477 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5478
5479 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005480 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005481 ------------------------------------------------------------------------*/
5482 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5483 {
5484 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5485 "WDI API call before module is initialized - Fail request");
5486
Jeff Johnsone7245742012-09-05 17:12:55 -07005487 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005488 }
5489
5490 /*------------------------------------------------------------------------
5491 Fill in Event data and post to the Main FSM
5492 ------------------------------------------------------------------------*/
5493 wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -07005494 wdiEventData.pEventData = pwdiSuspendIndParams;
5495 wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams);
5496 wdiEventData.pCBfnc = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07005497 wdiEventData.pUserData = NULL;
5498
5499 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5500
5501}/*WDI_HostSuspendInd*/
5502
5503/**
5504 @brief WDI_HALDumpCmdReq
5505 Post HAL DUMP Command Event
Jeff Johnsone7245742012-09-05 17:12:55 -07005506
5507 @param halDumpCmdReqParams: Hal Dump Command Body
5508 @param halDumpCmdRspCb: HAL DUMP Response from HAL CB
Jeff Johnson295189b2012-06-20 16:38:30 -07005509 @param pUserData: Client Data
Jeff Johnsone7245742012-09-05 17:12:55 -07005510
Jeff Johnson295189b2012-06-20 16:38:30 -07005511 @see
5512 @return Result of the function call
5513*/
5514WDI_Status WDI_HALDumpCmdReq
5515(
5516 WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams,
5517 WDI_HALDumpCmdRspCb halDumpCmdRspCb,
5518 void *pUserData
5519)
5520{
5521 WDI_EventInfoType wdiEventData;
5522 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5523
5524 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005525 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005526 ------------------------------------------------------------------------*/
5527 if ( eWLAN_PAL_FALSE == gWDIInitialized )
5528 {
5529 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5530 "WDI API call before module is initialized - Fail request");
5531
Jeff Johnsone7245742012-09-05 17:12:55 -07005532 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005533 }
5534
5535 /*------------------------------------------------------------------------
5536 Fill in Event data and post to the Main FSM
5537 ------------------------------------------------------------------------*/
5538 wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ;
5539 wdiEventData.pEventData = (void *)halDumpCmdReqParams;
5540 wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType);
5541 wdiEventData.pCBfnc = halDumpCmdRspCb;
5542 wdiEventData.pUserData = pUserData;
5543
5544 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
5545}
5546
Jeff Johnsone7245742012-09-05 17:12:55 -07005547/*============================================================================
5548
Jeff Johnson295189b2012-06-20 16:38:30 -07005549 DAL Control Path Main FSM Function Implementation
Jeff Johnsone7245742012-09-05 17:12:55 -07005550
Jeff Johnson295189b2012-06-20 16:38:30 -07005551 ============================================================================*/
5552
5553/**
5554 @brief Main FSM Start function for all states except BUSY
5555
Jeff Johnsone7245742012-09-05 17:12:55 -07005556
5557 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -07005558 wdiEV: event posted to the main DAL FSM
5559 pEventData: pointer to the event information
Jeff Johnsone7245742012-09-05 17:12:55 -07005560 structure
5561
Jeff Johnson295189b2012-06-20 16:38:30 -07005562 @see
5563 @return Result of the function call
5564*/
5565WDI_Status
5566WDI_PostMainEvent
5567(
Jeff Johnsone7245742012-09-05 17:12:55 -07005568 WDI_ControlBlockType* pWDICtx,
5569 WDI_MainEventType wdiEV,
Jeff Johnson295189b2012-06-20 16:38:30 -07005570 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -07005571
Jeff Johnson295189b2012-06-20 16:38:30 -07005572)
5573{
Jeff Johnsone7245742012-09-05 17:12:55 -07005574 WDI_Status wdiStatus;
5575 WDI_MainFuncType pfnWDIMainEvHdlr;
5576 WDI_MainStateType wdiOldState;
Jeff Johnson295189b2012-06-20 16:38:30 -07005577 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5578
5579 /*-------------------------------------------------------------------------
5580 Sanity check
5581 -------------------------------------------------------------------------*/
5582 if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) ||
5583 ( wdiEV >= WDI_MAX_EVENT ))
5584 {
5585 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
5586 "Invalid state or event in Post Main Ev function ST: %d EV: %d",
5587 pWDICtx->uGlobalState, wdiEV);
Jeff Johnsone7245742012-09-05 17:12:55 -07005588 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005589 }
5590
5591 /*Access to the global state must be locked */
5592 wpalMutexAcquire(&pWDICtx->wptMutex);
5593
5594 /*Fetch event handler for state*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005595 pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV];
Jeff Johnson295189b2012-06-20 16:38:30 -07005596
5597 wdiOldState = pWDICtx->uGlobalState;
5598
5599 /*
Jeff Johnsone7245742012-09-05 17:12:55 -07005600 --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a
5601 response comes from CCPU for the request sent by host:
5602 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 -07005603 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 -07005604 --Incase of WDI event is WDI_RESPONSE_EVENT and it is an indication from the
Jeff Johnson295189b2012-06-20 16:38:30 -07005605 CCPU:
5606 don't change the state */
5607 if ( WDI_RESPONSE_EVENT != wdiEV)
5608 {
5609 /*Transition to BUSY State - the request is now being processed by the FSM,
5610 if the request fails we shall transition back to the old state, if not
5611 the request will manage its own state transition*/
5612 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
5613 }
5614 /* If the state function associated with the EV is NULL it means that this
5615 event is not allowed in this state*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005616 if ( NULL != pfnWDIMainEvHdlr )
Jeff Johnson295189b2012-06-20 16:38:30 -07005617 {
5618 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005619 "Posting event %d in state: %d to the Main FSM",
Jeff Johnson295189b2012-06-20 16:38:30 -07005620 wdiEV, wdiOldState);
Jeff Johnsone7245742012-09-05 17:12:55 -07005621 wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07005622 }
5623 else
5624 {
5625 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07005626 "Unexpected event %d in state: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -07005627 wdiEV, wdiOldState);
Jeff Johnsone7245742012-09-05 17:12:55 -07005628 wdiStatus = WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07005629 }
5630
5631 /* If a request handles itself well it will end up in a success or in a
5632 pending
5633 Success - means that the request was processed and the proper state
5634 transition already occurred or will occur when the resp is received
5635 - NO other state transition or dequeueing is required
Jeff Johnsone7245742012-09-05 17:12:55 -07005636
Jeff Johnson295189b2012-06-20 16:38:30 -07005637 Pending - means the request could not be processed at this moment in time
5638 because the FSM was already busy so no state transition or dequeueing
5639 is necessary anymore
Jeff Johnsone7245742012-09-05 17:12:55 -07005640
Jeff Johnson295189b2012-06-20 16:38:30 -07005641 Success for synchronous case means that the transition may occur and
5642 processing of pending requests may continue - so it should go through
5643 and restores the state and continue processing queued requests*/
5644 if (( WDI_STATUS_SUCCESS != wdiStatus )&&
5645 ( WDI_STATUS_PENDING != wdiStatus ))
5646 {
5647 if ( WDI_RESPONSE_EVENT != wdiEV)
5648 {
5649 /*The request has failed or could not be processed - transition back to
5650 the old state - check to see if anything was queued and try to execute
5651 The dequeue logic should post a message to a thread and return - no
5652 actual processing can occur */
5653 WDI_STATE_TRANSITION( pWDICtx, wdiOldState);
5654 }
5655 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -07005656
Jeff Johnson295189b2012-06-20 16:38:30 -07005657 }
5658
5659 /* we have completed processing the event */
5660 wpalMutexRelease(&pWDICtx->wptMutex);
5661
Jeff Johnsone7245742012-09-05 17:12:55 -07005662 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07005663
5664}/*WDI_PostMainEvent*/
5665
5666
5667/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005668 INIT State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005669--------------------------------------------------------------------------*/
5670/**
5671 @brief Main FSM Start function for all states except BUSY
5672
Jeff Johnsone7245742012-09-05 17:12:55 -07005673
5674 @param pWDICtx: pointer to the WLAN DAL context
5675 pEventData: pointer to the event information structure
5676
Jeff Johnson295189b2012-06-20 16:38:30 -07005677 @see
5678 @return Result of the function call
5679*/
5680WDI_Status
5681WDI_MainStart
Jeff Johnsone7245742012-09-05 17:12:55 -07005682(
Jeff Johnson295189b2012-06-20 16:38:30 -07005683 WDI_ControlBlockType* pWDICtx,
5684 WDI_EventInfoType* pEventData
5685)
5686{
5687
5688 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005689 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005690 ----------------------------------------------------------------------*/
5691 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5692 {
5693 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005694 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005695 pWDICtx, pEventData);
5696 return WDI_STATUS_E_FAILURE;
5697 }
5698
5699 wpalMutexAcquire(&pWDICtx->wptMutex);
5700
5701 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005702 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07005703 ----------------------------------------------------------------------*/
5704 if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened )
5705 {
5706 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
5707 "Control Transport not yet Open - queueing the request");
5708
5709 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -07005710 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07005711
5712 wpalMutexRelease(&pWDICtx->wptMutex);
5713 return WDI_STATUS_PENDING;
5714 }
Jeff Johnsone7245742012-09-05 17:12:55 -07005715
Jeff Johnson295189b2012-06-20 16:38:30 -07005716 wpalMutexRelease(&pWDICtx->wptMutex);
5717
5718 /*Return Success*/
5719 return WDI_ProcessRequest( pWDICtx, pEventData );
5720
5721}/*WDI_MainStart*/
5722
5723/**
5724 @brief Main FSM Response function for state INIT
5725
Jeff Johnsone7245742012-09-05 17:12:55 -07005726
5727 @param pWDICtx: pointer to the WLAN DAL context
5728 pEventData: pointer to the event information structure
5729
Jeff Johnson295189b2012-06-20 16:38:30 -07005730 @see
5731 @return Result of the function call
5732*/
5733WDI_Status
5734WDI_MainRspInit
Jeff Johnsone7245742012-09-05 17:12:55 -07005735(
Jeff Johnson295189b2012-06-20 16:38:30 -07005736 WDI_ControlBlockType* pWDICtx,
5737 WDI_EventInfoType* pEventData
5738)
5739{
5740 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005741 Not expecting a response from the device before it is started
Jeff Johnson295189b2012-06-20 16:38:30 -07005742 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005743 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07005744
5745 /*Return Success*/
5746 return WDI_STATUS_E_NOT_ALLOWED;
5747}/* WDI_MainRspInit */
5748
5749/**
5750 @brief Main FSM Close function for all states except BUSY
5751
Jeff Johnsone7245742012-09-05 17:12:55 -07005752
5753 @param pWDICtx: pointer to the WLAN DAL context
5754 pEventData: pointer to the event information structure
5755
Jeff Johnson295189b2012-06-20 16:38:30 -07005756 @see
5757 @return Result of the function call
5758*/
5759WDI_Status
5760WDI_MainClose
Jeff Johnsone7245742012-09-05 17:12:55 -07005761(
Jeff Johnson295189b2012-06-20 16:38:30 -07005762 WDI_ControlBlockType* pWDICtx,
5763 WDI_EventInfoType* pEventData
5764)
5765{
5766
5767 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005768 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005769 ----------------------------------------------------------------------*/
5770 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5771 {
5772 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005773 "Invalid parameters on Main Close %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005774 pWDICtx, pEventData);
5775 return WDI_STATUS_E_FAILURE;
5776 }
5777
5778 /*Return Success*/
5779 return WDI_ProcessRequest( pWDICtx, pEventData );
5780
5781}/*WDI_MainClose*/
5782/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005783 STARTED State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07005784--------------------------------------------------------------------------*/
5785/**
5786 @brief Main FSM Start function for state STARTED
5787
Jeff Johnsone7245742012-09-05 17:12:55 -07005788
5789 @param pWDICtx: pointer to the WLAN DAL context
5790 pEventData: pointer to the event information structure
5791
Jeff Johnson295189b2012-06-20 16:38:30 -07005792 @see
5793 @return Result of the function call
5794*/
5795WDI_Status
5796WDI_MainStartStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005797(
Jeff Johnson295189b2012-06-20 16:38:30 -07005798 WDI_ControlBlockType* pWDICtx,
5799 WDI_EventInfoType* pEventData
5800)
5801{
5802 WDI_StartRspCb wdiStartRspCb = NULL;
5803 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
5804
5805 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005806 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005807 ----------------------------------------------------------------------*/
5808 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5809 {
5810 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005811 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005812 pWDICtx, pEventData);
5813 return WDI_STATUS_E_FAILURE;
5814 }
5815
5816 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005817 Nothing to do transport was already started
Jeff Johnson295189b2012-06-20 16:38:30 -07005818 ----------------------------------------------------------------------*/
5819 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005820 "Received start while transport was already started - nothing to do");
Jeff Johnson295189b2012-06-20 16:38:30 -07005821
5822 wpalMutexAcquire(&pWDICtx->wptMutex);
5823
5824 /*Transition back to started because the post function transitioned us to
5825 busy*/
5826 WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST);
5827
5828 /*Check to see if any request is pending*/
5829 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -07005830
Jeff Johnson295189b2012-06-20 16:38:30 -07005831 wpalMutexRelease(&pWDICtx->wptMutex);
5832
5833 /*Tell UMAC Success*/
Jeff Johnsone7245742012-09-05 17:12:55 -07005834 wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc;
5835
Jeff Johnson295189b2012-06-20 16:38:30 -07005836 /*Notify UMAC*/
5837 wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData);
5838
5839 /*Return Success*/
5840 return WDI_STATUS_SUCCESS;
5841
5842}/*WDI_MainStartStarted*/
5843
5844/**
5845 @brief Main FSM Stop function for state STARTED
5846
Jeff Johnsone7245742012-09-05 17:12:55 -07005847
5848 @param pWDICtx: pointer to the WLAN DAL context
5849 pEventData: pointer to the event information structure
5850
Jeff Johnson295189b2012-06-20 16:38:30 -07005851 @see
5852 @return Result of the function call
5853*/
5854WDI_Status
5855WDI_MainStopStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005856(
Jeff Johnson295189b2012-06-20 16:38:30 -07005857 WDI_ControlBlockType* pWDICtx,
5858 WDI_EventInfoType* pEventData
5859)
5860{
5861 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005862 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005863 ----------------------------------------------------------------------*/
5864 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5865 {
5866 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07005867 "Invalid parameters on Main Start %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005868 pWDICtx, pEventData);
5869 return WDI_STATUS_E_FAILURE;
5870 }
5871
5872 /*State at this point is BUSY - because we enter this state before posting
5873 an event to the FSM in order to prevent potential race conditions*/
5874
5875 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
5876 "Processing stop request in FSM");
5877
5878 /*Return Success*/
5879 return WDI_ProcessRequest( pWDICtx, pEventData );
5880
5881}/*WDI_MainStopStarted*/
5882/**
5883 @brief Main FSM Request function for state started
5884
Jeff Johnsone7245742012-09-05 17:12:55 -07005885
5886 @param pWDICtx: pointer to the WLAN DAL context
5887 pEventData: pointer to the event information structure
5888
Jeff Johnson295189b2012-06-20 16:38:30 -07005889 @see
5890 @return Result of the function call
5891*/
5892WDI_Status
5893WDI_MainReqStarted
Jeff Johnsone7245742012-09-05 17:12:55 -07005894(
Jeff Johnson295189b2012-06-20 16:38:30 -07005895 WDI_ControlBlockType* pWDICtx,
5896 WDI_EventInfoType* pEventData
5897)
5898{
5899
5900 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005901 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005902 ----------------------------------------------------------------------*/
5903 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5904 {
5905 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005906 "Invalid parameters on Main Req Started %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005907 pWDICtx, pEventData);
5908 return WDI_STATUS_E_FAILURE;
5909 }
5910
5911 /*State at this point is BUSY - because we enter this state before posting
5912 an event to the FSM in order to prevent potential race conditions*/
5913
5914 /*Return Success*/
5915 return WDI_ProcessRequest( pWDICtx, pEventData );
5916
5917}/*WDI_MainReqStarted*/
5918
5919/**
5920 @brief Main FSM Response function for all states except INIT
5921
Jeff Johnsone7245742012-09-05 17:12:55 -07005922
5923 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -07005924 pEventData: pointer to the event information structure
Jeff Johnsone7245742012-09-05 17:12:55 -07005925
Jeff Johnson295189b2012-06-20 16:38:30 -07005926 @see
5927 @return Result of the function call
5928*/
5929WDI_Status
5930WDI_MainRsp
Jeff Johnsone7245742012-09-05 17:12:55 -07005931(
Jeff Johnson295189b2012-06-20 16:38:30 -07005932 WDI_ControlBlockType* pWDICtx,
5933 WDI_EventInfoType* pEventData
5934)
5935{
Jeff Johnsone7245742012-09-05 17:12:55 -07005936 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07005937 wpt_boolean expectedResponse;
5938
5939 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005940 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07005941 ----------------------------------------------------------------------*/
5942 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
5943 {
5944 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07005945 "Invalid parameters on Main Response %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07005946 pWDICtx, pEventData);
5947 return WDI_STATUS_E_FAILURE;
5948 }
5949
5950 if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse )
5951 {
5952 /* we received an expected response */
5953 expectedResponse = eWLAN_PAL_TRUE;
5954
5955 /*We expect that we will transition to started after this processing*/
5956 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
5957
5958 /* we are no longer expecting a response */
5959 pWDICtx->wdiExpectedResponse = WDI_MAX_RESP;
5960 }
5961 else
5962 {
5963 /* we received an indication or unexpected response */
5964 expectedResponse = eWLAN_PAL_FALSE;
5965 /* for indications no need to update state from what it is right
5966 now, unless it explicitly does it in the indication handler (say
5967 for device failure ind) */
5968 pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState;
5969 }
5970
5971 /*Process the response and indication */
5972 wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData );
5973
5974 /*Lock the CB as we are about to do a state transition*/
5975 wpalMutexAcquire(&pWDICtx->wptMutex);
5976
5977 /*Transition to the expected state after the response processing
5978 - this should always be started state with the following exceptions:
5979 1. processing of a failed start response
5980 2. device failure detected while processing response
5981 3. stop response received*/
5982 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
Jeff Johnsone7245742012-09-05 17:12:55 -07005983
Jeff Johnson295189b2012-06-20 16:38:30 -07005984 /*Dequeue request that may have been queued while we were waiting for the
5985 response */
5986 if ( expectedResponse )
5987 {
Jeff Johnsone7245742012-09-05 17:12:55 -07005988 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07005989 }
5990
5991 wpalMutexRelease(&pWDICtx->wptMutex);
5992
5993 /*Return Success - always */
Jeff Johnsone7245742012-09-05 17:12:55 -07005994 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07005995
5996}/*WDI_MainRsp*/
5997
5998/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07005999 STOPPED State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07006000--------------------------------------------------------------------------*/
6001/**
6002 @brief Main FSM Stop function for state STOPPED
6003
Jeff Johnsone7245742012-09-05 17:12:55 -07006004
6005 @param pWDICtx: pointer to the WLAN DAL context
6006 pEventData: pointer to the event information structure
6007
Jeff Johnson295189b2012-06-20 16:38:30 -07006008 @see
6009 @return Result of the function call
6010*/
6011WDI_Status
6012WDI_MainStopStopped
Jeff Johnsone7245742012-09-05 17:12:55 -07006013(
Jeff Johnson295189b2012-06-20 16:38:30 -07006014 WDI_ControlBlockType* pWDICtx,
6015 WDI_EventInfoType* pEventData
6016)
6017{
6018 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006019 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006020 ----------------------------------------------------------------------*/
6021 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6022 {
6023 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07006024 "Invalid parameters on Main Stop Stopped %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006025 pWDICtx, pEventData);
6026 return WDI_STATUS_E_FAILURE;
6027 }
6028
6029 /*We should normally not get a STOP request if we are already stopped
6030 since we should normally be stopped by the UMAC. However in some
6031 error situations we put ourselves in the stopped state without the
6032 UMAC knowing, so when we get a STOP request in this state we still
6033 process it since we need to clean up the underlying state */
6034 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6035 "Processing stop request while stopped in FSM");
6036
6037 /*Return Success*/
6038 return WDI_ProcessRequest( pWDICtx, pEventData );
6039
6040}/*WDI_MainStopStopped*/
6041
6042/*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006043 BUSY State Functions
Jeff Johnson295189b2012-06-20 16:38:30 -07006044--------------------------------------------------------------------------*/
6045/**
6046 @brief Main FSM Start function for state BUSY
6047
Jeff Johnsone7245742012-09-05 17:12:55 -07006048
6049 @param pWDICtx: pointer to the WLAN DAL context
6050 pEventData: pointer to the event information structure
6051
Jeff Johnson295189b2012-06-20 16:38:30 -07006052 @see
6053 @return Result of the function call
6054*/
6055WDI_Status
6056WDI_MainStartBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006057(
Jeff Johnson295189b2012-06-20 16:38:30 -07006058 WDI_ControlBlockType* pWDICtx,
6059 WDI_EventInfoType* pEventData
6060)
6061{
6062 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006063 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006064 ----------------------------------------------------------------------*/
6065 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6066 {
6067 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006068 "Invalid parameters on Main Start in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006069 pWDICtx, pEventData);
6070 return WDI_STATUS_E_FAILURE;
6071 }
6072
6073 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006074 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006075 ----------------------------------------------------------------------*/
6076 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6077 "WDI Busy state - queue start request");
6078
6079 /*Queue the start request*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006080 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006081
6082 /*Return Success*/
6083 return WDI_STATUS_PENDING;
6084}/*WDI_MainStartBusy*/
6085
6086/**
6087 @brief Main FSM Stop function for state BUSY
6088
Jeff Johnsone7245742012-09-05 17:12:55 -07006089
6090 @param pWDICtx: pointer to the WLAN DAL context
6091 pEventData: pointer to the event information structure
6092
Jeff Johnson295189b2012-06-20 16:38:30 -07006093 @see
6094 @return Result of the function call
6095*/
6096WDI_Status
6097WDI_MainStopBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006098(
Jeff Johnson295189b2012-06-20 16:38:30 -07006099 WDI_ControlBlockType* pWDICtx,
6100 WDI_EventInfoType* pEventData
6101)
6102{
6103 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006104 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006105 ----------------------------------------------------------------------*/
6106 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6107 {
6108 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006109 "Invalid parameters on Main Stop in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006110 pWDICtx, pEventData);
6111 return WDI_STATUS_E_FAILURE;
6112 }
6113
6114 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006115 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006116 ----------------------------------------------------------------------*/
6117 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6118 "WDI Busy state - queue stop request");
6119
Jeff Johnsone7245742012-09-05 17:12:55 -07006120 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006121 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006122
Jeff Johnson295189b2012-06-20 16:38:30 -07006123}/*WDI_MainStopBusy*/
6124
6125/**
6126 @brief Main FSM Request function for state BUSY
6127
Jeff Johnsone7245742012-09-05 17:12:55 -07006128
6129 @param pWDICtx: pointer to the WLAN DAL context
6130 pEventData: pointer to the event information structure
6131
Jeff Johnson295189b2012-06-20 16:38:30 -07006132 @see
6133 @return Result of the function call
6134*/
6135WDI_Status
6136WDI_MainReqBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006137(
Jeff Johnson295189b2012-06-20 16:38:30 -07006138 WDI_ControlBlockType* pWDICtx,
6139 WDI_EventInfoType* pEventData
6140)
6141{
6142 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006143 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006144 ----------------------------------------------------------------------*/
6145 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6146 {
6147 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006148 "Invalid parameters on Main Request in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006149 pWDICtx, pEventData);
6150 return WDI_STATUS_E_FAILURE;
6151 }
6152
6153 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006154 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006155 ----------------------------------------------------------------------*/
6156 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6157 "WDI Busy state - queue request %d because waiting for response %d",
6158 pEventData->wdiRequest, pWDICtx->wdiExpectedResponse);
6159
Jeff Johnsone7245742012-09-05 17:12:55 -07006160 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006161 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006162
Jeff Johnson295189b2012-06-20 16:38:30 -07006163}/*WDI_MainReqBusy*/
6164/**
6165 @brief Main FSM Close function for state BUSY
6166
Jeff Johnsone7245742012-09-05 17:12:55 -07006167
6168 @param pWDICtx: pointer to the WLAN DAL context
6169 pEventData: pointer to the event information structure
6170
Jeff Johnson295189b2012-06-20 16:38:30 -07006171 @see
6172 @return Result of the function call
6173*/
6174WDI_Status
6175WDI_MainCloseBusy
Jeff Johnsone7245742012-09-05 17:12:55 -07006176(
Jeff Johnson295189b2012-06-20 16:38:30 -07006177 WDI_ControlBlockType* pWDICtx,
6178 WDI_EventInfoType* pEventData
6179)
6180{
6181 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006182 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -07006183 ----------------------------------------------------------------------*/
6184 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6185 {
6186 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -07006187 "Invalid parameters on Main Close in BUSY %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -07006188 pWDICtx, pEventData);
6189 return WDI_STATUS_E_FAILURE;
6190 }
6191
6192 /*--------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006193 Check if the Control Transport has been opened
Jeff Johnson295189b2012-06-20 16:38:30 -07006194 ----------------------------------------------------------------------*/
6195 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6196 "WDI Busy state - queue close request");
6197
Jeff Johnsone7245742012-09-05 17:12:55 -07006198 WDI_QueuePendingReq( pWDICtx, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07006199 return WDI_STATUS_PENDING;
Jeff Johnsone7245742012-09-05 17:12:55 -07006200
Jeff Johnson295189b2012-06-20 16:38:30 -07006201}/*WDI_MainCloseBusy*/
6202
6203/**
6204 @brief Main FSM Shutdown function for INIT & STARTED states
6205
6206
6207 @param pWDICtx: pointer to the WLAN DAL context
6208 pEventData: pointer to the event information structure
6209
6210 @see
6211 @return Result of the function call
6212*/
6213WDI_Status
6214WDI_MainShutdown
6215(
6216 WDI_ControlBlockType* pWDICtx,
6217 WDI_EventInfoType* pEventData
6218)
6219{
6220 /*--------------------------------------------------------------------
6221 Sanity Check
6222 ----------------------------------------------------------------------*/
6223 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6224 {
6225 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6226 "Invalid parameters on Main Start %x %x",
6227 pWDICtx, pEventData);
6228 return WDI_STATUS_E_FAILURE;
6229 }
6230
6231 /*State at this point is BUSY - because we enter this state before posting
6232 an event to the FSM in order to prevent potential race conditions*/
6233
6234 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6235 "Processing shutdown request in FSM");
6236
6237 /*Return Success*/
6238 return WDI_ProcessRequest( pWDICtx, pEventData );
6239
6240}/*WDI_MainShutdown*/
6241
6242/**
6243 @brief Main FSM Shutdown function for BUSY state
6244
6245
6246 @param pWDICtx: pointer to the WLAN DAL context
6247 pEventData: pointer to the event information structure
6248
6249 @see
6250 @return Result of the function call
6251*/
6252WDI_Status
6253WDI_MainShutdownBusy
6254(
6255 WDI_ControlBlockType* pWDICtx,
6256 WDI_EventInfoType* pEventData
6257)
6258{
6259 /*--------------------------------------------------------------------
6260 Sanity Check
6261 ----------------------------------------------------------------------*/
6262 if (( NULL == pWDICtx ) || ( NULL == pEventData ))
6263 {
6264 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6265 "Invalid parameters on Main Start %x %x",
6266 pWDICtx, pEventData);
6267 return WDI_STATUS_E_FAILURE;
6268 }
6269
6270 /* If you are waiting for a HAL response at this stage, you are not
6271 * going to get it. Riva is already shutdown/crashed.
6272 */
6273 wpalTimerStop(&gWDICb.wptResponseTimer);
6274
6275 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6276 "Processing shutdown request in FSM: Busy state ");
6277
6278 return WDI_ProcessRequest( pWDICtx, pEventData );
6279
6280}/*WDI_MainShutdownBusy*/
6281
6282
Jeff Johnsone7245742012-09-05 17:12:55 -07006283/*=======================================================================
6284
Jeff Johnson295189b2012-06-20 16:38:30 -07006285 WLAN DAL Control Path Main Processing Functions
Jeff Johnsone7245742012-09-05 17:12:55 -07006286
Jeff Johnson295189b2012-06-20 16:38:30 -07006287*=======================================================================*/
6288
6289/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07006290 Main DAL Control Path Request Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -07006291========================================================================*/
6292/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006293 @brief Process Start Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006294 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006295
6296 @param pWDICtx: pointer to the WLAN DAL context
6297 pEventData: pointer to the event information structure
6298
Jeff Johnson295189b2012-06-20 16:38:30 -07006299 @see
6300 @return Result of the function call
6301*/
6302WDI_Status
6303WDI_ProcessStartReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006304(
Jeff Johnson295189b2012-06-20 16:38:30 -07006305 WDI_ControlBlockType* pWDICtx,
6306 WDI_EventInfoType* pEventData
6307)
6308{
6309 WDI_StartReqParamsType* pwdiStartParams = NULL;
6310 WDI_StartRspCb wdiStartRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006311 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006312 wpt_uint16 usDataOffset = 0;
6313 wpt_uint16 usSendSize = 0;
6314
Jeff Johnsone7245742012-09-05 17:12:55 -07006315 tHalMacStartReqMsg halStartReq;
6316 wpt_uint16 usLen = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07006317 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6318
6319 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006320 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006321 -------------------------------------------------------------------------*/
6322 if (( NULL == pEventData ) ||
6323 ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) ||
6324 ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc)))
6325 {
6326 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6327 "%s: Invalid parameters", __FUNCTION__);
6328 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006329 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006330 }
6331
6332 /*-----------------------------------------------------------------------
6333 Get message buffer
6334 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006335 usLen = sizeof(halStartReq.startReqParams) +
Jeff Johnson295189b2012-06-20 16:38:30 -07006336 pwdiStartParams->usConfigBufferLen;
6337
Jeff Johnsone7245742012-09-05 17:12:55 -07006338 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006339 usLen,
6340 &pSendBuffer, &usDataOffset, &usSendSize))||
6341 ( usSendSize < (usDataOffset + usLen )))
6342 {
6343 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
6344 "Unable to get send buffer in start req %x %x %x",
6345 pEventData, pwdiStartParams, wdiStartRspCb);
6346 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006347 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006348 }
6349
6350 /*-----------------------------------------------------------------------
6351 Fill in the message
6352 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006353 halStartReq.startReqParams.driverType =
6354 WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType);
Jeff Johnson295189b2012-06-20 16:38:30 -07006355
Jeff Johnsone7245742012-09-05 17:12:55 -07006356 halStartReq.startReqParams.uConfigBufferLen =
6357 pwdiStartParams->usConfigBufferLen;
6358 wpalMemoryCopy( pSendBuffer+usDataOffset,
6359 &halStartReq.startReqParams,
6360 sizeof(halStartReq.startReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006361
Jeff Johnsone7245742012-09-05 17:12:55 -07006362 usDataOffset += sizeof(halStartReq.startReqParams);
6363 wpalMemoryCopy( pSendBuffer+usDataOffset,
6364 pwdiStartParams->pConfigBuffer,
6365 pwdiStartParams->usConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -07006366
6367 pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006368 pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006369
6370 /*Save Low Level Ind CB and associated user data - it will be used further
6371 on when an indication is coming from the lower MAC*/
6372 pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006373 pWDICtx->pIndUserData = pwdiStartParams->pIndUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006374
Jeff Johnsone7245742012-09-05 17:12:55 -07006375 pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -07006376 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006377 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006378 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006379 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006380 wdiStartRspCb, pEventData->pUserData, WDI_START_RESP);
6381
Jeff Johnsone7245742012-09-05 17:12:55 -07006382
Jeff Johnson295189b2012-06-20 16:38:30 -07006383}/*WDI_ProcessStartReq*/
6384
6385/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006386 @brief Process Stop Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006387 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006388
6389 @param pWDICtx: pointer to the WLAN DAL context
6390 pEventData: pointer to the event information structure
6391
Jeff Johnson295189b2012-06-20 16:38:30 -07006392 @see
6393 @return Result of the function call
6394*/
6395WDI_Status
6396WDI_ProcessStopReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006397(
Jeff Johnson295189b2012-06-20 16:38:30 -07006398 WDI_ControlBlockType* pWDICtx,
6399 WDI_EventInfoType* pEventData
6400)
6401{
6402 WDI_StopReqParamsType* pwdiStopParams = NULL;
6403 WDI_StopRspCb wdiStopRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006404 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006405 wpt_uint16 usDataOffset = 0;
6406 wpt_uint16 usSendSize = 0;
Jeff Johnson43971f52012-07-17 12:26:56 -07006407 wpt_status status;
Jeff Johnsone7245742012-09-05 17:12:55 -07006408 tHalMacStopReqMsg halStopReq;
Jeff Johnson295189b2012-06-20 16:38:30 -07006409 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6410
6411 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006412 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006413 -------------------------------------------------------------------------*/
6414 if (( NULL == pEventData ) ||
6415 ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) ||
6416 ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc)))
6417 {
6418 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6419 "%s: Invalid parameters", __FUNCTION__);
6420 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006421 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006422 }
6423
6424 /*-----------------------------------------------------------------------
6425 Get message buffer
6426 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006427 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006428 sizeof(halStopReq.stopReqParams),
6429 &pSendBuffer, &usDataOffset, &usSendSize))||
6430 ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) )))
6431 {
6432 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6433 "Unable to get send buffer in stop req %x %x %x",
6434 pEventData, pwdiStopParams, wdiStopRspCb);
6435 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006436 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006437 }
6438
6439 /*-----------------------------------------------------------------------
6440 Fill in the message
6441 -----------------------------------------------------------------------*/
6442 halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON(
6443 pwdiStopParams->wdiStopReason);
6444
Jeff Johnsone7245742012-09-05 17:12:55 -07006445 wpalMemoryCopy( pSendBuffer+usDataOffset,
6446 &halStopReq.stopReqParams,
6447 sizeof(halStopReq.stopReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006448
6449 pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006450 pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006451
6452 /*! TO DO: stop the data services */
6453 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6454 {
6455 /*Stop the STA Table !UT- check this logic again
6456 It is safer to do it here than on the response - because a stop is imminent*/
6457 WDI_STATableStop(pWDICtx);
6458
6459 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -07006460 status = wpalEventReset(&pWDICtx->setPowerStateEvent);
6461 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006462 {
6463 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6464 "WDI Init failed to reset power state event");
6465
Jeff Johnsone7245742012-09-05 17:12:55 -07006466 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07006467 return VOS_STATUS_E_FAILURE;
6468 }
6469 /* Stop Transport Driver, DXE */
6470 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb);
6471 /*
Jeff Johnsone7245742012-09-05 17:12:55 -07006472 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -07006473 */
Jeff Johnson43971f52012-07-17 12:26:56 -07006474 status = wpalEventWait(&pWDICtx->setPowerStateEvent,
6475 WDI_SET_POWER_STATE_TIMEOUT);
6476 if (eWLAN_PAL_STATUS_SUCCESS != status)
Jeff Johnson295189b2012-06-20 16:38:30 -07006477 {
6478 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6479 "WDI Init failed to wait on an event");
6480
Jeff Johnsone7245742012-09-05 17:12:55 -07006481 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -07006482 return VOS_STATUS_E_FAILURE;
6483 }
6484 }
6485
6486 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006487 Send Stop Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006488 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006489 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006490 wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP);
6491
6492}/*WDI_ProcessStopReq*/
6493
6494/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006495 @brief Process Close Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006496 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006497
6498 @param pWDICtx: pointer to the WLAN DAL context
6499 pEventData: pointer to the event information structure
6500
Jeff Johnson295189b2012-06-20 16:38:30 -07006501 @see
6502 @return Result of the function call
6503*/
6504WDI_Status
6505WDI_ProcessCloseReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006506(
Jeff Johnson295189b2012-06-20 16:38:30 -07006507 WDI_ControlBlockType* pWDICtx,
6508 WDI_EventInfoType* pEventData
6509)
6510{
Jeff Johnsone7245742012-09-05 17:12:55 -07006511 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07006512 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6513
6514 /*Lock control block for cleanup*/
6515 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006516
Jeff Johnson295189b2012-06-20 16:38:30 -07006517 /*Clear all pending request*/
6518 WDI_ClearPendingRequests(pWDICtx);
6519
6520 /* Close Control transport*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006521 WCTS_CloseTransport(pWDICtx->wctsHandle);
Jeff Johnson295189b2012-06-20 16:38:30 -07006522
6523 /* Close Data transport*/
6524 /* FTM mode does not open Data Path */
6525 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
6526 {
6527 WDTS_Close(pWDICtx);
6528 }
6529
6530 /*Close the STA Table !UT- check this logic again*/
6531 WDI_STATableClose(pWDICtx);
6532
6533 /*close the PAL */
6534 wptStatus = wpalClose(pWDICtx->pPALContext);
6535 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
6536 {
6537 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6538 "Failed to wpal Close %d", wptStatus);
6539 WDI_ASSERT(0);
6540 }
6541
6542 /*Transition back to init state*/
6543 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
6544
6545 wpalMutexRelease(&pWDICtx->wptMutex);
6546
6547 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006548 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006549
Jeff Johnsone7245742012-09-05 17:12:55 -07006550 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07006551}/*WDI_ProcessCloseReq*/
6552
6553
6554/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07006555 SCANING REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07006556===========================================================================*/
6557
6558/**
6559 @brief Process Init Scan Request function (called when Main FSM
6560 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006561
6562 @param pWDICtx: pointer to the WLAN DAL context
6563 pEventData: pointer to the event information structure
6564
Jeff Johnson295189b2012-06-20 16:38:30 -07006565 @see
6566 @return Result of the function call
6567*/
6568WDI_Status
6569WDI_ProcessInitScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006570(
Jeff Johnson295189b2012-06-20 16:38:30 -07006571 WDI_ControlBlockType* pWDICtx,
6572 WDI_EventInfoType* pEventData
6573)
6574{
6575 WDI_InitScanReqParamsType* pwdiInitScanParams = NULL;
6576 WDI_InitScanRspCb wdiInitScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006577 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006578 wpt_uint16 usDataOffset = 0;
6579 wpt_uint16 usSendSize = 0;
6580 wpt_uint8 i = 0;
6581
6582 tHalInitScanReqMsg halInitScanReqMsg;
6583
Jeff Johnsone7245742012-09-05 17:12:55 -07006584 /*This is temporary fix.
Jeff Johnson295189b2012-06-20 16:38:30 -07006585 * It shold be removed once host and riva changes are in sync*/
6586 tHalInitScanConReqMsg halInitScanConReqMsg;
6587
6588 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6589
6590 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006591 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006592 -------------------------------------------------------------------------*/
6593 if (( NULL == pEventData ) ||
6594 ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) ||
6595 ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc)))
6596 {
6597 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6598 "%s: Invalid parameters", __FUNCTION__);
6599 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006600 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006601 }
6602
6603#if 0
6604 wpalMutexAcquire(&pWDICtx->wptMutex);
6605 /*-----------------------------------------------------------------------
6606 Check to see if SCAN is already in progress - if so reject the req
6607 We only allow one scan at a time
Jeff Johnsone7245742012-09-05 17:12:55 -07006608 ! TO DO: - revisit this constraint
Jeff Johnson295189b2012-06-20 16:38:30 -07006609 -----------------------------------------------------------------------*/
6610 if ( pWDICtx->bScanInProgress )
6611 {
6612 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6613 "Scan is already in progress - subsequent scan is not allowed"
6614 " until the first scan completes");
6615
6616 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006617 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006618 }
6619
Jeff Johnsone7245742012-09-05 17:12:55 -07006620 pWDICtx->bScanInProgress = eWLAN_PAL_TRUE;
6621 pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006622
6623 wpalMutexRelease(&pWDICtx->wptMutex);
6624#endif
6625
6626 if (pwdiInitScanParams->wdiReqInfo.bUseNOA)
6627 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006628 /*This is temporary fix.
Jeff Johnson295189b2012-06-20 16:38:30 -07006629 * It shold be removed once host and riva changes are in sync*/
6630 /*-----------------------------------------------------------------------
6631 Get message buffer
6632 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006633 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006634 sizeof(halInitScanConReqMsg.initScanParams),
6635 &pSendBuffer, &usDataOffset, &usSendSize))||
6636 ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) )))
6637 {
6638 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6639 "Unable to get send buffer in init scan req %x %x %x",
6640 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6641 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006642 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006643 }
6644
6645
6646 /*-----------------------------------------------------------------------
6647 Fill in the message
6648 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006649 halInitScanConReqMsg.initScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07006650 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6651
6652 wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid,
6653 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6654
Jeff Johnsone7245742012-09-05 17:12:55 -07006655 halInitScanConReqMsg.initScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07006656 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
Jeff Johnsone7245742012-09-05 17:12:55 -07006657 halInitScanConReqMsg.initScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07006658 pwdiInitScanParams->wdiReqInfo.ucFrameType;
Jeff Johnsone7245742012-09-05 17:12:55 -07006659 halInitScanConReqMsg.initScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07006660 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6661
6662 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr,
6663 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6664
6665#ifdef WLAN_FEATURE_P2P
6666 halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA;
6667 halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration;
6668#endif
6669
Jeff Johnsone7245742012-09-05 17:12:55 -07006670 halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07006671 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6672
6673 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6674 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006675 halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07006676 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6677 }
6678
Jeff Johnsone7245742012-09-05 17:12:55 -07006679 wpalMemoryCopy( pSendBuffer+usDataOffset,
6680 &halInitScanConReqMsg.initScanParams,
6681 sizeof(halInitScanConReqMsg.initScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006682 }
6683 else
6684 {
6685 /*-----------------------------------------------------------------------
6686 Get message buffer
6687 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006688 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006689 sizeof(halInitScanReqMsg.initScanParams),
6690 &pSendBuffer, &usDataOffset, &usSendSize))||
6691 ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) )))
6692 {
6693 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6694 "Unable to get send buffer in init scan req %x %x %x",
6695 pEventData, pwdiInitScanParams, wdiInitScanRspCb);
6696 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006697 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006698 }
6699
6700
6701 /*-----------------------------------------------------------------------
6702 Fill in the message
6703 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006704 halInitScanReqMsg.initScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07006705 WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode);
6706
6707 wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid,
6708 pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
6709
Jeff Johnsone7245742012-09-05 17:12:55 -07006710 halInitScanReqMsg.initScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07006711 pwdiInitScanParams->wdiReqInfo.bNotifyBSS;
Jeff Johnsone7245742012-09-05 17:12:55 -07006712 halInitScanReqMsg.initScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07006713 pwdiInitScanParams->wdiReqInfo.ucFrameType;
Jeff Johnsone7245742012-09-05 17:12:55 -07006714 halInitScanReqMsg.initScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07006715 pwdiInitScanParams->wdiReqInfo.ucFrameLength;
6716
6717 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr,
6718 &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr);
6719
Jeff Johnsone7245742012-09-05 17:12:55 -07006720 halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07006721 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt;
6722
6723 for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
6724 {
Jeff Johnsone7245742012-09-05 17:12:55 -07006725 halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07006726 pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i];
6727 }
6728
Jeff Johnsone7245742012-09-05 17:12:55 -07006729 wpalMemoryCopy( pSendBuffer+usDataOffset,
6730 &halInitScanReqMsg.initScanParams,
6731 sizeof(halInitScanReqMsg.initScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006732 }
6733
6734 pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006735 pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006736
6737 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006738 Send Init Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006739 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006740 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006741 wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP);
6742
6743}/*WDI_ProcessInitScanReq*/
6744
6745/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006746 @brief Process Start Scan Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07006747 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006748
6749 @param pWDICtx: pointer to the WLAN DAL context
6750 pEventData: pointer to the event information structure
6751
Jeff Johnson295189b2012-06-20 16:38:30 -07006752 @see
6753 @return Result of the function call
6754*/
6755WDI_Status
6756WDI_ProcessStartScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006757(
Jeff Johnson295189b2012-06-20 16:38:30 -07006758 WDI_ControlBlockType* pWDICtx,
6759 WDI_EventInfoType* pEventData
6760)
6761{
6762 WDI_StartScanReqParamsType* pwdiStartScanParams = NULL;
6763 WDI_StartScanRspCb wdiStartScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006764 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006765 wpt_uint16 usDataOffset = 0;
6766 wpt_uint16 usSendSize = 0;
6767
Jeff Johnsone7245742012-09-05 17:12:55 -07006768 tHalStartScanReqMsg halStartScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006769 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6770
6771 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006772 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006773 -------------------------------------------------------------------------*/
6774 if (( NULL == pEventData ) ||
6775 ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) ||
6776 ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc)))
6777 {
6778 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6779 "%s: Invalid parameters", __FUNCTION__);
6780 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006781 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006782 }
6783
6784#if 0
6785 wpalMutexAcquire(&pWDICtx->wptMutex);
6786 /*-----------------------------------------------------------------------
6787 Check to see if SCAN is already in progress - start scan is only
6788 allowed when a scan is ongoing and the state of the scan procedure
Jeff Johnsone7245742012-09-05 17:12:55 -07006789 is either init or end
Jeff Johnson295189b2012-06-20 16:38:30 -07006790 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006791 if (( !pWDICtx->bScanInProgress ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07006792 (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) &&
6793 ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState )))
6794 {
6795 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
6796 "Scan start not allowed in this state %d %d",
6797 pWDICtx->bScanInProgress, pWDICtx->uScanState);
Jeff Johnsone7245742012-09-05 17:12:55 -07006798
Jeff Johnson295189b2012-06-20 16:38:30 -07006799 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006800 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006801 }
6802
Jeff Johnsone7245742012-09-05 17:12:55 -07006803 pWDICtx->uScanState = WDI_SCAN_STARTED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006804
6805 wpalMutexRelease(&pWDICtx->wptMutex);
6806#endif
6807
6808 /*-----------------------------------------------------------------------
6809 Get message buffer
6810 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006811 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006812 sizeof(halStartScanReqMsg.startScanParams),
6813 &pSendBuffer, &usDataOffset, &usSendSize))||
6814 ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) )))
6815 {
6816 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6817 "Unable to get send buffer in start scan req %x %x %x",
6818 pEventData, pwdiStartScanParams, wdiStartScanRspCb);
6819 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006820 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006821 }
6822
Jeff Johnsone7245742012-09-05 17:12:55 -07006823 halStartScanReqMsg.startScanParams.scanChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07006824 pwdiStartScanParams->ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -07006825 wpalMemoryCopy( pSendBuffer+usDataOffset,
6826 &halStartScanReqMsg.startScanParams,
6827 sizeof(halStartScanReqMsg.startScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006828
6829 pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006830 pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006831
6832 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006833 Send Start Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006834 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006835 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006836 wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP);
6837}/*WDI_ProcessStartScanReq*/
6838
6839
6840/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006841 @brief Process End Scan Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07006842 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006843
6844 @param pWDICtx: pointer to the WLAN DAL context
6845 pEventData: pointer to the event information structure
6846
Jeff Johnson295189b2012-06-20 16:38:30 -07006847 @see
6848 @return Result of the function call
6849*/
6850WDI_Status
6851WDI_ProcessEndScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006852(
Jeff Johnson295189b2012-06-20 16:38:30 -07006853 WDI_ControlBlockType* pWDICtx,
6854 WDI_EventInfoType* pEventData
6855)
6856{
6857 WDI_EndScanReqParamsType* pwdiEndScanParams = NULL;
6858 WDI_EndScanRspCb wdiEndScanRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07006859 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006860 wpt_uint16 usDataOffset = 0;
6861 wpt_uint16 usSendSize = 0;
6862
Jeff Johnsone7245742012-09-05 17:12:55 -07006863 tHalEndScanReqMsg halEndScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006864 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6865
6866 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006867 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006868 -------------------------------------------------------------------------*/
6869 if (( NULL == pEventData ) ||
6870 ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) ||
6871 ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc)))
6872 {
6873 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6874 "%s: Invalid parameters", __FUNCTION__);
6875 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006876 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006877 }
6878
Jeff Johnsone7245742012-09-05 17:12:55 -07006879 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6880 * sometimes because of this check the scan request is not being
Jeff Johnson295189b2012-06-20 16:38:30 -07006881 * forwarded to HAL and result in hang*/
6882#if 0
6883 wpalMutexAcquire(&pWDICtx->wptMutex);
6884 /*-----------------------------------------------------------------------
6885 Check to see if SCAN is already in progress - end scan is only
6886 allowed when a scan is ongoing and the state of the scan procedure
6887 is started
6888 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006889 if (( !pWDICtx->bScanInProgress ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07006890 ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState ))
6891 {
6892 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6893 "End start not allowed in this state %d %d",
6894 pWDICtx->bScanInProgress, pWDICtx->uScanState);
Jeff Johnsone7245742012-09-05 17:12:55 -07006895
Jeff Johnson295189b2012-06-20 16:38:30 -07006896 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006897 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006898 }
6899
Jeff Johnsone7245742012-09-05 17:12:55 -07006900 pWDICtx->uScanState = WDI_SCAN_ENDED_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07006901
6902 wpalMutexRelease(&pWDICtx->wptMutex);
6903#endif
6904
6905 /*-----------------------------------------------------------------------
6906 Get message buffer
6907 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006908 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07006909 sizeof(halEndScanReqMsg.endScanParams),
6910 &pSendBuffer, &usDataOffset, &usSendSize))||
6911 ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) )))
6912 {
6913 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6914 "Unable to get send buffer in start scan req %x %x %x",
6915 pEventData, pwdiEndScanParams, wdiEndScanRspCb);
6916 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006917 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006918 }
6919
6920 halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel;
6921
Jeff Johnsone7245742012-09-05 17:12:55 -07006922 wpalMemoryCopy( pSendBuffer+usDataOffset,
6923 &halEndScanReqMsg.endScanParams,
6924 sizeof(halEndScanReqMsg.endScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07006925
6926 pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07006927 pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07006928
6929 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006930 Send End Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07006931 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07006932 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07006933 wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP);
6934}/*WDI_ProcessEndScanReq*/
6935
6936
6937/**
Jeff Johnsone7245742012-09-05 17:12:55 -07006938 @brief Process Finish Scan Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07006939 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07006940
6941 @param pWDICtx: pointer to the WLAN DAL context
6942 pEventData: pointer to the event information structure
6943
Jeff Johnson295189b2012-06-20 16:38:30 -07006944 @see
6945 @return Result of the function call
6946*/
6947WDI_Status
6948WDI_ProcessFinishScanReq
Jeff Johnsone7245742012-09-05 17:12:55 -07006949(
Jeff Johnson295189b2012-06-20 16:38:30 -07006950 WDI_ControlBlockType* pWDICtx,
6951 WDI_EventInfoType* pEventData
6952)
6953{
6954 WDI_FinishScanReqParamsType* pwdiFinishScanParams;
6955 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07006956 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07006957 wpt_uint16 usDataOffset = 0;
6958 wpt_uint16 usSendSize = 0;
6959 wpt_uint8 i = 0;
6960
Jeff Johnsone7245742012-09-05 17:12:55 -07006961 tHalFinishScanReqMsg halFinishScanReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07006962 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
6963
6964 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07006965 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07006966 -------------------------------------------------------------------------*/
6967 if (( NULL == pEventData ) ||
6968 ( NULL == pEventData->pEventData) ||
6969 ( NULL == pEventData->pCBfnc))
6970 {
6971 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6972 "%s: Invalid parameters", __FUNCTION__);
6973 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07006974 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07006975 }
6976
6977 pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData;
6978 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -07006979 /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN
6980 * sometimes because of this check the scan request is not being
Jeff Johnson295189b2012-06-20 16:38:30 -07006981 * forwarded to HAL and result in hang*/
6982#if 0
6983 wpalMutexAcquire(&pWDICtx->wptMutex);
6984 /*-----------------------------------------------------------------------
6985 Check to see if SCAN is already in progress
6986 Finish scan gets invoked any scan states. ie. abort scan
6987 It should be allowed in any states.
6988 -----------------------------------------------------------------------*/
6989 if ( !pWDICtx->bScanInProgress )
6990 {
6991 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
6992 "Finish start not allowed in this state %d",
6993 pWDICtx->bScanInProgress );
6994
6995 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07006996 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07006997 }
6998
6999 /*-----------------------------------------------------------------------
7000 It is safe to reset the scan flags here because until the response comes
Jeff Johnsone7245742012-09-05 17:12:55 -07007001 back all subsequent requests will be blocked at BUSY state
Jeff Johnson295189b2012-06-20 16:38:30 -07007002 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007003 pWDICtx->uScanState = WDI_SCAN_FINISHED_ST;
7004 pWDICtx->bScanInProgress = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007005 wpalMutexRelease(&pWDICtx->wptMutex);
7006#endif
7007
7008 if ( pWDICtx->bInBmps )
7009 {
7010 // notify DTS that we are entering BMPS
7011 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL);
7012 }
7013
7014 /*-----------------------------------------------------------------------
7015 Get message buffer
7016 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007017 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007018 sizeof(halFinishScanReqMsg.finishScanParams),
7019 &pSendBuffer, &usDataOffset, &usSendSize))||
7020 ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) )))
7021 {
7022 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7023 "Unable to get send buffer in start scan req %x %x %x",
7024 pEventData, pwdiFinishScanParams, wdiFinishScanRspCb);
7025 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007026 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007027 }
7028
Jeff Johnsone7245742012-09-05 17:12:55 -07007029 halFinishScanReqMsg.finishScanParams.scanMode =
Jeff Johnson295189b2012-06-20 16:38:30 -07007030 WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode);
7031
Jeff Johnsone7245742012-09-05 17:12:55 -07007032 halFinishScanReqMsg.finishScanParams.currentOperChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07007033 pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel;
7034
Jeff Johnsone7245742012-09-05 17:12:55 -07007035 halFinishScanReqMsg.finishScanParams.cbState =
Jeff Johnson295189b2012-06-20 16:38:30 -07007036 WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState);
7037
7038 wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid,
7039 pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
7040
Jeff Johnsone7245742012-09-05 17:12:55 -07007041 halFinishScanReqMsg.finishScanParams.notifyBss =
Jeff Johnson295189b2012-06-20 16:38:30 -07007042 pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ;
Jeff Johnsone7245742012-09-05 17:12:55 -07007043 halFinishScanReqMsg.finishScanParams.frameType =
Jeff Johnson295189b2012-06-20 16:38:30 -07007044 pwdiFinishScanParams->wdiReqInfo.ucFrameType ;
Jeff Johnsone7245742012-09-05 17:12:55 -07007045 halFinishScanReqMsg.finishScanParams.frameLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07007046 pwdiFinishScanParams->wdiReqInfo.ucFrameLength ;
7047
Jeff Johnsone7245742012-09-05 17:12:55 -07007048 halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt =
Jeff Johnson295189b2012-06-20 16:38:30 -07007049 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ;
7050
7051 for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++)
7052 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007053 halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -07007054 pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ;
7055 }
7056
7057 WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr,
7058 &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr);
7059
Jeff Johnsone7245742012-09-05 17:12:55 -07007060 wpalMemoryCopy( pSendBuffer+usDataOffset,
7061 &halFinishScanReqMsg.finishScanParams,
7062 sizeof(halFinishScanReqMsg.finishScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007063
7064 pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007065 pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007066
7067 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007068 Send Finish Scan Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007069 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007070 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007071 wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP);
7072}/*WDI_ProcessFinishScanReq*/
7073
7074
7075/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007076 ASSOCIATION REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07007077==========================================================================*/
7078/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007079 @brief Process BSS Join for a given Session
7080
7081 @param pWDICtx: pointer to the WLAN DAL context
7082 pEventData: pointer to the event information structure
7083
Jeff Johnson295189b2012-06-20 16:38:30 -07007084 @see
7085 @return Result of the function call
7086*/
7087WDI_Status
7088WDI_ProcessBSSSessionJoinReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007089(
Jeff Johnson295189b2012-06-20 16:38:30 -07007090 WDI_ControlBlockType* pWDICtx,
7091 WDI_JoinReqParamsType* pwdiJoinParams,
7092 WDI_JoinRspCb wdiJoinRspCb,
7093 void* pUserData
7094)
7095{
7096 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007097 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007098 wpt_uint16 usDataOffset = 0;
7099 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007100 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007101
Jeff Johnsone7245742012-09-05 17:12:55 -07007102 tHalJoinReqMsg halJoinReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007103 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7104
7105 /*------------------------------------------------------------------------
7106 Check to see if we have any session with this BSSID already stored, we
7107 should not
7108 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007109 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7110 pwdiJoinParams->wdiReqInfo.macBSSID,
7111 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007112
7113 if ( NULL != pBSSSes )
7114 {
7115 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7116 "Association for this BSSID is already in place");
7117
Jeff Johnsone7245742012-09-05 17:12:55 -07007118 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007119 }
7120
7121 wpalMutexAcquire(&pWDICtx->wptMutex);
7122 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007123 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007124 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007125 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007126 if ( NULL == pBSSSes )
7127 {
7128
7129 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7130 "DAL has no free sessions - cannot run another join");
7131
7132 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007133 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007134 }
7135
7136 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007137 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7138 wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007139 WDI_MAC_ADDR_LEN);
7140
7141 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007142 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007143 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -07007144
Jeff Johnson295189b2012-06-20 16:38:30 -07007145 wpalMutexRelease(&pWDICtx->wptMutex);
7146
7147 /*-----------------------------------------------------------------------
7148 Get message buffer
7149 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007150 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007151 sizeof(halJoinReqMsg.joinReqParams),
7152 &pSendBuffer, &usDataOffset, &usSendSize))||
7153 ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) )))
7154 {
7155 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7156 "Unable to get send buffer in join req %x %x %x",
7157 pUserData, pwdiJoinParams, wdiJoinRspCb);
7158 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007159 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007160 }
7161
7162 wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -07007163 pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07007164
7165 wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr,
Jeff Johnsone7245742012-09-05 17:12:55 -07007166 pwdiJoinParams->wdiReqInfo.macSTASelf,
7167 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -07007168
Jeff Johnsone7245742012-09-05 17:12:55 -07007169 halJoinReqMsg.joinReqParams.ucChannel =
Jeff Johnson295189b2012-06-20 16:38:30 -07007170 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel;
7171
7172 halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState;
7173
7174#ifndef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -07007175 halJoinReqMsg.joinReqParams.ucLocalPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -07007176 pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint;
7177#endif
7178
Jeff Johnsone7245742012-09-05 17:12:55 -07007179 halJoinReqMsg.joinReqParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -07007180 WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo.
7181 wdiSecondaryChannelOffset);
7182
Jeff Johnsone7245742012-09-05 17:12:55 -07007183 wpalMemoryCopy( pSendBuffer+usDataOffset,
7184 &halJoinReqMsg.joinReqParams,
7185 sizeof(halJoinReqMsg.joinReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007186
7187 pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007188 pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007189
7190 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007191 Send Join Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007192 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007193 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7194 wdiJoinRspCb, pUserData, WDI_JOIN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07007195
7196}/*WDI_ProcessBSSSessionJoinReq*/
7197
7198/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007199 @brief Process Join Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007200 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007201
7202 @param pWDICtx: pointer to the WLAN DAL context
7203 pEventData: pointer to the event information structure
7204
Jeff Johnson295189b2012-06-20 16:38:30 -07007205 @see
7206 @return Result of the function call
7207*/
7208WDI_Status
7209WDI_ProcessJoinReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007210(
Jeff Johnson295189b2012-06-20 16:38:30 -07007211 WDI_ControlBlockType* pWDICtx,
7212 WDI_EventInfoType* pEventData
7213)
7214{
7215 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7216 WDI_JoinReqParamsType* pwdiJoinParams = NULL;
7217 WDI_JoinRspCb wdiJoinRspCb = NULL;
7218 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7219
7220 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007221 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007222 -------------------------------------------------------------------------*/
7223 if (( NULL == pEventData ) ||
7224 ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) ||
7225 ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc)))
7226 {
7227 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7228 "%s: Invalid parameters", __FUNCTION__);
7229 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007230 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007231 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007232
Jeff Johnson295189b2012-06-20 16:38:30 -07007233 /*-------------------------------------------------------------------------
7234 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007235 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007236 -------------------------------------------------------------------------*/
7237 wpalMutexAcquire(&pWDICtx->wptMutex);
7238
7239 if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress )
7240 {
7241 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7242 "Association is currently in progress, queueing new join req");
7243
7244 /*Association is in progress - queue current one*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007245 wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007246 pwdiJoinParams->wdiReqInfo.macBSSID);
7247
7248 wpalMutexRelease(&pWDICtx->wptMutex);
7249
Jeff Johnsone7245742012-09-05 17:12:55 -07007250 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007251 }
7252
7253 /*Starting a new association */
7254 pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE;
7255 wpalMutexRelease(&pWDICtx->wptMutex);
7256
7257 /*Process the Join Request*/
7258 return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams,
7259 wdiJoinRspCb,pEventData->pUserData);
7260
7261}/*WDI_ProcessJoinReq*/
7262
7263
7264/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007265 @brief Process Config BSS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007266 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007267
7268 @param pWDICtx: pointer to the WLAN DAL context
7269 pEventData: pointer to the event information structure
7270
Jeff Johnson295189b2012-06-20 16:38:30 -07007271 @see
7272 @return Result of the function call
7273*/
7274WDI_Status
7275WDI_ProcessConfigBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007276(
Jeff Johnson295189b2012-06-20 16:38:30 -07007277 WDI_ControlBlockType* pWDICtx,
7278 WDI_EventInfoType* pEventData
7279)
7280{
7281 WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams;
7282 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007283 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007284 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007285 wpt_uint16 uMsgSize = 0;
7286 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007287 wpt_uint16 usDataOffset = 0;
7288 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007289 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007290
Jeff Johnsone7245742012-09-05 17:12:55 -07007291 tConfigBssReqMsg halConfigBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007292 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7293
7294 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007295 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007296 -------------------------------------------------------------------------*/
7297 if (( NULL == pEventData ) ||
7298 ( NULL == pEventData->pEventData ) ||
7299 ( NULL == pEventData->pCBfnc ))
7300 {
7301 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7302 "%s: Invalid parameters", __FUNCTION__);
7303 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007304 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007305 }
7306
7307 pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData;
7308 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc;
7309 /*-------------------------------------------------------------------------
7310 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007311 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007312 -------------------------------------------------------------------------*/
7313 wpalMutexAcquire(&pWDICtx->wptMutex);
7314
7315 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007316 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007317 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007318 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7319 pwdiConfigBSSParams->wdiReqInfo.macBSSID,
7320 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007321
Jeff Johnsone7245742012-09-05 17:12:55 -07007322 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007323 {
7324#ifdef WLAN_FEATURE_VOWIFI_11R
7325 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007326 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007327 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007328 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007329 if ( NULL == pBSSSes )
7330 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007331
Jeff Johnson295189b2012-06-20 16:38:30 -07007332 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7333 "DAL has no free sessions - cannot run another join");
Jeff Johnsone7245742012-09-05 17:12:55 -07007334
Jeff Johnson295189b2012-06-20 16:38:30 -07007335 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007336 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007337 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007338
Jeff Johnson295189b2012-06-20 16:38:30 -07007339 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007340 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7341 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007342 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07007343
Jeff Johnson295189b2012-06-20 16:38:30 -07007344 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007345 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007346 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7347#else
Jeff Johnsone7245742012-09-05 17:12:55 -07007348 /* If the BSS type is IBSS create the session here as there is no Join
Jeff Johnson295189b2012-06-20 16:38:30 -07007349 * Request in case of IBSS*/
7350 if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) ||
7351 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) ||
7352 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) ||
7353 (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE))
7354 {
7355 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007356 Fetch an empty session block
Jeff Johnson295189b2012-06-20 16:38:30 -07007357 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007358 ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007359 if ( NULL == pBSSSes )
7360 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007361
Jeff Johnson295189b2012-06-20 16:38:30 -07007362 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7363 "DAL has no free sessions - cannot run another join");
Jeff Johnsone7245742012-09-05 17:12:55 -07007364
Jeff Johnson295189b2012-06-20 16:38:30 -07007365 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007366 return WDI_STATUS_RES_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007367 }
Jeff Johnsone7245742012-09-05 17:12:55 -07007368
Jeff Johnson295189b2012-06-20 16:38:30 -07007369 /*Save BSS Session Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007370 pBSSSes->bInUse = eWLAN_PAL_TRUE;
7371 wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -07007372 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07007373
Jeff Johnson295189b2012-06-20 16:38:30 -07007374 /*Transition to state Joining*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007375 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -07007376 pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx;
7377 }
7378 else
7379 {
7380 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007381 "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d",
7382 __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID),
7383 pwdiConfigBSSParams->wdiReqInfo.wdiBSSType);
7384
Jeff Johnson295189b2012-06-20 16:38:30 -07007385 /* for IBSS testing */
7386 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007387 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007388 }
7389#endif
7390 }
7391
7392 /*------------------------------------------------------------------------
7393 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007394 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007395 ------------------------------------------------------------------------*/
7396 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7397 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007398 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7399 "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d",
7400 __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID),
7401 ucCurrentBSSSesIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007402
Jeff Johnsone7245742012-09-05 17:12:55 -07007403 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007404
7405 wpalMutexRelease(&pWDICtx->wptMutex);
7406
Jeff Johnsone7245742012-09-05 17:12:55 -07007407 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007408 }
7409
7410 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07007411 wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq,
7412 pwdiConfigBSSParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007413 sizeof(pWDICtx->wdiCachedConfigBssReq));
7414
7415 wpalMutexRelease(&pWDICtx->wptMutex);
7416
Jeff Johnsone7245742012-09-05 17:12:55 -07007417 /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */
7418#ifdef WLAN_FEATURE_11AC
7419 if (WDI_getFwWlanFeatCaps(DOT11AC))
7420 uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC
7421 else
7422#endif
7423 uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure
Jeff Johnson295189b2012-06-20 16:38:30 -07007424
7425 /*-----------------------------------------------------------------------
7426 Get message buffer
7427 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007428 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007429 uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))||
7430 ( usSendSize < (usDataOffset + uMsgSize )))
7431 {
7432 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7433 "Unable to get send buffer in config bss req %x %x %x",
7434 pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb);
7435 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007436 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007437 }
7438
7439 /*Copy the BSS request */
Jeff Johnsone7245742012-09-05 17:12:55 -07007440 WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007441 &pwdiConfigBSSParams->wdiReqInfo);
7442
7443 /* Need to fill in the STA Index to invalid, since at this point we have not
7444 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -07007445 halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -07007446
7447 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007448 halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx;
7449
7450 wpalMemoryCopy( pSendBuffer+usDataOffset,
7451 &halConfigBssReqMsg.uBssParams.configBssParams,
7452 uMsgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07007453
7454 pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007455 pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007456
7457 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007458 Send Config BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007459 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007460 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7461 wdiConfigBSSRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007462 WDI_CONFIG_BSS_RESP);
7463
7464}/*WDI_ProcessConfigBSSReq*/
7465
7466
7467/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007468 @brief Process Del BSS Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007469 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007470
7471 @param pWDICtx: pointer to the WLAN DAL context
7472 pEventData: pointer to the event information structure
7473
Jeff Johnson295189b2012-06-20 16:38:30 -07007474 @see
7475 @return Result of the function call
7476*/
7477WDI_Status
7478WDI_ProcessDelBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007479(
Jeff Johnson295189b2012-06-20 16:38:30 -07007480 WDI_ControlBlockType* pWDICtx,
7481 WDI_EventInfoType* pEventData
7482)
7483{
7484 WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL;
7485 WDI_DelBSSRspCb wdiDelBSSRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007486 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007487 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007488 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007489 wpt_uint16 usDataOffset = 0;
7490 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007491 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007492
Jeff Johnsone7245742012-09-05 17:12:55 -07007493 tDeleteBssReqMsg halBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007494 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7495
7496 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007497 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007498 -------------------------------------------------------------------------*/
7499 if (( NULL == pEventData ) ||
7500 ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) ||
7501 ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc)))
7502 {
7503 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7504 "%s: Invalid parameters", __FUNCTION__);
7505 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007506 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007507 }
7508
7509 /*-------------------------------------------------------------------------
7510 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007511 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007512 -------------------------------------------------------------------------*/
7513 wpalMutexAcquire(&pWDICtx->wptMutex);
7514
7515 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007516 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007517 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007518 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7519 pwdiDelBSSParams->ucBssIdx,
7520 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007521
Jeff Johnsone7245742012-09-05 17:12:55 -07007522 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007523 {
7524 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007525 "%s: BSS does not yet exist. ucBssIdx %d",
7526 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007527
7528 wpalMutexRelease(&pWDICtx->wptMutex);
7529
Jeff Johnsone7245742012-09-05 17:12:55 -07007530 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007531 }
7532
7533 /*------------------------------------------------------------------------
7534 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007535 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007536 ------------------------------------------------------------------------*/
7537 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7538 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007539 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7540 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
7541 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007542
Jeff Johnsone7245742012-09-05 17:12:55 -07007543 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007544
7545 wpalMutexRelease(&pWDICtx->wptMutex);
7546
Jeff Johnsone7245742012-09-05 17:12:55 -07007547 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007548 }
7549
7550 /*-----------------------------------------------------------------------
7551 If we receive a Del BSS request for an association that is already in
7552 progress, it indicates that the assoc has failed => we no longer have
7553 an association in progress => we must check for pending associations
Jeff Johnsone7245742012-09-05 17:12:55 -07007554 that were queued and start as soon as the Del BSS response is received
Jeff Johnson295189b2012-06-20 16:38:30 -07007555 -----------------------------------------------------------------------*/
7556 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
7557 {
7558 /*We can switch to false here because even if a subsequent Join comes in
7559 it will only be processed when DAL transitions out of BUSY state which
7560 happens when the Del BSS request comes */
7561 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
7562
7563 /*Former association is complete - prepare next pending assoc for
7564 processing */
7565 WDI_DequeueAssocRequest(pWDICtx);
7566 }
7567
7568 wpalMutexRelease(&pWDICtx->wptMutex);
7569 /*-----------------------------------------------------------------------
7570 Get message buffer
7571 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007572 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007573 sizeof(halBssReqMsg.deleteBssParams),
7574 &pSendBuffer, &usDataOffset, &usSendSize))||
7575 ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) )))
7576 {
7577 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7578 "Unable to get send buffer in start req %x %x %x",
7579 pEventData, pwdiDelBSSParams, wdiDelBSSRspCb);
7580 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007581 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007582 }
7583
7584 /*Fill in the message request structure*/
7585
7586 /*BSS Index is saved on config BSS response and Post Assoc Response */
Jeff Johnsone7245742012-09-05 17:12:55 -07007587 halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07007588
Jeff Johnsone7245742012-09-05 17:12:55 -07007589 wpalMemoryCopy( pSendBuffer+usDataOffset,
7590 &halBssReqMsg.deleteBssParams,
7591 sizeof(halBssReqMsg.deleteBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007592
7593 pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007594 pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007595
Jeff Johnsone7245742012-09-05 17:12:55 -07007596
Jeff Johnson295189b2012-06-20 16:38:30 -07007597 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007598 Send Del BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007599 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007600 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007601 wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP);
7602
Jeff Johnsone7245742012-09-05 17:12:55 -07007603
Jeff Johnson295189b2012-06-20 16:38:30 -07007604}/*WDI_ProcessDelBSSReq*/
7605
7606/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007607 @brief Process Post Assoc Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007608 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007609
7610 @param pWDICtx: pointer to the WLAN DAL context
7611 pEventData: pointer to the event information structure
7612
Jeff Johnson295189b2012-06-20 16:38:30 -07007613 @see
7614 @return Result of the function call
7615*/
7616WDI_Status
7617WDI_ProcessPostAssocReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007618(
Jeff Johnson295189b2012-06-20 16:38:30 -07007619 WDI_ControlBlockType* pWDICtx,
7620 WDI_EventInfoType* pEventData
7621)
7622{
7623 WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL;
7624 WDI_PostAssocRspCb wdiPostAssocRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007625 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007626 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007627 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007628 wpt_uint16 usDataOffset = 0;
7629 wpt_uint16 usSendSize = 0;
7630 wpt_uint16 uMsgSize = 0;
7631 wpt_uint16 uOffset = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007632 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007633
Jeff Johnsone7245742012-09-05 17:12:55 -07007634 tPostAssocReqMsg halPostAssocReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007635 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7636
7637 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007638 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007639 -------------------------------------------------------------------------*/
7640 if (( NULL == pEventData ) ||
7641 ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) ||
7642 ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc)))
7643 {
7644 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7645 "%s: Invalid parameters", __FUNCTION__);
7646 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007647 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007648 }
7649
7650 /*-------------------------------------------------------------------------
7651 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007652 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007653 -------------------------------------------------------------------------*/
7654 wpalMutexAcquire(&pWDICtx->wptMutex);
7655
7656 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007657 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007658 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007659 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7660 pwdiPostAssocParams->wdiBSSParams.macBSSID,
7661 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007662
7663 if ( NULL == pBSSSes )
7664 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007665 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7666 "%s: Association sequence for this BSS does not yet exist - "
7667 "operation not allowed. macBSSID " MAC_ADDRESS_STR,
7668 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007669
7670 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007671 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007672 }
7673
7674 /*------------------------------------------------------------------------
7675 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007676 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007677 ------------------------------------------------------------------------*/
7678 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7679 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007680 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7681 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7682 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007683
Jeff Johnsone7245742012-09-05 17:12:55 -07007684 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007685
7686 wpalMutexRelease(&pWDICtx->wptMutex);
7687
Jeff Johnsone7245742012-09-05 17:12:55 -07007688 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007689 }
7690
7691 /*-----------------------------------------------------------------------
7692 If Post Assoc was not yet received - the current association must
7693 be in progress
7694 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007695 if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07007696 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
7697 {
7698 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7699 "Association sequence for this BSS association no longer in "
7700 "progress - not allowed");
7701
7702 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007703 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007704 }
7705
7706 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007707 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -07007708 -----------------------------------------------------------------------*/
7709 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
7710 {
7711 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7712 "Post Assoc not allowed before JOIN - failing request");
7713
7714 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007715 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007716 }
7717
7718 wpalMutexRelease(&pWDICtx->wptMutex);
7719
7720 uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) +
7721 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ;
7722 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007723 Fill message for tx over the bus
Jeff Johnson295189b2012-06-20 16:38:30 -07007724 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007725 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007726 uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))||
7727 ( usSendSize < (usDataOffset + uMsgSize )))
7728 {
7729 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7730 "Unable to get send buffer in start req %x %x %x",
7731 pEventData, pwdiPostAssocParams, wdiPostAssocRspCb);
7732 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007733 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007734 }
7735
7736 /*Copy the STA parameters */
7737 WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams,
7738 &pwdiPostAssocParams->wdiSTAParams );
7739
7740 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007741 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007742 WDI_STATableFindStaidByAddr(pWDICtx,
7743 pwdiPostAssocParams->wdiSTAParams.macSTA,
7744 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx ))
7745 {
7746 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7747 "This station does not exist in the WDI Station Table %d");
7748 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007749 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007750 }
7751
7752 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007753 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007754 pBSSSes->ucBSSIdx;
7755
7756 /*Copy the BSS parameters */
7757 WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7758 &pwdiPostAssocParams->wdiBSSParams);
7759
7760 /* Need to fill in the STA index of the peer */
Jeff Johnsone7245742012-09-05 17:12:55 -07007761 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007762 WDI_STATableFindStaidByAddr(pWDICtx,
7763 pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -07007764 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx))
Jeff Johnson295189b2012-06-20 16:38:30 -07007765 {
7766 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7767 "This station does not exist in the WDI Station Table %d");
7768 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007769 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007770 }
7771
7772 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007773 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007774 pBSSSes->ucBSSIdx;
7775
Jeff Johnsone7245742012-09-05 17:12:55 -07007776
7777 wpalMemoryCopy( pSendBuffer+usDataOffset,
7778 &halPostAssocReqMsg.postAssocReqParams.configStaParams,
7779 sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007780
7781 uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams);
7782
Jeff Johnsone7245742012-09-05 17:12:55 -07007783 wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset,
7784 &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7785 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007786
Jeff Johnsone7245742012-09-05 17:12:55 -07007787
Jeff Johnson295189b2012-06-20 16:38:30 -07007788 pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007789 pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007790
Jeff Johnsone7245742012-09-05 17:12:55 -07007791
7792 wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq,
Jeff Johnson295189b2012-06-20 16:38:30 -07007793 pwdiPostAssocParams,
Jeff Johnsone7245742012-09-05 17:12:55 -07007794 sizeof(pWDICtx->wdiCachedPostAssocReq));
Jeff Johnson295189b2012-06-20 16:38:30 -07007795
7796 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007797 Send Post Assoc Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007798 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007799 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007800 wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP);
7801
Jeff Johnsone7245742012-09-05 17:12:55 -07007802
Jeff Johnson295189b2012-06-20 16:38:30 -07007803}/*WDI_ProcessPostAssocReq*/
7804
7805/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007806 @brief Process Del STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007807 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007808
7809 @param pWDICtx: pointer to the WLAN DAL context
7810 pEventData: pointer to the event information structure
7811
Jeff Johnson295189b2012-06-20 16:38:30 -07007812 @see
7813 @return Result of the function call
7814*/
7815WDI_Status
7816WDI_ProcessDelSTAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007817(
Jeff Johnson295189b2012-06-20 16:38:30 -07007818 WDI_ControlBlockType* pWDICtx,
7819 WDI_EventInfoType* pEventData
7820)
7821{
7822 WDI_DelSTAReqParamsType* pwdiDelSTAParams;
7823 WDI_DelSTARspCb wdiDelSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007824 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007825 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007826 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007827 wpt_uint16 usDataOffset = 0;
7828 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007829 wpt_macAddr macBSSID;
Jeff Johnson295189b2012-06-20 16:38:30 -07007830 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7831
Jeff Johnsone7245742012-09-05 17:12:55 -07007832 tDeleteStaReqMsg halDelStaReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007833 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7834
7835 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007836 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007837 -------------------------------------------------------------------------*/
7838 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7839 ( NULL == pEventData->pCBfnc ))
7840 {
7841 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7842 "%s: Invalid parameters", __FUNCTION__);
7843 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007844 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007845 }
7846
7847 pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData;
7848 wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc;
7849 /*-------------------------------------------------------------------------
7850 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007851 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007852 -------------------------------------------------------------------------*/
7853 wpalMutexAcquire(&pWDICtx->wptMutex);
7854
7855 /*------------------------------------------------------------------------
7856 Find the BSS for which the request is made and identify WDI session
7857 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007858 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
7859 pwdiDelSTAParams->ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07007860 &macBSSID))
7861 {
7862 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7863 "This station does not exist in the WDI Station Table %d");
7864 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007865 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007866 }
7867
Jeff Johnsone7245742012-09-05 17:12:55 -07007868 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
7869 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007870 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007871 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7872 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
7873 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007874
7875 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007876 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007877 }
7878
7879 /*------------------------------------------------------------------------
7880 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007881 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007882 ------------------------------------------------------------------------*/
7883 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7884 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007885 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7886 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7887 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007888
Jeff Johnsone7245742012-09-05 17:12:55 -07007889 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007890 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007891 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007892 }
7893
7894 wpalMutexRelease(&pWDICtx->wptMutex);
7895 /*-----------------------------------------------------------------------
7896 Get message buffer
7897 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007898 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007899 sizeof(halDelStaReqMsg.delStaParams),
7900 &pSendBuffer, &usDataOffset, &usSendSize))||
7901 ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) )))
7902 {
7903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7904 "Unable to get send buffer in start req %x %x %x",
7905 pEventData, pwdiDelSTAParams, wdiDelSTARspCb);
7906 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007907 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007908 }
7909
Jeff Johnsone7245742012-09-05 17:12:55 -07007910 halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx;
7911 wpalMemoryCopy( pSendBuffer+usDataOffset,
7912 &halDelStaReqMsg.delStaParams,
7913 sizeof(halDelStaReqMsg.delStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007914
7915 pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007916 pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007917
7918 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007919 Send Del STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007920 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007921 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007922 wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP);
7923
7924}/*WDI_ProcessDelSTAReq*/
7925
7926
7927/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007928 SECURITY REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07007929==========================================================================*/
7930/**
7931 @brief Process Set BSS Key Request function (called when Main FSM
7932 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007933
7934 @param pWDICtx: pointer to the WLAN DAL context
7935 pEventData: pointer to the event information structure
7936
Jeff Johnson295189b2012-06-20 16:38:30 -07007937 @see
7938 @return Result of the function call
7939*/
7940WDI_Status
7941WDI_ProcessSetBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007942(
Jeff Johnson295189b2012-06-20 16:38:30 -07007943 WDI_ControlBlockType* pWDICtx,
7944 WDI_EventInfoType* pEventData
7945)
7946{
7947 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams;
7948 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007949 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007950 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007951 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007952 wpt_uint16 usDataOffset = 0;
7953 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007954 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007955 tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}};
7956 wpt_uint8 keyIndex = 0;
7957
7958 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7959
7960 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007961 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007962 -------------------------------------------------------------------------*/
7963 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7964 ( NULL == pEventData->pCBfnc ))
7965 {
7966 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7967 "%s: Invalid parameters", __FUNCTION__);
7968 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007969 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007970 }
7971
7972 pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData;
7973 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc;
7974 /*-------------------------------------------------------------------------
7975 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007976 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007977 -------------------------------------------------------------------------*/
7978 wpalMutexAcquire(&pWDICtx->wptMutex);
7979
7980 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007981 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007982 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007983 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7984 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx,
7985 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007986
Jeff Johnsone7245742012-09-05 17:12:55 -07007987 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007988 {
7989 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007990 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
7991 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007992
7993 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007994 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007995 }
7996
7997 /*------------------------------------------------------------------------
7998 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007999 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008000 ------------------------------------------------------------------------*/
8001 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8002 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008003 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8004 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8005 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008006
Jeff Johnsone7245742012-09-05 17:12:55 -07008007 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008008 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008009 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008010 }
8011
8012
8013 wpalMutexRelease(&pWDICtx->wptMutex);
8014 /*-----------------------------------------------------------------------
8015 Get message buffer
8016 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008017 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008018 sizeof(halSetBssKeyReqMsg.setBssKeyParams),
8019 &pSendBuffer, &usDataOffset, &usSendSize))||
8020 ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) )))
8021 {
8022 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8023 "Unable to get send buffer in set bss key req %x %x %x",
8024 pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb);
8025 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008026 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008027 }
8028
8029 /*-----------------------------------------------------------------------
8030 Copy the Key parameters into the HAL message
8031 -----------------------------------------------------------------------*/
8032
Jeff Johnsone7245742012-09-05 17:12:55 -07008033 halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008034
Jeff Johnsone7245742012-09-05 17:12:55 -07008035 halSetBssKeyReqMsg.setBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008036 WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType);
8037
Jeff Johnsone7245742012-09-05 17:12:55 -07008038 halSetBssKeyReqMsg.setBssKeyParams.numKeys =
Jeff Johnson295189b2012-06-20 16:38:30 -07008039 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys;
8040
8041 for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ;
8042 keyIndex++)
8043 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008044 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008045 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId;
8046 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast =
8047 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast;
8048 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection =
8049 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection;
8050 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008051 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008052 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008053 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008054 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008055 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008056 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength;
8057 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008058 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008059 WDI_MAX_KEY_LENGTH);
8060 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008061
8062 wpalMemoryCopy( pSendBuffer+usDataOffset,
8063 &halSetBssKeyReqMsg.setBssKeyParams,
8064 sizeof(halSetBssKeyReqMsg.setBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008065
8066 pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008067 pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008068
8069 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008070 Send Set BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008071 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008072 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8073 wdiSetBSSKeyRspCb, pEventData->pUserData,
8074 WDI_SET_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008075
8076}/*WDI_ProcessSetBssKeyReq*/
8077
8078/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008079 @brief Process Remove BSS Key Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07008080 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008081
8082 @param pWDICtx: pointer to the WLAN DAL context
8083 pEventData: pointer to the event information structure
8084
Jeff Johnson295189b2012-06-20 16:38:30 -07008085 @see
8086 @return Result of the function call
8087*/
8088WDI_Status
8089WDI_ProcessRemoveBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008090(
Jeff Johnson295189b2012-06-20 16:38:30 -07008091 WDI_ControlBlockType* pWDICtx,
8092 WDI_EventInfoType* pEventData
8093)
8094{
8095 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams;
8096 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008097 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008098 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008099 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008100 wpt_uint16 usDataOffset = 0;
8101 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008102 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008103 tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}};
8104 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8105
8106 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008107 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008108 -------------------------------------------------------------------------*/
8109 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8110 ( NULL == pEventData->pCBfnc ))
8111 {
8112 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8113 "%s: Invalid parameters", __FUNCTION__);
8114 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008115 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008116 }
8117
8118 pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData;
8119 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc;
8120 /*-------------------------------------------------------------------------
8121 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008122 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008123 -------------------------------------------------------------------------*/
8124 wpalMutexAcquire(&pWDICtx->wptMutex);
8125
8126 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008127 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07008128 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008129 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
8130 pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx,
8131 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07008132
Jeff Johnsone7245742012-09-05 17:12:55 -07008133 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008134 {
8135 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008136 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
8137 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008138
8139 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008140 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008141 }
8142
8143 /*------------------------------------------------------------------------
8144 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008145 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008146 ------------------------------------------------------------------------*/
8147 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8148 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008149 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8150 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8151 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008152
Jeff Johnsone7245742012-09-05 17:12:55 -07008153 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008154 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008155 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008156 }
8157
8158
8159 wpalMutexRelease(&pWDICtx->wptMutex);
8160
8161 /*-----------------------------------------------------------------------
8162 Get message buffer
8163 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008164 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008165 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams),
8166 &pSendBuffer, &usDataOffset, &usSendSize))||
8167 ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) )))
8168 {
8169 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8170 "Unable to get send buffer in set bss key req %x %x %x",
8171 pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb);
8172 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008173 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008174 }
8175 /*-----------------------------------------------------------------------
8176 Copy the Key parameters into the HAL message
8177 -----------------------------------------------------------------------*/
8178 halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
8179
Jeff Johnsone7245742012-09-05 17:12:55 -07008180 halRemoveBssKeyReqMsg.removeBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008181 WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType);
8182
8183 halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId;
8184
Jeff Johnsone7245742012-09-05 17:12:55 -07008185 halRemoveBssKeyReqMsg.removeBssKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008186 WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType);
8187
Jeff Johnsone7245742012-09-05 17:12:55 -07008188 wpalMemoryCopy( pSendBuffer+usDataOffset,
8189 &halRemoveBssKeyReqMsg.removeBssKeyParams,
8190 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008191
8192 pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008193 pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008194
8195 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008196 Send Remove BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008197 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008198 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008199 wdiRemoveBSSKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008200 WDI_RMV_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008201}/*WDI_ProcessRemoveBssKeyReq*/
8202
8203/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008204 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008205 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008206
8207 @param pWDICtx: pointer to the WLAN DAL context
8208 pEventData: pointer to the event information structure
8209
Jeff Johnson295189b2012-06-20 16:38:30 -07008210 @see
8211 @return Result of the function call
8212*/
8213WDI_Status
8214WDI_ProcessSetStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008215(
Jeff Johnson295189b2012-06-20 16:38:30 -07008216 WDI_ControlBlockType* pWDICtx,
8217 WDI_EventInfoType* pEventData
8218)
8219{
8220 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8221 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8222 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008223 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008224 wpt_uint16 usDataOffset = 0;
8225 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008226 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008227 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008228 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008229 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8230 wpt_uint8 keyIndex = 0;
8231
8232 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8233
8234 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008235 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008236 -------------------------------------------------------------------------*/
8237 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8238 ( NULL == pEventData->pCBfnc ))
8239 {
8240 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8241 "%s: Invalid parameters", __FUNCTION__);
8242 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008243 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008244 }
8245
8246 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8247 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8248 /*-------------------------------------------------------------------------
8249 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008250 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008251 -------------------------------------------------------------------------*/
8252 wpalMutexAcquire(&pWDICtx->wptMutex);
8253
8254 /*------------------------------------------------------------------------
8255 Find the BSS for which the request is made and identify WDI session
8256 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008257 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8258 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008259 &macBSSID))
8260 {
8261 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8262 "This station does not exist in the WDI Station Table %d");
8263 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008264 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008265 }
8266
Jeff Johnsone7245742012-09-05 17:12:55 -07008267 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8268 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008269 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008270 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8271 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8272 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008273
8274 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008275 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008276 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008277
Jeff Johnson295189b2012-06-20 16:38:30 -07008278 /*------------------------------------------------------------------------
8279 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008280 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008281 ------------------------------------------------------------------------*/
8282 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8283 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008284 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8285 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8286 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008287
Jeff Johnsone7245742012-09-05 17:12:55 -07008288 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008289 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008290 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008291 }
8292
8293
8294 wpalMutexRelease(&pWDICtx->wptMutex);
8295 /*-----------------------------------------------------------------------
8296 Get message buffer
8297 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008298 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008299 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8300 &pSendBuffer, &usDataOffset, &usSendSize))||
8301 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8302 {
8303 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8304 "Unable to get send buffer in set bss key req %x %x %x",
8305 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8306 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008307 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008308 }
8309 /*-----------------------------------------------------------------------
8310 Copy the STA Key parameters into the HAL message
8311 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008312 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008313 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8314
Jeff Johnsone7245742012-09-05 17:12:55 -07008315 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008316 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8317
8318 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8319
8320 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8321
8322 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8323
8324#ifdef WLAN_SOFTAP_FEATURE
8325 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8326 keyIndex++)
8327 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008328 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008329 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8330 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8331 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8332 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8333 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8334 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008335 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008336 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008337 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008338 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008339 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008340 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8341 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008342 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008343 WDI_MAX_KEY_LENGTH);
8344 }
8345#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008346 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008347 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8348 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8349 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8350 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8351 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8352 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008353 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008354 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008355 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008356 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008357 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008358 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8359 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008360 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008361 WDI_MAX_KEY_LENGTH);
8362#endif
8363
Jeff Johnsone7245742012-09-05 17:12:55 -07008364 wpalMemoryCopy( pSendBuffer+usDataOffset,
8365 &halSetStaKeyReqMsg.setStaKeyParams,
8366 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008367
8368 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008369 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008370
8371 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008372 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008373 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008374 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8375 wdiSetSTAKeyRspCb, pEventData->pUserData,
8376 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008377
8378}/*WDI_ProcessSetSTAKeyReq*/
8379
8380/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008381 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008382 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008383
8384 @param pWDICtx: pointer to the WLAN DAL context
8385 pEventData: pointer to the event information structure
8386
Jeff Johnson295189b2012-06-20 16:38:30 -07008387 @see
8388 @return Result of the function call
8389*/
8390WDI_Status
8391WDI_ProcessRemoveStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008392(
Jeff Johnson295189b2012-06-20 16:38:30 -07008393 WDI_ControlBlockType* pWDICtx,
8394 WDI_EventInfoType* pEventData
8395)
8396{
8397 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams;
8398 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8399 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008400 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008401 wpt_uint16 usDataOffset = 0;
8402 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008403 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008404 wpt_macAddr macBSSID;
8405 wpt_uint8 ucCurrentBSSSesIdx;
8406 tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}};
8407 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8408
8409 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008410 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008411 -------------------------------------------------------------------------*/
8412 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8413 ( NULL == pEventData->pCBfnc ))
8414 {
8415 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8416 "%s: Invalid parameters", __FUNCTION__);
8417 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008418 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008419 }
8420
8421 pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8422 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8423 /*-------------------------------------------------------------------------
8424 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008425 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008426 -------------------------------------------------------------------------*/
8427 wpalMutexAcquire(&pWDICtx->wptMutex);
8428
8429 /*------------------------------------------------------------------------
8430 Find the BSS for which the request is made and identify WDI session
8431 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008432 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8433 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008434 &macBSSID))
8435 {
8436 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8437 "This station does not exist in the WDI Station Table %d");
8438 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008439 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008440 }
8441
Jeff Johnsone7245742012-09-05 17:12:55 -07008442 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8443 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008444 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008445 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8446 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8447 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008448
8449 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008450 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008451 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008452
Jeff Johnson295189b2012-06-20 16:38:30 -07008453 /*------------------------------------------------------------------------
8454 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008455 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008456 ------------------------------------------------------------------------*/
8457 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8458 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008459 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8460 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8461 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008462
Jeff Johnsone7245742012-09-05 17:12:55 -07008463 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008464 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008465 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008466 }
8467
8468
8469
8470 wpalMutexRelease(&pWDICtx->wptMutex);
8471 /*-----------------------------------------------------------------------
8472 Get message buffer
8473 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008474 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008475 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams),
8476 &pSendBuffer, &usDataOffset, &usSendSize))||
8477 ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) )))
8478 {
8479 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8480 "Unable to get send buffer in set bss key req %x %x %x",
8481 pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb);
8482 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008483 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008484 }
8485
8486 /*-----------------------------------------------------------------------
8487 Copy the Key parameters into the HAL message
8488 -----------------------------------------------------------------------*/
8489
Jeff Johnsone7245742012-09-05 17:12:55 -07008490 halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008491 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8492
Jeff Johnsone7245742012-09-05 17:12:55 -07008493 halRemoveStaKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008494 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType);
8495
Jeff Johnsone7245742012-09-05 17:12:55 -07008496 halRemoveStaKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008497 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId;
8498
Jeff Johnsone7245742012-09-05 17:12:55 -07008499 halRemoveStaKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008500 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast;
8501
Jeff Johnsone7245742012-09-05 17:12:55 -07008502 wpalMemoryCopy( pSendBuffer+usDataOffset,
8503 &halRemoveStaKeyReqMsg.removeStaKeyParams,
8504 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008505
8506 pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008507 pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008508
8509 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008510 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008511 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008512 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008513 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008514 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008515
8516}/*WDI_ProcessRemoveSTAKeyReq*/
8517
8518/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008519 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008520 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008521
8522 @param pWDICtx: pointer to the WLAN DAL context
8523 pEventData: pointer to the event information structure
8524
Jeff Johnson295189b2012-06-20 16:38:30 -07008525 @see
8526 @return Result of the function call
8527*/
8528WDI_Status
8529WDI_ProcessSetStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008530(
Jeff Johnson295189b2012-06-20 16:38:30 -07008531 WDI_ControlBlockType* pWDICtx,
8532 WDI_EventInfoType* pEventData
8533)
8534{
8535 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8536 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8537 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008538 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008539 wpt_uint16 usDataOffset = 0;
8540 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008541 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008542 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008543 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008544 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8545 wpt_uint8 keyIndex = 0;
8546
8547 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8548
8549 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008550 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008551 -------------------------------------------------------------------------*/
8552 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8553 ( NULL == pEventData->pCBfnc ))
8554 {
8555 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8556 "%s: Invalid parameters", __FUNCTION__);
8557 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008558 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008559 }
8560
8561 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8562 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8563 /*-------------------------------------------------------------------------
8564 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008565 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008566 -------------------------------------------------------------------------*/
8567 wpalMutexAcquire(&pWDICtx->wptMutex);
8568
8569 /*------------------------------------------------------------------------
8570 Find the BSS for which the request is made and identify WDI session
8571 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008572 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8573 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008574 &macBSSID))
8575 {
8576 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8577 "This station does not exist in the WDI Station Table %d");
8578 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008579 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008580 }
8581
Jeff Johnsone7245742012-09-05 17:12:55 -07008582 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8583 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008584 {
8585 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008586 "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8587 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008588
8589 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008590 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008591 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008592
Jeff Johnson295189b2012-06-20 16:38:30 -07008593 /*------------------------------------------------------------------------
8594 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008595 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008596 ------------------------------------------------------------------------*/
8597 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8598 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008599 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8600 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8601 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008602
Jeff Johnsone7245742012-09-05 17:12:55 -07008603 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008604 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008605 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008606 }
8607
8608
8609 wpalMutexRelease(&pWDICtx->wptMutex);
8610 /*-----------------------------------------------------------------------
8611 Get message buffer
8612 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008613 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008614 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8615 &pSendBuffer, &usDataOffset, &usSendSize))||
8616 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8617 {
8618 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8619 "Unable to get send buffer in set bss key req %x %x %x",
8620 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8621 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008622 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008623 }
8624 /*-----------------------------------------------------------------------
8625 Copy the STA Key parameters into the HAL message
8626 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008627 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008628 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8629
Jeff Johnsone7245742012-09-05 17:12:55 -07008630 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008631 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8632
8633 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8634
8635 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8636
8637 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8638
8639#ifdef WLAN_SOFTAP_FEATURE
8640 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8641 keyIndex++)
8642 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008643 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008644 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8645 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8646 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8647 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8648 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8649 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008650 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008651 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008652 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008653 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008654 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008655 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8656 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008657 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008658 WDI_MAX_KEY_LENGTH);
8659 }
8660#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008661 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008662 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8663 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8664 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8665 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8666 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8667 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008668 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008669 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008670 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008671 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008672 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008673 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8674 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008675 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008676 WDI_MAX_KEY_LENGTH);
8677#endif
8678
Jeff Johnsone7245742012-09-05 17:12:55 -07008679 wpalMemoryCopy( pSendBuffer+usDataOffset,
8680 &halSetStaKeyReqMsg.setStaKeyParams,
8681 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008682
8683 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008684 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008685
8686 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008687 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008688 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008689 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8690 wdiSetSTAKeyRspCb, pEventData->pUserData,
8691 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008692
8693}/*WDI_ProcessSetSTABcastKeyReq*/
8694
8695/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008696 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008697 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008698
8699 @param pWDICtx: pointer to the WLAN DAL context
8700 pEventData: pointer to the event information structure
8701
Jeff Johnson295189b2012-06-20 16:38:30 -07008702 @see
8703 @return Result of the function call
8704*/
8705WDI_Status
8706WDI_ProcessRemoveStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008707(
Jeff Johnson295189b2012-06-20 16:38:30 -07008708 WDI_ControlBlockType* pWDICtx,
8709 WDI_EventInfoType* pEventData
8710)
8711{
8712 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams;
8713 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8714 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008715 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008716 wpt_uint16 usDataOffset = 0;
8717 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008718 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008719 wpt_macAddr macBSSID;
8720 wpt_uint8 ucCurrentBSSSesIdx;
8721 tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}};
8722 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8723
8724 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008725 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008726 -------------------------------------------------------------------------*/
8727 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8728 ( NULL == pEventData->pCBfnc ))
8729 {
8730 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8731 "%s: Invalid parameters", __FUNCTION__);
8732 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008733 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008734 }
8735
8736 pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8737 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8738 /*-------------------------------------------------------------------------
8739 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008740 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008741 -------------------------------------------------------------------------*/
8742 wpalMutexAcquire(&pWDICtx->wptMutex);
8743
8744 /*------------------------------------------------------------------------
8745 Find the BSS for which the request is made and identify WDI session
8746 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008747 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8748 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008749 &macBSSID))
8750 {
8751 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8752 "This station does not exist in the WDI Station Table %d");
8753 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008754 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008755 }
8756
Jeff Johnsone7245742012-09-05 17:12:55 -07008757 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8758 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008759 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008760 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8761 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8762 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008763
8764 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008765 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008766 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008767
Jeff Johnson295189b2012-06-20 16:38:30 -07008768 /*------------------------------------------------------------------------
8769 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008770 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008771 ------------------------------------------------------------------------*/
8772 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8773 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008774 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8775 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8776 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008777
Jeff Johnsone7245742012-09-05 17:12:55 -07008778 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008779 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008780 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008781 }
8782
8783
8784
8785 wpalMutexRelease(&pWDICtx->wptMutex);
8786 /*-----------------------------------------------------------------------
8787 Get message buffer
8788 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008789 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008790 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams),
8791 &pSendBuffer, &usDataOffset, &usSendSize))||
8792 ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) )))
8793 {
8794 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8795 "Unable to get send buffer in set bss key req %x %x %x",
8796 pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb);
8797 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008798 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008799 }
8800
8801 /*-----------------------------------------------------------------------
8802 Copy the Key parameters into the HAL message
8803 -----------------------------------------------------------------------*/
8804
Jeff Johnsone7245742012-09-05 17:12:55 -07008805 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008806 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx;
8807
Jeff Johnsone7245742012-09-05 17:12:55 -07008808 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008809 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType);
8810
Jeff Johnsone7245742012-09-05 17:12:55 -07008811 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008812 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId;
8813
Jeff Johnsone7245742012-09-05 17:12:55 -07008814 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008815 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast;
8816
Jeff Johnsone7245742012-09-05 17:12:55 -07008817 wpalMemoryCopy( pSendBuffer+usDataOffset,
8818 &halRemoveStaBcastKeyReqMsg.removeStaKeyParams,
8819 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008820
8821 pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008822 pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008823
8824 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008825 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008826 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008827 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008828 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008829 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008830
8831}/*WDI_ProcessRemoveSTABcastKeyReq*/
8832
8833/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07008834 QOS and BA PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07008835==========================================================================*/
8836/**
8837 @brief Process Add TSpec Request function (called when Main FSM
8838 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008839
8840 @param pWDICtx: pointer to the WLAN DAL context
8841 pEventData: pointer to the event information structure
8842
Jeff Johnson295189b2012-06-20 16:38:30 -07008843 @see
8844 @return Result of the function call
8845*/
8846WDI_Status
8847WDI_ProcessAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008848(
Jeff Johnson295189b2012-06-20 16:38:30 -07008849 WDI_ControlBlockType* pWDICtx,
8850 WDI_EventInfoType* pEventData
8851)
8852{
8853 WDI_AddTSReqParamsType* pwdiAddTSParams;
8854 WDI_AddTsRspCb wdiAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008855 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008856 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008857 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008858 wpt_uint16 usDataOffset = 0;
8859 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008860 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008861 wpt_macAddr macBSSID;
8862 tAddTsParams halAddTsParams = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -07008863
Jeff Johnson295189b2012-06-20 16:38:30 -07008864 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8865
8866 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008867 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008868 -------------------------------------------------------------------------*/
8869 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8870 ( NULL == pEventData->pCBfnc ))
8871 {
8872 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8873 "%s: Invalid parameters", __FUNCTION__);
8874 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008875 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008876 }
8877
8878 pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData;
8879 wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc;
8880 /*-------------------------------------------------------------------------
8881 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008882 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008883 -------------------------------------------------------------------------*/
8884 wpalMutexAcquire(&pWDICtx->wptMutex);
8885
8886 /*------------------------------------------------------------------------
8887 Find the BSS for which the request is made and identify WDI session
8888 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008889 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8890 pwdiAddTSParams->wdiTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008891 &macBSSID))
8892 {
8893 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8894 "This station does not exist in the WDI Station Table %d");
8895 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008896 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008897 }
8898
Jeff Johnsone7245742012-09-05 17:12:55 -07008899 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8900 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008901 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008902 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8903 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8904 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008905
8906 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008907 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008908 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008909
Jeff Johnson295189b2012-06-20 16:38:30 -07008910 /*------------------------------------------------------------------------
8911 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008912 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008913 ------------------------------------------------------------------------*/
8914 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8915 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008916 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8917 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8918 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008919
Jeff Johnsone7245742012-09-05 17:12:55 -07008920 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008921 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008922 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008923 }
8924
8925 wpalMutexRelease(&pWDICtx->wptMutex);
8926 /*-----------------------------------------------------------------------
8927 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07008928 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07008929 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008930 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ,
8931 sizeof(halAddTsParams),
8932 &pSendBuffer, &usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -07008933 &usSendSize))||
8934 ( usSendSize < (usDataOffset + sizeof(halAddTsParams) )))
8935 {
8936 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8937 "Unable to get send buffer in set bss key req %x %x %x",
8938 pEventData, pwdiAddTSParams, wdiAddTSRspCb);
8939 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008940 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008941 }
8942
8943 halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx;
8944 halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx;
8945
8946 //TSPEC IE
8947 halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType;
8948 halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -07008949 halAddTsParams.tspec.nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008950 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008951 halAddTsParams.tspec.maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008952 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008953 halAddTsParams.tspec.minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008954 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008955 halAddTsParams.tspec.maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008956 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008957 halAddTsParams.tspec.inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008958 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008959 halAddTsParams.tspec.suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008960 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008961 halAddTsParams.tspec.svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008962 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -07008963 halAddTsParams.tspec.minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008964 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008965 halAddTsParams.tspec.meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008966 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008967 halAddTsParams.tspec.peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008968 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008969 halAddTsParams.tspec.maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008970 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008971 halAddTsParams.tspec.delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -07008972 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -07008973 halAddTsParams.tspec.minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008974 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008975 halAddTsParams.tspec.surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -07008976 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -07008977 halAddTsParams.tspec.mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008978 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime;
8979
8980 //TSPEC IE : TS INFO : TRAFFIC
Jeff Johnsone7245742012-09-05 17:12:55 -07008981 halAddTsParams.tspec.tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -07008982 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -07008983 halAddTsParams.tspec.tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -07008984 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -07008985 halAddTsParams.tspec.tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -07008986 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008987 halAddTsParams.tspec.tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -07008988 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -07008989 halAddTsParams.tspec.tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -07008990 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction;
Jeff Johnsone7245742012-09-05 17:12:55 -07008991 halAddTsParams.tspec.tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -07008992 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid;
Jeff Johnsone7245742012-09-05 17:12:55 -07008993 halAddTsParams.tspec.tsinfo.traffic.trafficType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008994 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType;
8995
8996 //TSPEC IE : TS INFO : SCHEDULE
Jeff Johnsone7245742012-09-05 17:12:55 -07008997 halAddTsParams.tspec.tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -07008998 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -07008999 halAddTsParams.tspec.tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -07009000 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule;
9001
Jeff Johnsone7245742012-09-05 17:12:55 -07009002 wpalMemoryCopy( pSendBuffer+usDataOffset,
9003 &halAddTsParams,
9004 sizeof(halAddTsParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009005
9006 pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009007 pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009008
9009 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009010 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009011 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009012 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07009013 wdiAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07009014 WDI_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009015}/*WDI_ProcessAddTSpecReq*/
9016
9017
9018/**
9019 @brief Process Del TSpec Request function (called when Main FSM
9020 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009021
9022 @param pWDICtx: pointer to the WLAN DAL context
9023 pEventData: pointer to the event information structure
9024
Jeff Johnson295189b2012-06-20 16:38:30 -07009025 @see
9026 @return Result of the function call
9027*/
9028WDI_Status
9029WDI_ProcessDelTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009030(
Jeff Johnson295189b2012-06-20 16:38:30 -07009031 WDI_ControlBlockType* pWDICtx,
9032 WDI_EventInfoType* pEventData
9033)
9034{
9035 WDI_DelTSReqParamsType* pwdiDelTSParams;
9036 WDI_DelTsRspCb wdiDelTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009037 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009038 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009039 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009040 wpt_uint16 usDataOffset = 0;
9041 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009042 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009043 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9044
9045 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009046 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009047 -------------------------------------------------------------------------*/
9048 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9049 ( NULL == pEventData->pCBfnc ))
9050 {
9051 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9052 "%s: Invalid parameters", __FUNCTION__);
9053 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009054 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009055 }
9056
9057 pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData;
9058 wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc;
9059
9060 /*-------------------------------------------------------------------------
9061 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009062 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009063 -------------------------------------------------------------------------*/
9064 wpalMutexAcquire(&pWDICtx->wptMutex);
9065
9066 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009067 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009068 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009069 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
9070 pwdiDelTSParams->wdiDelTSInfo.macBSSID,
9071 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009072
Jeff Johnsone7245742012-09-05 17:12:55 -07009073 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009074 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009075 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9076 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9077 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
9078
Jeff Johnson295189b2012-06-20 16:38:30 -07009079 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009080 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009081 }
9082
9083 /*------------------------------------------------------------------------
9084 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009085 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009086 ------------------------------------------------------------------------*/
9087 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9088 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009089 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9090 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9091 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009092
Jeff Johnsone7245742012-09-05 17:12:55 -07009093 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009094 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009095 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009096 }
9097
9098
9099 wpalMutexRelease(&pWDICtx->wptMutex);
9100 /*-----------------------------------------------------------------------
9101 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009102 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009103 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009104 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009105 sizeof(pwdiDelTSParams->wdiDelTSInfo),
9106 &pSendBuffer, &usDataOffset, &usSendSize))||
9107 ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) )))
9108 {
9109 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9110 "Unable to get send buffer in set bss key req %x %x %x",
9111 pEventData, pwdiDelTSParams, wdiDelTSRspCb);
9112 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009113 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009114 }
9115
Jeff Johnsone7245742012-09-05 17:12:55 -07009116 wpalMemoryCopy( pSendBuffer+usDataOffset,
9117 &pwdiDelTSParams->wdiDelTSInfo,
9118 sizeof(pwdiDelTSParams->wdiDelTSInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009119
9120 pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009121 pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009122
9123 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009124 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009125 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009126 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9127 wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009128}/*WDI_ProcessDelTSpecReq*/
9129
9130/**
9131 @brief Process Update EDCA Params Request function (called when
9132 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009133
9134 @param pWDICtx: pointer to the WLAN DAL context
9135 pEventData: pointer to the event information structure
9136
Jeff Johnson295189b2012-06-20 16:38:30 -07009137 @see
9138 @return Result of the function call
9139*/
9140WDI_Status
9141WDI_ProcessUpdateEDCAParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009142(
Jeff Johnson295189b2012-06-20 16:38:30 -07009143 WDI_ControlBlockType* pWDICtx,
9144 WDI_EventInfoType* pEventData
9145)
9146{
9147 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams;
9148 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009149 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009150 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009151 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009152 wpt_uint16 usDataOffset = 0;
9153 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009154 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009155 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9156
9157 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009158 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009159 -------------------------------------------------------------------------*/
9160 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9161 ( NULL == pEventData->pCBfnc ))
9162 {
9163 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9164 "%s: Invalid parameters", __FUNCTION__);
9165 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009166 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009167 }
9168
9169 pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData;
9170 wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc;
9171 /*-------------------------------------------------------------------------
9172 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009173 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009174 -------------------------------------------------------------------------*/
9175 wpalMutexAcquire(&pWDICtx->wptMutex);
9176
9177 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009178 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009179 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009180 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
9181 pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx,
9182 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009183
Jeff Johnsone7245742012-09-05 17:12:55 -07009184 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009185 {
9186 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07009187 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
9188 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009189
9190 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009191 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009192 }
9193
9194 /*------------------------------------------------------------------------
9195 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009196 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009197 ------------------------------------------------------------------------*/
9198 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9199 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009200 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9201 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
9202 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009203
Jeff Johnsone7245742012-09-05 17:12:55 -07009204 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009205 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009206 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009207 }
9208
9209
9210 wpalMutexRelease(&pWDICtx->wptMutex);
9211 /*-----------------------------------------------------------------------
9212 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009213 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009214 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009215 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009216 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo),
9217 &pSendBuffer, &usDataOffset, &usSendSize))||
9218 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) )))
9219 {
9220 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9221 "Unable to get send buffer in set bss key req %x %x %x",
9222 pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb);
9223 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009224 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009225 }
9226
Jeff Johnsone7245742012-09-05 17:12:55 -07009227 wpalMemoryCopy( pSendBuffer+usDataOffset,
9228 &pwdiUpdateEDCAParams->wdiEDCAInfo,
9229 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009230
9231 pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009232 pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009233
9234 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009235 Send Update EDCA Params Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009236 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009237 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9238 wdiUpdateEDCARspCb, pEventData->pUserData,
9239 WDI_UPD_EDCA_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009240}/*WDI_ProcessUpdateEDCAParamsReq*/
9241
9242/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009243 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009244 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009245
9246 @param pWDICtx: pointer to the WLAN DAL context
9247 pEventData: pointer to the event information structure
9248
Jeff Johnson295189b2012-06-20 16:38:30 -07009249 @see
9250 @return Result of the function call
9251*/
9252WDI_Status
9253WDI_ProcessAddBASessionReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009254(
Jeff Johnson295189b2012-06-20 16:38:30 -07009255 WDI_ControlBlockType* pWDICtx,
9256 WDI_EventInfoType* pEventData
9257)
9258{
9259 WDI_AddBASessionReqParamsType* pwdiAddBASessionParams;
9260 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009261 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009262 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009263 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009264 wpt_uint16 usDataOffset = 0;
9265 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009266 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009267 wpt_macAddr macBSSID;
9268
9269 tAddBASessionReqMsg halAddBASessionReq;
9270 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9271
9272 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009273 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009274 -------------------------------------------------------------------------*/
9275 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9276 ( NULL == pEventData->pCBfnc ))
9277 {
9278 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9279 "%s: Invalid parameters", __FUNCTION__);
9280 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009281 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009282 }
9283
Jeff Johnsone7245742012-09-05 17:12:55 -07009284 pwdiAddBASessionParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009285 (WDI_AddBASessionReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009286 wdiAddBASessionRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009287 (WDI_AddBASessionRspCb)pEventData->pCBfnc;
9288 /*-------------------------------------------------------------------------
9289 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009290 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009291 -------------------------------------------------------------------------*/
9292 wpalMutexAcquire(&pWDICtx->wptMutex);
9293
9294 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009295 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009296 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009297 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9298 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009299 &macBSSID))
9300 {
9301 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9302 "This station does not exist in the WDI Station Table %d");
9303 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009304 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009305 }
9306
9307
Jeff Johnsone7245742012-09-05 17:12:55 -07009308 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009309
Jeff Johnsone7245742012-09-05 17:12:55 -07009310 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009311 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009312 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9313 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9314 __func__, MAC_ADDR_ARRAY(macBSSID));
9315
Jeff Johnson295189b2012-06-20 16:38:30 -07009316 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009317 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009318 }
9319
9320 /*------------------------------------------------------------------------
9321 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009322 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009323 ------------------------------------------------------------------------*/
9324 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9325 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009326 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9327 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9328 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009329
Jeff Johnsone7245742012-09-05 17:12:55 -07009330 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009331 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009332 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009333 }
9334
9335
9336 wpalMutexRelease(&pWDICtx->wptMutex);
9337 /*-----------------------------------------------------------------------
9338 Get message buffer
9339 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009340 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9341 WDI_ADD_BA_SESSION_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009342 sizeof(halAddBASessionReq.addBASessionParams),
9343 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009344 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009345 (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) )))
9346 {
9347 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9348 "Unable to get send buffer in Add BA session req %x %x %x",
9349 pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb);
9350 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009351 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009352 }
9353
9354 halAddBASessionReq.addBASessionParams.staIdx =
9355 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx;
9356 wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr,
9357 pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr,
9358 WDI_MAC_ADDR_LEN);
9359 halAddBASessionReq.addBASessionParams.baTID =
9360 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID;
9361 halAddBASessionReq.addBASessionParams.baPolicy =
9362 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy;
9363 halAddBASessionReq.addBASessionParams.baBufferSize =
9364 pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize;
9365 halAddBASessionReq.addBASessionParams.baTimeout =
9366 pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout;
9367 halAddBASessionReq.addBASessionParams.baSSN =
9368 pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN;
9369 halAddBASessionReq.addBASessionParams.baDirection =
9370 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection;
9371
Jeff Johnsone7245742012-09-05 17:12:55 -07009372 wpalMemoryCopy( pSendBuffer+usDataOffset,
9373 &halAddBASessionReq.addBASessionParams,
9374 sizeof(halAddBASessionReq.addBASessionParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009375
9376 pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009377 pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009378
9379 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009380 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009381 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009382 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9383 wdiAddBASessionRspCb, pEventData->pUserData,
9384 WDI_ADD_BA_SESSION_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009385}/*WDI_ProcessAddBASessionReq*/
9386
9387/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009388 @brief Process Del BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009389 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009390
9391 @param pWDICtx: pointer to the WLAN DAL context
9392 pEventData: pointer to the event information structure
9393
Jeff Johnson295189b2012-06-20 16:38:30 -07009394 @see
9395 @return Result of the function call
9396*/
9397WDI_Status
9398WDI_ProcessDelBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009399(
Jeff Johnson295189b2012-06-20 16:38:30 -07009400 WDI_ControlBlockType* pWDICtx,
9401 WDI_EventInfoType* pEventData
9402)
9403{
9404 WDI_DelBAReqParamsType* pwdiDelBAParams;
9405 WDI_DelBARspCb wdiDelBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009406 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009407 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009408 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009409 wpt_uint16 usDataOffset = 0;
9410 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009411 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009412 wpt_macAddr macBSSID;
9413 tDelBAParams halDelBAparam;
9414 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9415
9416 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009417 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009418 -------------------------------------------------------------------------*/
9419 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9420 ( NULL == pEventData->pCBfnc ))
9421 {
9422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9423 "%s: Invalid parameters", __FUNCTION__);
9424 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009425 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009426 }
9427
9428 pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData;
9429 wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc;
9430 /*-------------------------------------------------------------------------
9431 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009432 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009433 -------------------------------------------------------------------------*/
9434 wpalMutexAcquire(&pWDICtx->wptMutex);
9435
9436 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009437 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009438 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009439 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9440 pwdiDelBAParams->wdiBAInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009441 &macBSSID))
9442 {
9443 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9444 "This station does not exist in the WDI Station Table %d");
9445 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009446 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009447 }
9448
Jeff Johnsone7245742012-09-05 17:12:55 -07009449 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009450
Jeff Johnsone7245742012-09-05 17:12:55 -07009451 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009452 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009453 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9454 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9455 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009456
9457 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009458 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009459 }
9460
9461 /*------------------------------------------------------------------------
9462 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009463 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009464 ------------------------------------------------------------------------*/
9465 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9466 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009467 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9468 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9469 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009470
Jeff Johnsone7245742012-09-05 17:12:55 -07009471 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009472 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009473 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009474 }
9475
9476 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009477 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009478 sizeof(halDelBAparam),
9479 &pSendBuffer, &usDataOffset, &usSendSize))||
9480 ( usSendSize < (usDataOffset + sizeof(halDelBAparam) )))
9481 {
9482 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9483 "Unable to get send buffer for DEL BA req %x %x %x",
9484 pEventData, pwdiDelBAParams, wdiDelBARspCb);
9485 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009486 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009487 }
9488
9489 halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx;
9490 halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID;
9491 halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection;
9492
Jeff Johnsone7245742012-09-05 17:12:55 -07009493 wpalMemoryCopy( pSendBuffer+usDataOffset,
9494 &halDelBAparam,
9495 sizeof(halDelBAparam));
Jeff Johnson295189b2012-06-20 16:38:30 -07009496
9497 pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009498 pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009499
9500 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009501 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009502 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009503 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9504 wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009505}/*WDI_ProcessDelBAReq*/
9506
9507#ifdef FEATURE_WLAN_CCX
9508
9509WDI_Status
9510WDI_ProcessTSMStatsReq
9511(
9512 WDI_ControlBlockType* pWDICtx,
9513 WDI_EventInfoType* pEventData
9514)
9515{
9516 WDI_TSMStatsReqParamsType* pwdiTSMParams;
9517 WDI_TsmRspCb wdiTSMRspCb;
9518 wpt_uint8 ucCurrentBSSSesIdx = 0;
9519 WDI_BSSSessionType* pBSSSes = NULL;
9520 wpt_uint8* pSendBuffer = NULL;
9521 wpt_uint16 usDataOffset = 0;
9522 wpt_uint16 usSendSize = 0;
9523 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9524 tTsmStatsParams halTsmStatsReqParams = {0};
9525
9526 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9527
9528 /*-------------------------------------------------------------------------
9529 Sanity check
9530 -------------------------------------------------------------------------*/
9531 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9532 ( NULL == pEventData->pCBfnc ))
9533 {
9534 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9535 "%s: Invalid parameters", __FUNCTION__);
9536 WDI_ASSERT(0);
9537 return WDI_STATUS_E_FAILURE;
9538 }
9539
9540 pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData;
9541 wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc;
9542 /*-------------------------------------------------------------------------
9543 Check to see if we are in the middle of an association, if so queue, if
9544 not it means it is free to process request
9545 -------------------------------------------------------------------------*/
9546 wpalMutexAcquire(&pWDICtx->wptMutex);
9547
9548 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes);
9549 if ( NULL == pBSSSes )
9550 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009551 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9552 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9553 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009554
9555 wpalMutexRelease(&pWDICtx->wptMutex);
9556 return WDI_STATUS_E_NOT_ALLOWED;
9557 }
9558
9559 /*------------------------------------------------------------------------
9560 Check if this BSS is being currently processed or queued,
9561 if queued - queue the new request as well
9562 ------------------------------------------------------------------------*/
9563 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9564 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009565 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9566 "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9567 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009568
9569 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9570 wpalMutexRelease(&pWDICtx->wptMutex);
9571 return wdiStatus;
9572 }
9573
9574 wpalMutexRelease(&pWDICtx->wptMutex);
9575 /*-----------------------------------------------------------------------
9576 Get message buffer
9577 ! TO DO : proper conversion into the HAL Message Request Format
9578 -----------------------------------------------------------------------*/
9579 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ,
9580 sizeof(halTsmStatsReqParams),
9581 &pSendBuffer, &usDataOffset, &usSendSize))||
9582 ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) )))
9583 {
9584 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9585 "Unable to get send buffer in set bss key req %x %x %x",
9586 pEventData, pwdiTSMParams, wdiTSMRspCb);
9587 WDI_ASSERT(0);
9588 return WDI_STATUS_E_FAILURE;
9589 }
9590
9591 halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid;
9592 wpalMemoryCopy(halTsmStatsReqParams.bssId,
9593 pwdiTSMParams->wdiTsmStatsParamsInfo.bssid,
9594 WDI_MAC_ADDR_LEN);
9595 wpalMemoryCopy( pSendBuffer+usDataOffset,
9596 &halTsmStatsReqParams,
9597 sizeof(halTsmStatsReqParams));
9598
9599 pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB;
9600 pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData;
9601
9602 /*-------------------------------------------------------------------------
9603 Send TSM Stats Request to HAL
9604 -------------------------------------------------------------------------*/
9605 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9606 wdiTSMRspCb, pEventData->pUserData,
9607 WDI_TSM_STATS_RESP);
9608}/*WDI_ProcessTSMStatsReq*/
9609
9610#endif
9611
9612
9613/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009614 @brief Process Flush AC Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009615 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009616
9617 @param pWDICtx: pointer to the WLAN DAL context
9618 pEventData: pointer to the event information structure
9619
Jeff Johnson295189b2012-06-20 16:38:30 -07009620 @see
9621 @return Result of the function call
9622*/
9623WDI_Status
9624WDI_ProcessFlushAcReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009625(
Jeff Johnson295189b2012-06-20 16:38:30 -07009626 WDI_ControlBlockType* pWDICtx,
9627 WDI_EventInfoType* pEventData
9628)
9629{
9630 WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL;
9631 WDI_FlushAcRspCb wdiFlushAcRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009632 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009633 wpt_uint16 usDataOffset = 0;
9634 wpt_uint16 usSendSize = 0;
9635 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9636
9637 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009638 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009639 -------------------------------------------------------------------------*/
9640 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9641 ( NULL == pEventData->pCBfnc ))
9642 {
9643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9644 "%s: Invalid parameters", __FUNCTION__);
9645 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009646 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009647 }
9648
9649 pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData;
9650 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc;
9651 /*-----------------------------------------------------------------------
9652 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009653 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009654 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009655 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009656 sizeof(pwdiFlushAcParams->wdiFlushAcInfo),
9657 &pSendBuffer, &usDataOffset, &usSendSize))||
9658 ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) )))
9659 {
9660 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9661 "Unable to get send buffer in set bss key req %x %x %x",
9662 pEventData, pwdiFlushAcParams, wdiFlushAcRspCb);
9663 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009664 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009665 }
9666
Jeff Johnsone7245742012-09-05 17:12:55 -07009667 wpalMemoryCopy( pSendBuffer+usDataOffset,
9668 &pwdiFlushAcParams->wdiFlushAcInfo,
9669 sizeof(pwdiFlushAcParams->wdiFlushAcInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009670
9671 pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009672 pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009673
9674 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009675 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009676 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009677 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9678 wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009679}/*WDI_ProcessFlushAcReq*/
9680
9681/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009682 @brief Process BT AMP event Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009683 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009684
9685 @param pWDICtx: pointer to the WLAN DAL context
9686 pEventData: pointer to the event information structure
9687
Jeff Johnson295189b2012-06-20 16:38:30 -07009688 @see
9689 @return Result of the function call
9690*/
9691WDI_Status
9692WDI_ProcessBtAmpEventReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009693(
Jeff Johnson295189b2012-06-20 16:38:30 -07009694 WDI_ControlBlockType* pWDICtx,
9695 WDI_EventInfoType* pEventData
9696)
9697{
9698 WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL;
9699 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009700 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009701 wpt_uint16 usDataOffset = 0;
9702 wpt_uint16 usSendSize = 0;
9703
9704 tBtAmpEventMsg haltBtAmpEventMsg;
9705 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9706
9707 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009708 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009709 -------------------------------------------------------------------------*/
9710 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9711 ( NULL == pEventData->pCBfnc ))
9712 {
9713 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9714 "%s: Invalid parameters", __FUNCTION__);
9715 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009716 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009717 }
9718
9719 pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData;
9720 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc;
9721 /*-----------------------------------------------------------------------
9722 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009723 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009724 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009725 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009726 sizeof(haltBtAmpEventMsg.btAmpEventParams),
9727 &pSendBuffer, &usDataOffset, &usSendSize))||
9728 ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) )))
9729 {
9730 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9731 "Unable to get send buffer in BT AMP event req %x %x %x",
9732 pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb);
9733 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009734 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009735 }
9736
Jeff Johnsone7245742012-09-05 17:12:55 -07009737 haltBtAmpEventMsg.btAmpEventParams.btAmpEventType =
Jeff Johnson295189b2012-06-20 16:38:30 -07009738 pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType;
Jeff Johnsone7245742012-09-05 17:12:55 -07009739 wpalMemoryCopy( pSendBuffer+usDataOffset,
9740 &haltBtAmpEventMsg.btAmpEventParams,
9741 sizeof(haltBtAmpEventMsg.btAmpEventParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009742
9743 pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009744 pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009745
9746 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009747 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009748 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009749 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9750 wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009751}/*WDI_ProcessBtAmpEventReq*/
9752
9753/**
9754 @brief Process Add STA self Request function (called when Main FSM
9755 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009756
9757 @param pWDICtx: pointer to the WLAN DAL context
9758 pEventData: pointer to the event information structure
9759
Jeff Johnson295189b2012-06-20 16:38:30 -07009760 @see
9761 @return Result of the function call
9762*/
9763WDI_Status
9764WDI_ProcessAddSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009765(
Jeff Johnson295189b2012-06-20 16:38:30 -07009766 WDI_ControlBlockType* pWDICtx,
9767 WDI_EventInfoType* pEventData
9768)
9769{
9770 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams;
9771 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009772 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009773 wpt_uint16 usDataOffset = 0;
9774 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009775 tAddStaSelfParams halAddSTASelfParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07009776 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9777
9778 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009779 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009780 -------------------------------------------------------------------------*/
9781 if (( NULL == pEventData ) ||
9782 ( NULL == pEventData->pEventData) ||
9783 ( NULL == pEventData->pCBfnc))
9784 {
9785 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9786 "%s: Invalid parameters", __FUNCTION__);
9787 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009788 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009789 }
9790
Jeff Johnsone7245742012-09-05 17:12:55 -07009791 pwdiAddSTASelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009792 (WDI_AddSTASelfReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009793 wdiAddSTASelfReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009794 (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc;
9795 /*-----------------------------------------------------------------------
9796 Get message buffer
9797 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009798 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9799 WDI_ADD_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009800 sizeof(tAddStaSelfParams),
9801 &pSendBuffer, &usDataOffset, &usSendSize))||
9802 ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) )))
9803 {
9804 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9805 "Unable to get send buffer in ADD STA SELF REQ %x %x %x",
9806 pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb);
9807 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009808 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009809 }
9810
9811 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07009812 wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07009813 sizeof(pWDICtx->wdiCacheAddSTASelfReq));
9814
Jeff Johnsone7245742012-09-05 17:12:55 -07009815 wpalMemoryCopy(halAddSTASelfParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009816 pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ;
9817
Jeff Johnsone7245742012-09-05 17:12:55 -07009818 wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams,
9819 sizeof(tAddStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009820
9821 pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009822 pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009823
9824 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009825 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009826 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009827 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9828 wdiAddSTASelfReqRspCb, pEventData->pUserData,
9829 WDI_ADD_STA_SELF_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009830}/*WDI_ProcessAddSTASelfReq*/
9831
9832
9833
9834/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009835 @brief Process Del Sta Self Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009836 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009837
9838 @param pWDICtx: pointer to the WLAN DAL context
9839 pEventData: pointer to the event information structure
9840
Jeff Johnson295189b2012-06-20 16:38:30 -07009841 @see
9842 @return Result of the function call
9843*/
9844WDI_Status
9845WDI_ProcessDelSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009846(
Jeff Johnson295189b2012-06-20 16:38:30 -07009847 WDI_ControlBlockType* pWDICtx,
9848 WDI_EventInfoType* pEventData
9849)
9850{
9851 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams;
9852 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009853 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009854 wpt_uint16 usDataOffset = 0;
9855 wpt_uint16 usSendSize = 0;
9856 tDelStaSelfParams halSetDelSelfSTAParams;
9857 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9858
9859 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009860 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009861 -------------------------------------------------------------------------*/
9862 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9863 ( NULL == pEventData->pCBfnc ))
9864 {
9865 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9866 "%s: Invalid parameters", __FUNCTION__);
9867 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009868 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009869 }
9870
Jeff Johnsone7245742012-09-05 17:12:55 -07009871 pwdiDelStaSelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009872 (WDI_DelSTASelfReqParamsType*)pEventData->pEventData;
9873 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc;
9874
9875 /*-----------------------------------------------------------------------
9876 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009877 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009878 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009879 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009880 sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo),
9881 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009882 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009883 (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) )))
9884 {
9885 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9886 "Unable to get send buffer in Del Sta Self req %x %x %x",
9887 pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb);
9888 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009889 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009890 }
9891
Jeff Johnsone7245742012-09-05 17:12:55 -07009892 wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009893 pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ;
9894
Jeff Johnsone7245742012-09-05 17:12:55 -07009895 wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams,
9896 sizeof(tDelStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009897
9898 pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009899 pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009900
9901 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009902 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009903 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009904 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9905 wdiDelStaSelfRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07009906 WDI_DEL_STA_SELF_RESP);
9907
9908}
9909
Jeff Johnsone7245742012-09-05 17:12:55 -07009910#ifdef FEATURE_OEM_DATA_SUPPORT
9911/**
9912 @brief Process Start Oem Data Request function (called when Main
9913 FSM allows it)
9914
9915 @param pWDICtx: pointer to the WLAN DAL context
9916 pEventData: pointer to the event information structure
9917
9918 @see
9919 @return Result of the function call
9920*/
9921WDI_Status
9922WDI_ProcessStartOemDataReq
9923(
9924 WDI_ControlBlockType* pWDICtx,
9925 WDI_EventInfoType* pEventData
9926)
9927{
9928 WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL;
9929 WDI_oemDataRspCb wdiOemDataRspCb;
9930 wpt_uint8* pSendBuffer = NULL;
9931 wpt_uint16 usDataOffset = 0;
9932 wpt_uint16 usSendSize = 0;
9933 wpt_uint16 reqLen;
9934 tStartOemDataReqParams* halStartOemDataReqParams;
9935
9936 /*-------------------------------------------------------------------------
9937 Sanity check
9938 -------------------------------------------------------------------------*/
9939 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9940 ( NULL == pEventData->pCBfnc ))
9941 {
9942 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9943 "%s: Invalid parameters", __FUNCTION__);
9944 WDI_ASSERT(0);
9945 return WDI_STATUS_E_FAILURE;
9946 }
9947
9948 pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData;
9949 wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc;
9950
9951 /*-----------------------------------------------------------------------
9952 Get message buffer
9953 -----------------------------------------------------------------------*/
9954
9955 reqLen = sizeof(tStartOemDataReqParams);
9956
9957 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9958 WDI_START_OEM_DATA_REQ, reqLen,
9959 &pSendBuffer, &usDataOffset, &usSendSize))||
9960 (usSendSize < (usDataOffset + reqLen)))
9961 {
9962 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9963 "Unable to get send buffer in Start Oem Data req %x %x %x",
9964 pEventData, pwdiOemDataReqParams, wdiOemDataRspCb);
9965 WDI_ASSERT(0);
9966 return WDI_STATUS_E_FAILURE;
9967 }
9968
9969 //copying WDI OEM DATA REQ PARAMS to shared memory
9970 halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset );
9971
9972 wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr));
9973 wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE);
9974
9975 pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB;
9976 pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData;
9977
9978 /*-------------------------------------------------------------------------
9979 Send Start Request to HAL
9980 -------------------------------------------------------------------------*/
9981 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9982 wdiOemDataRspCb, pEventData->pUserData,
9983 WDI_START_OEM_DATA_RESP);
9984}/*WDI_ProcessStartOemDataReq*/
9985#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07009986
9987/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009988 @brief Process Host Resume Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009989 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009990
9991 @param pWDICtx: pointer to the WLAN DAL context
9992 pEventData: pointer to the event information structure
9993
Jeff Johnson295189b2012-06-20 16:38:30 -07009994 @see
9995 @return Result of the function call
9996*/
9997WDI_Status
9998WDI_ProcessHostResumeReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009999(
Jeff Johnson295189b2012-06-20 16:38:30 -070010000 WDI_ControlBlockType* pWDICtx,
10001 WDI_EventInfoType* pEventData
10002)
10003{
10004 WDI_ResumeParamsType* pwdiHostResumeParams = NULL;
10005 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010006 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010007 wpt_uint16 usDataOffset = 0;
10008 wpt_uint16 usSendSize = 0;
10009 tHalWlanHostResumeReqParam halResumeReqParams;
10010
10011 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10012
10013 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010014 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010015 -------------------------------------------------------------------------*/
10016 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10017 ( NULL == pEventData->pCBfnc ))
10018 {
10019 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10020 "%s: Invalid parameters ",__FUNCTION__);
10021 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010022 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010023 }
10024
10025 pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData;
10026 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc;
10027
10028 /*-----------------------------------------------------------------------
10029 Get message buffer
10030 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010031 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010032 WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams),
10033 &pSendBuffer, &usDataOffset, &usSendSize))||
10034 (usSendSize < (usDataOffset + sizeof(halResumeReqParams))))
10035 {
10036 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070010037 "Unable to get send buffer in Start Oem Data req %x %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070010038 pEventData, pwdiHostResumeParams, wdiHostResumeRspCb);
10039 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010040 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010041 }
10042
Jeff Johnsone7245742012-09-05 17:12:55 -070010043 halResumeReqParams.configuredMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070010044 pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070010045
10046 wpalMemoryCopy( pSendBuffer+usDataOffset,
10047 &halResumeReqParams,
10048 sizeof(halResumeReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010049
10050 pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010051 pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010052
10053 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010054 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010055 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010056 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10057 wdiHostResumeRspCb, pEventData->pUserData,
10058 WDI_HOST_RESUME_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010059}/*WDI_ProcessHostResumeReq*/
10060
10061/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010062 @brief Process set Tx Per Tracking Parameters Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070010063 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010064
10065 @param pWDICtx: pointer to the WLAN DAL context
10066 pEventData: pointer to the event information structure
10067
Jeff Johnson295189b2012-06-20 16:38:30 -070010068 @see
10069 @return Result of the function call
10070*/
10071WDI_Status
10072WDI_ProcessSetTxPerTrackingReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010073(
Jeff Johnson295189b2012-06-20 16:38:30 -070010074 WDI_ControlBlockType* pWDICtx,
10075 WDI_EventInfoType* pEventData
10076)
10077{
10078 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL;
10079 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010080 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010081 wpt_uint16 usDataOffset = 0;
10082 wpt_uint16 usSendSize = 0;
10083 tHalTxPerTrackingReqParam halTxPerTrackingReqParam;
10084 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10085
10086 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010087 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010088 -------------------------------------------------------------------------*/
10089 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10090 ( NULL == pEventData->pCBfnc ))
10091 {
10092 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10093 "%s: Invalid parameters ",__FUNCTION__);
10094 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010095 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010096 }
10097
10098 pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData;
10099 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -070010100
Jeff Johnson295189b2012-06-20 16:38:30 -070010101 /*-----------------------------------------------------------------------
10102 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010103 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010104 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010105 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010106 sizeof(halTxPerTrackingReqParam),
10107 &pSendBuffer, &usDataOffset, &usSendSize))||
10108 ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) )))
10109 {
10110 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10111 "Unable to get send buffer in set tx per tracking req %x %x %x",
10112 pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb);
10113 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010114 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010115 }
Jeff Johnsone7245742012-09-05 17:12:55 -070010116
Jeff Johnson295189b2012-06-20 16:38:30 -070010117 halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable;
10118 halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod;
10119 halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio;
10120 halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark;
Jeff Johnsone7245742012-09-05 17:12:55 -070010121
10122 wpalMemoryCopy( pSendBuffer+usDataOffset,
10123 &halTxPerTrackingReqParam,
10124 sizeof(halTxPerTrackingReqParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010125
10126 pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010127 pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010128
10129 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010130 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010131 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010132 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10133 pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010134}/*WDI_ProcessSetTxPerTrackingReq*/
10135
10136/*=========================================================================
10137 Indications
10138=========================================================================*/
10139
10140/**
10141 @brief Process Suspend Indications function (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010142
10143 @param pWDICtx: pointer to the WLAN DAL context
10144 pEventData: pointer to the event information structure
10145
Jeff Johnson295189b2012-06-20 16:38:30 -070010146 @see
10147 @return Result of the function call
10148*/
10149WDI_Status
10150WDI_ProcessHostSuspendInd
Jeff Johnsone7245742012-09-05 17:12:55 -070010151(
Jeff Johnson295189b2012-06-20 16:38:30 -070010152 WDI_ControlBlockType* pWDICtx,
10153 WDI_EventInfoType* pEventData
10154)
10155{
10156 WDI_SuspendParamsType *pSuspendIndParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070010157 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010158 wpt_uint16 usDataOffset = 0;
10159 wpt_uint16 usSendSize = 0;
10160 WDI_Status wdiStatus;
10161 tHalWlanHostSuspendIndParam halWlanSuspendIndparams;
10162 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10163
10164 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010165 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010166 -------------------------------------------------------------------------*/
10167 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
10168 {
10169 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10170 "%s: Invalid parameters in Suspend ind",__FUNCTION__);
10171 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010172 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010173 }
10174
10175 pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData;
10176
10177 /*-----------------------------------------------------------------------
10178 Get message buffer
10179 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010180 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
10181 WDI_HOST_SUSPEND_IND,
Jeff Johnson295189b2012-06-20 16:38:30 -070010182 sizeof(halWlanSuspendIndparams),
10183 &pSendBuffer, &usDataOffset, &usSendSize))||
10184 (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams))))
10185 {
10186 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10187 "Unable to get send buffer in Suspend Ind ");
10188 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010189 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010190 }
10191
10192 halWlanSuspendIndparams.configuredMcstBcstFilterSetting =
10193 pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting;
10194
Jeff Johnsone7245742012-09-05 17:12:55 -070010195 halWlanSuspendIndparams.activeSessionCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070010196 WDI_GetActiveSessionsCount(pWDICtx);
10197
Jeff Johnsone7245742012-09-05 17:12:55 -070010198 wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams,
10199 sizeof(tHalWlanHostSuspendIndParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010200
10201 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010202 Send Suspend Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010203 -------------------------------------------------------------------------*/
10204 pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010205 pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010206
Jeff Johnsone7245742012-09-05 17:12:55 -070010207 wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070010208 return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC;
10209}/*WDI_ProcessHostSuspendInd*/
10210
10211/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070010212 MISC CONTROL PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -070010213==========================================================================*/
10214/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010215 @brief Process Channel Switch Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010216 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010217
10218 @param pWDICtx: pointer to the WLAN DAL context
10219 pEventData: pointer to the event information structure
10220
Jeff Johnson295189b2012-06-20 16:38:30 -070010221 @see
10222 @return Result of the function call
10223*/
10224WDI_Status
10225WDI_ProcessChannelSwitchReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010226(
Jeff Johnson295189b2012-06-20 16:38:30 -070010227 WDI_ControlBlockType* pWDICtx,
10228 WDI_EventInfoType* pEventData
10229)
10230{
10231 WDI_SwitchChReqParamsType* pwdiSwitchChParams;
10232 WDI_SwitchChRspCb wdiSwitchChRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010233 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010234 wpt_uint16 usDataOffset = 0;
10235 wpt_uint16 usSendSize = 0;
10236 tSwitchChannelReqMsg halSwitchChannelReq = {{0}};
10237 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10238
10239 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010240 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010241 -------------------------------------------------------------------------*/
10242 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10243 ( NULL == pEventData->pCBfnc ))
10244 {
10245 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10246 "%s: Invalid parameters", __FUNCTION__);
10247 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010248 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010249 }
10250
10251 pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData;
10252 wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc;
10253 /*-----------------------------------------------------------------------
10254 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010255 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010256 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010257 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010258 sizeof(halSwitchChannelReq.switchChannelParams),
10259 &pSendBuffer, &usDataOffset, &usSendSize))||
10260 ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) )))
10261 {
10262 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10263 "Unable to get send buffer in channel switch req %x %x %x",
10264 pEventData, pwdiSwitchChParams, wdiSwitchChRspCb);
10265 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010266 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010267 }
10268
Jeff Johnsone7245742012-09-05 17:12:55 -070010269 halSwitchChannelReq.switchChannelParams.channelNumber =
Jeff Johnson295189b2012-06-20 16:38:30 -070010270 pwdiSwitchChParams->wdiChInfo.ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -070010271#ifndef WLAN_FEATURE_VOWIFI
10272 halSwitchChannelReq.switchChannelParams.localPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -070010273 pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint;
10274#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010275 halSwitchChannelReq.switchChannelParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070010276 pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset;
10277
10278#ifdef WLAN_FEATURE_VOWIFI
10279 halSwitchChannelReq.switchChannelParams.maxTxPower
Jeff Johnsone7245742012-09-05 17:12:55 -070010280 = pwdiSwitchChParams->wdiChInfo.cMaxTxPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070010281 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr,
10282 pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr,
10283 WDI_MAC_ADDR_LEN);
10284 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId,
10285 pwdiSwitchChParams->wdiChInfo.macBSSId,
10286 WDI_MAC_ADDR_LEN);
10287#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010288 wpalMemoryCopy( pSendBuffer+usDataOffset,
10289 &halSwitchChannelReq.switchChannelParams,
10290 sizeof(halSwitchChannelReq.switchChannelParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010291
10292 pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010293 pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010294
10295 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010296 Send Switch Channel Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010297 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010298 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10299 wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010300}/*WDI_ProcessChannelSwitchReq*/
10301
10302/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010303 @brief Process Config STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010304 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010305
10306 @param pWDICtx: pointer to the WLAN DAL context
10307 pEventData: pointer to the event information structure
10308
Jeff Johnson295189b2012-06-20 16:38:30 -070010309 @see
10310 @return Result of the function call
10311*/
10312WDI_Status
10313WDI_ProcessConfigStaReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010314(
Jeff Johnson295189b2012-06-20 16:38:30 -070010315 WDI_ControlBlockType* pWDICtx,
10316 WDI_EventInfoType* pEventData
10317)
10318{
10319 WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams;
10320 WDI_ConfigSTARspCb wdiConfigSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010321 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010322 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010323 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010324 wpt_uint16 usDataOffset = 0;
10325 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010326 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010327
Jeff Johnsone7245742012-09-05 17:12:55 -070010328 tConfigStaReqMsg halConfigStaReqMsg;
10329 wpt_uint16 uMsgSize = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010330 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10331
10332 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010333 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010334 -------------------------------------------------------------------------*/
10335 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10336 ( NULL == pEventData->pCBfnc ))
10337 {
10338 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10339 "%s: Invalid parameters", __FUNCTION__);
10340 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010341 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010342 }
10343
10344 pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData;
10345 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc;
10346 /*-------------------------------------------------------------------------
10347 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010348 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010349 -------------------------------------------------------------------------*/
10350 wpalMutexAcquire(&pWDICtx->wptMutex);
10351
10352 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010353 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010354 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010355 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10356 pwdiConfigSTAParams->wdiReqInfo.macBSSID,
10357 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010358
Jeff Johnsone7245742012-09-05 17:12:55 -070010359 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010360 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010361 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10362 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10363 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010364
10365 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010366 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010367 }
10368
10369 /*------------------------------------------------------------------------
10370 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010371 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010372 ------------------------------------------------------------------------*/
10373 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10374 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010375 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10376 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10377 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010378
Jeff Johnsone7245742012-09-05 17:12:55 -070010379 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010380 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010381 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010382 }
10383
10384 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010385
10386 /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */
10387#ifdef WLAN_FEATURE_11AC
10388 if (WDI_getFwWlanFeatCaps(DOT11AC))
10389 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC
10390 else
10391#endif
10392 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default
10393
Jeff Johnson295189b2012-06-20 16:38:30 -070010394 /*-----------------------------------------------------------------------
10395 Get message buffer
10396 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010397 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ,
10398 uMsgSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070010399 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010400 ( usSendSize < (usDataOffset + uMsgSize )))
Jeff Johnson295189b2012-06-20 16:38:30 -070010401 {
10402 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10403 "Unable to get send buffer in config sta req %x %x %x",
10404 pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb);
10405 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010406 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010407 }
10408
10409 /*Copy the station context*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010410 WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010411 &pwdiConfigSTAParams->wdiReqInfo);
10412
10413 if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF)
10414 {
10415 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010416 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -070010417 WDI_STATableFindStaidByAddr(pWDICtx,
10418 pwdiConfigSTAParams->wdiReqInfo.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070010419 (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx ))
Jeff Johnson295189b2012-06-20 16:38:30 -070010420 {
10421 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10422 "This station does not exist in the WDI Station Table %d");
10423 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010424 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010425 }
10426 }
10427 else
10428 {
10429 /* Need to fill in the STA Index to invalid, since at this point we have not
10430 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -070010431 halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070010432 }
10433
10434 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010435 halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070010436
Jeff Johnsone7245742012-09-05 17:12:55 -070010437 wpalMemoryCopy( pSendBuffer+usDataOffset,
10438 &halConfigStaReqMsg.uStaParams,
10439 sizeof(halConfigStaReqMsg.uStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010440
10441 pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010442 pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010443
Jeff Johnsone7245742012-09-05 17:12:55 -070010444 wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq,
10445 pwdiConfigSTAParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010446 sizeof(pWDICtx->wdiCachedConfigStaReq));
10447
10448 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010449 Send Config STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010450 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010451 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10452 wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010453}/*WDI_ProcessConfigStaReq*/
10454
10455
10456/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010457 @brief Process Set Link State Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010458 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010459
10460 @param pWDICtx: pointer to the WLAN DAL context
10461 pEventData: pointer to the event information structure
10462
Jeff Johnson295189b2012-06-20 16:38:30 -070010463 @see
10464 @return Result of the function call
10465*/
10466WDI_Status
10467WDI_ProcessSetLinkStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010468(
Jeff Johnson295189b2012-06-20 16:38:30 -070010469 WDI_ControlBlockType* pWDICtx,
10470 WDI_EventInfoType* pEventData
10471)
10472{
10473 WDI_SetLinkReqParamsType* pwdiSetLinkParams;
10474 WDI_SetLinkStateRspCb wdiSetLinkRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010475 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010476 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010477 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010478 wpt_uint16 usDataOffset = 0;
10479 wpt_uint16 usSendSize = 0;
10480 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnsone7245742012-09-05 17:12:55 -070010481 tLinkStateParams halLinkStateReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070010482 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10483
10484 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010485 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010486 -------------------------------------------------------------------------*/
10487 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10488 ( NULL == pEventData->pCBfnc ))
10489 {
10490 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10491 "%s: Invalid parameters", __FUNCTION__);
10492 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010493 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010494 }
10495
10496 pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData;
10497 wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc;
10498 /*-------------------------------------------------------------------------
10499 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010500 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010501 -------------------------------------------------------------------------*/
10502 wpalMutexAcquire(&pWDICtx->wptMutex);
10503
10504 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010505 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010506 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010507 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10508 pwdiSetLinkParams->wdiLinkInfo.macBSSID,
10509 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010510
Jeff Johnsone7245742012-09-05 17:12:55 -070010511 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010512 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010513 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10514 "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR,
10515 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010516 }
10517 else
10518 {
10519 /*------------------------------------------------------------------------
10520 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010521 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010522 ------------------------------------------------------------------------*/
10523 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10524 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010525 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10526 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10527 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
10528
10529 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010530 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010531 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010532 }
10533 }
10534 /* If the link is set to enter IDLE - the Session allocated for this BSS
10535 will be deleted on the Set Link State response coming from HAL
10536 - cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -070010537 wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010538 sizeof(pWDICtx->wdiCacheSetLinkStReq));
10539
10540 wpalMutexRelease(&pWDICtx->wptMutex);
10541 /*-----------------------------------------------------------------------
10542 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010543 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010544 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010545
10546 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010547 sizeof(halLinkStateReqMsg),
10548 &pSendBuffer, &usDataOffset, &usSendSize))||
10549 ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) )))
10550 {
10551 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10552 "Unable to get send buffer in set bss key req %x %x %x",
10553 pEventData, pwdiSetLinkParams, wdiSetLinkRspCb);
10554 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010555 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010556 }
10557
10558 wpalMemoryCopy(halLinkStateReqMsg.bssid,
10559 pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN);
10560
10561 wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr,
10562 pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN);
10563
Jeff Johnsone7245742012-09-05 17:12:55 -070010564 halLinkStateReqMsg.state =
Jeff Johnson295189b2012-06-20 16:38:30 -070010565 WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState);
10566
Jeff Johnsone7245742012-09-05 17:12:55 -070010567 wpalMemoryCopy( pSendBuffer+usDataOffset,
10568 &halLinkStateReqMsg,
10569 sizeof(halLinkStateReqMsg));
Jeff Johnson295189b2012-06-20 16:38:30 -070010570
10571 pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010572 pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010573
10574 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010575 Send Set Link State Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010576 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010577 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10578 wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010579}/*WDI_ProcessSetLinkStateReq*/
10580
10581
10582/**
10583 @brief Process Get Stats Request function (called when Main FSM
10584 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010585
10586 @param pWDICtx: pointer to the WLAN DAL context
10587 pEventData: pointer to the event information structure
10588
Jeff Johnson295189b2012-06-20 16:38:30 -070010589 @see
10590 @return Result of the function call
10591*/
10592WDI_Status
10593WDI_ProcessGetStatsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010594(
Jeff Johnson295189b2012-06-20 16:38:30 -070010595 WDI_ControlBlockType* pWDICtx,
10596 WDI_EventInfoType* pEventData
10597)
10598{
10599 WDI_GetStatsReqParamsType* pwdiGetStatsParams;
10600 WDI_GetStatsRspCb wdiGetStatsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010601 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010602 wpt_uint16 usDataOffset = 0;
10603 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010604 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010605 WDI_BSSSessionType* pBSSSes = NULL;
10606 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010607 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010608 tHalStatsReqMsg halStatsReqMsg;
10609 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10610
10611 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010612 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010613 -------------------------------------------------------------------------*/
10614 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) ||
10615 ( NULL == pEventData->pCBfnc ) )
10616 {
10617 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10618 "%s: Invalid parameters", __FUNCTION__);
10619 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010620 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010621 }
10622
10623 pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData;
10624 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc;
10625
10626 /*-------------------------------------------------------------------------
10627 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010628 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010629 -------------------------------------------------------------------------*/
10630 wpalMutexAcquire(&pWDICtx->wptMutex);
10631
10632 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010633 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010634 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010635 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10636 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010637 &macBSSID))
10638 {
10639 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10640 "This station does not exist in the WDI Station Table %d");
10641 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010642 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010643 }
10644
Jeff Johnsone7245742012-09-05 17:12:55 -070010645 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10646 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010647 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010648 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10649 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10650 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010651
10652 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010653 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010654 }
10655
10656 /*------------------------------------------------------------------------
10657 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010658 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010659 ------------------------------------------------------------------------*/
10660 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10661 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010662 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10663 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10664 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010665
Jeff Johnsone7245742012-09-05 17:12:55 -070010666 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010667 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010668 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010669 }
10670
10671
10672 wpalMutexRelease(&pWDICtx->wptMutex);
10673
10674 /*-----------------------------------------------------------------------
10675 Get message buffer
10676 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010677 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010678 sizeof(halStatsReqMsg.statsReqParams),
10679 &pSendBuffer, &usDataOffset, &usSendSize))||
10680 ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) )))
10681 {
10682 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10683 "Unable to get send buffer in set bss key req %x %x %x",
10684 pEventData, pwdiGetStatsParams, wdiGetStatsRspCb);
10685 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010686 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010687 }
10688
Jeff Johnsone7245742012-09-05 17:12:55 -070010689 halStatsReqMsg.statsReqParams.staId =
Jeff Johnson295189b2012-06-20 16:38:30 -070010690 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070010691 halStatsReqMsg.statsReqParams.statsMask =
Jeff Johnson295189b2012-06-20 16:38:30 -070010692 pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask;
Jeff Johnsone7245742012-09-05 17:12:55 -070010693 wpalMemoryCopy( pSendBuffer+usDataOffset,
10694 &halStatsReqMsg.statsReqParams,
10695 sizeof(halStatsReqMsg.statsReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010696
10697 pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010698 pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010699
10700 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010701 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010702 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010703 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10704 wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010705}/*WDI_ProcessGetStatsReq*/
10706
10707/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010708 @brief Process Update Cfg Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070010709 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010710
10711 @param pWDICtx: pointer to the WLAN DAL context
10712 pEventData: pointer to the event information structure
10713
Jeff Johnson295189b2012-06-20 16:38:30 -070010714 @see
10715 @return Result of the function call
10716*/
10717WDI_Status
10718WDI_ProcessUpdateCfgReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010719(
Jeff Johnson295189b2012-06-20 16:38:30 -070010720 WDI_ControlBlockType* pWDICtx,
10721 WDI_EventInfoType* pEventData
10722)
10723{
10724 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL;
10725 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL;
10726
Jeff Johnsone7245742012-09-05 17:12:55 -070010727 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010728 wpt_uint16 usDataOffset = 0;
10729 wpt_uint16 usSendSize = 0;
10730 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10731
10732 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010733 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010734 -------------------------------------------------------------------------*/
10735 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10736 ( NULL == pEventData->pCBfnc))
10737 {
10738 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10739 "%s: Invalid parameters", __FUNCTION__);
10740 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010741 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010742 }
10743
10744 pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData;
10745 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc;
10746
10747 /*-----------------------------------------------------------------------
10748 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010749 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010750 -----------------------------------------------------------------------*/
10751
Jeff Johnsone7245742012-09-05 17:12:55 -070010752 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010753 pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32),
10754 &pSendBuffer, &usDataOffset, &usSendSize))||
10755 ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen)))
10756 {
10757 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10758 "Unable to get send buffer in set bss key req %x %x %x",
10759 pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb);
10760 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010761 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010762 }
10763
Jeff Johnsone7245742012-09-05 17:12:55 -070010764 wpalMemoryCopy( pSendBuffer+usDataOffset,
10765 &pwdiUpdateCfgParams->uConfigBufferLen,
10766 sizeof(wpt_uint32));
10767 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32),
10768 pwdiUpdateCfgParams->pConfigBuffer,
10769 pwdiUpdateCfgParams->uConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -070010770
10771 pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010772 pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010773
10774 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010775 Send Update Cfg Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010776 -------------------------------------------------------------------------*/
10777
Jeff Johnsone7245742012-09-05 17:12:55 -070010778 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10779 wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010780
10781}/*WDI_ProcessUpdateCfgReq*/
10782
10783
10784/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010785 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010786 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010787
10788 @param pWDICtx: pointer to the WLAN DAL context
10789 pEventData: pointer to the event information structure
10790
Jeff Johnson295189b2012-06-20 16:38:30 -070010791 @see
10792 @return Result of the function call
10793*/
10794WDI_Status
10795WDI_ProcessAddBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010796(
Jeff Johnson295189b2012-06-20 16:38:30 -070010797 WDI_ControlBlockType* pWDICtx,
10798 WDI_EventInfoType* pEventData
10799)
10800{
10801 WDI_AddBAReqParamsType* pwdiAddBAParams;
10802 WDI_AddBARspCb wdiAddBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010803 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010804 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010805 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010806 wpt_uint16 usDataOffset = 0;
10807 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010808 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010809 wpt_macAddr macBSSID;
10810
10811 tAddBAReqMsg halAddBAReq;
10812 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10813
10814 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010815 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010816 -------------------------------------------------------------------------*/
10817 if (( NULL == pEventData ) ||
10818 ( NULL == pEventData->pEventData) ||
10819 ( NULL == pEventData->pCBfnc ))
10820 {
10821 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10822 "%s: Invalid parameters", __FUNCTION__);
10823 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010824 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010825 }
10826
10827 pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData;
10828 wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc;
10829
10830 /*-------------------------------------------------------------------------
10831 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010832 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010833 -------------------------------------------------------------------------*/
10834 wpalMutexAcquire(&pWDICtx->wptMutex);
10835
10836 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010837 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010838 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010839 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10840 pwdiAddBAParams->wdiBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010841 &macBSSID))
10842 {
10843 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10844 "This station does not exist in the WDI Station Table %d");
10845 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010846 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010847 }
10848
Jeff Johnsone7245742012-09-05 17:12:55 -070010849 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10850 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010851 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010852 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10853 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10854 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010855
10856 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010857 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010858 }
10859
10860 /*------------------------------------------------------------------------
10861 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010862 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010863 ------------------------------------------------------------------------*/
10864 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10865 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010866 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10867 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10868 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010869
Jeff Johnsone7245742012-09-05 17:12:55 -070010870 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010871 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010872 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010873 }
10874
10875
10876 wpalMutexRelease(&pWDICtx->wptMutex);
10877 /*-----------------------------------------------------------------------
10878 Get message buffer
10879 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010880 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010881 sizeof(halAddBAReq.addBAParams),
10882 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010883 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070010884 (usDataOffset + sizeof(halAddBAReq.addBAParams) )))
10885 {
10886 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10887 "Unable to get send buffer in Add BA req %x %x %x",
10888 pEventData, pwdiAddBAParams, wdiAddBARspCb);
10889 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010890 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010891 }
10892
Jeff Johnsone7245742012-09-05 17:12:55 -070010893 halAddBAReq.addBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070010894 pwdiAddBAParams->wdiBAInfoType.ucBaSessionID;
10895 halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize;
10896#ifdef FEATURE_ON_CHIP_REORDERING
Jeff Johnsone7245742012-09-05 17:12:55 -070010897 halAddBAReq.addBAParams.isReorderingDoneOnChip =
Jeff Johnson295189b2012-06-20 16:38:30 -070010898 pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip;
10899#endif
10900
Jeff Johnsone7245742012-09-05 17:12:55 -070010901 wpalMemoryCopy( pSendBuffer+usDataOffset,
10902 &halAddBAReq.addBAParams,
10903 sizeof(halAddBAReq.addBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010904
10905 pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010906 pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010907
10908 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010909 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010910 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010911 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10912 wdiAddBARspCb, pEventData->pUserData,
10913 WDI_ADD_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010914}/*WDI_ProcessAddBAReq*/
10915
10916
10917
10918/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010919 @brief Process Trigger BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010920 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010921
10922 @param pWDICtx: pointer to the WLAN DAL context
10923 pEventData: pointer to the event information structure
10924
Jeff Johnson295189b2012-06-20 16:38:30 -070010925 @see
10926 @return Result of the function call
10927*/
10928WDI_Status
10929WDI_ProcessTriggerBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010930(
Jeff Johnson295189b2012-06-20 16:38:30 -070010931 WDI_ControlBlockType* pWDICtx,
10932 WDI_EventInfoType* pEventData
10933)
10934{
10935 WDI_TriggerBAReqParamsType* pwdiTriggerBAParams;
10936 WDI_TriggerBARspCb wdiTriggerBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010937 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010938 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010939 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010940 wpt_uint16 usDataOffset = 0;
10941 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010942 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010943 wpt_uint16 index;
10944 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010945
Jeff Johnson295189b2012-06-20 16:38:30 -070010946 tTriggerBAReqMsg halTriggerBAReq;
10947 tTriggerBaReqCandidate* halTriggerBACandidate;
10948 WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate;
10949 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10950
10951 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010952 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010953 -------------------------------------------------------------------------*/
10954 if (( NULL == pEventData ) ||
10955 ( NULL == pEventData->pEventData ) ||
10956 ( NULL == pEventData->pCBfnc ))
10957 {
10958 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10959 "%s: Invalid parameters", __FUNCTION__);
10960 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010961 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010962 }
10963
10964 pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData;
10965 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc;
10966 /*-------------------------------------------------------------------------
10967 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010968 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010969 -------------------------------------------------------------------------*/
10970 wpalMutexAcquire(&pWDICtx->wptMutex);
10971
10972 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010973 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010974 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010975 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10976 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010977 &macBSSID))
10978 {
10979 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10980 "This station does not exist in the WDI Station Table %d");
10981 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010982 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010983 }
10984
Jeff Johnsone7245742012-09-05 17:12:55 -070010985 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10986 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010987 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010988 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10989 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10990 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010991
10992 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010993 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010994 }
10995
10996 /*------------------------------------------------------------------------
10997 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010998 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010999 ------------------------------------------------------------------------*/
11000 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
11001 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011002 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11003 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
11004 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070011005
Jeff Johnsone7245742012-09-05 17:12:55 -070011006 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070011007 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070011008 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011009 }
11010
11011
11012 wpalMutexRelease(&pWDICtx->wptMutex);
11013 /*-----------------------------------------------------------------------
11014 Get message buffer
11015 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011016 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11017 WDI_TRIGGER_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011018 sizeof(halTriggerBAReq.triggerBAParams) +
Jeff Johnsone7245742012-09-05 17:12:55 -070011019 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011020 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt),
11021 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011022 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070011023 (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+
Jeff Johnsone7245742012-09-05 17:12:55 -070011024 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011025 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) )))
11026 {
11027 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11028 "Unable to get send buffer in Trigger BA req %x %x %x",
11029 pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb);
11030 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011031 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011032 }
11033
Jeff Johnsone7245742012-09-05 17:12:55 -070011034 halTriggerBAReq.triggerBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070011035 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID;
Jeff Johnsone7245742012-09-05 17:12:55 -070011036 halTriggerBAReq.triggerBAParams.baCandidateCnt =
Jeff Johnson295189b2012-06-20 16:38:30 -070011037 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt;
11038
Jeff Johnsone7245742012-09-05 17:12:55 -070011039 wpalMemoryCopy( pSendBuffer+usDataOffset,
11040 &halTriggerBAReq.triggerBAParams,
11041 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011042
Jeff Johnsone7245742012-09-05 17:12:55 -070011043 wdiTriggerBACandidate =
Jeff Johnson295189b2012-06-20 16:38:30 -070011044 (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1);
11045 halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+
11046 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnsone7245742012-09-05 17:12:55 -070011047
11048 for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ;
Jeff Johnson295189b2012-06-20 16:38:30 -070011049 index++)
11050 {
11051 halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx;
11052 halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap;
11053 halTriggerBACandidate++;
11054 wdiTriggerBACandidate++;
11055 }
11056
11057 pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011058 pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011059
11060 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011061 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011062 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011063 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11064 wdiTriggerBARspCb, pEventData->pUserData,
11065 WDI_TRIGGER_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011066}/*WDI_ProcessTriggerBAReq*/
11067
11068
11069
11070/**
11071 @brief Process Update Beacon Params Request function (called when Main FSM
11072 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011073
11074 @param pWDICtx: pointer to the WLAN DAL context
11075 pEventData: pointer to the event information structure
11076
Jeff Johnson295189b2012-06-20 16:38:30 -070011077 @see
11078 @return Result of the function call
11079*/
11080WDI_Status
11081WDI_ProcessUpdateBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011082(
Jeff Johnson295189b2012-06-20 16:38:30 -070011083 WDI_ControlBlockType* pWDICtx,
11084 WDI_EventInfoType* pEventData
11085)
11086{
11087 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams;
11088 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011089 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011090 wpt_uint16 usDataOffset = 0;
11091 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011092 tUpdateBeaconParams halUpdateBeaconParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011093 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11094
11095 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011096 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011097 -------------------------------------------------------------------------*/
11098 if (( NULL == pEventData ) ||
11099 ( NULL == pEventData->pEventData) ||
11100 ( NULL == pEventData->pCBfnc))
11101 {
11102 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11103 "%s: Invalid parameters", __FUNCTION__);
11104 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011105 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011106 }
11107
11108 pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData;
11109 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc;
11110 /*-----------------------------------------------------------------------
11111 Get message buffer
11112 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011113 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011114 sizeof(halUpdateBeaconParams),
11115 &pSendBuffer, &usDataOffset, &usSendSize))||
11116 ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) )))
11117 {
11118 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11119 "Unable to get send buffer in set bss key req %x %x %x",
11120 pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb);
11121 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011122 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011123 }
11124
11125 /*BSS Index of the BSS*/
11126 halUpdateBeaconParams.bssIdx =
11127 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx;
11128 /*shortPreamble mode. HAL should update all the STA rates when it
11129 receives this message*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011130 halUpdateBeaconParams.fShortPreamble =
Jeff Johnson295189b2012-06-20 16:38:30 -070011131 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble;
11132 /* short Slot time.*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011133 halUpdateBeaconParams.fShortSlotTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070011134 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime;
11135 /* Beacon Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070011136 halUpdateBeaconParams.beaconInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011137 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval;
11138
11139 /*Protection related */
Jeff Johnsone7245742012-09-05 17:12:55 -070011140 halUpdateBeaconParams.llaCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011141 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011142 halUpdateBeaconParams.llbCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011143 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011144 halUpdateBeaconParams.llgCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011145 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011146 halUpdateBeaconParams.ht20MhzCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011147 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011148 halUpdateBeaconParams.llnNonGFCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011149 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011150 halUpdateBeaconParams.fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070011151 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport;
11152 halUpdateBeaconParams.fRIFSMode =
11153 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode;
Jeff Johnsone7245742012-09-05 17:12:55 -070011154 halUpdateBeaconParams.paramChangeBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070011155 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap;
11156
Jeff Johnsone7245742012-09-05 17:12:55 -070011157 wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams,
11158 sizeof(halUpdateBeaconParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011159
11160 pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011161 pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011162
11163 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011164 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011165 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011166 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11167 wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011168}/*WDI_ProcessUpdateBeaconParamsReq*/
11169
11170
11171
11172/**
11173 @brief Process Send Beacon template Request function (called when Main FSM
11174 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011175
11176 @param pWDICtx: pointer to the WLAN DAL context
11177 pEventData: pointer to the event information structure
11178
Jeff Johnson295189b2012-06-20 16:38:30 -070011179 @see
11180 @return Result of the function call
11181*/
11182WDI_Status
11183WDI_ProcessSendBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011184(
Jeff Johnson295189b2012-06-20 16:38:30 -070011185 WDI_ControlBlockType* pWDICtx,
11186 WDI_EventInfoType* pEventData
11187)
11188{
11189 WDI_SendBeaconParamsType* pwdiSendBeaconParams;
11190 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011191 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011192 wpt_uint16 usDataOffset = 0;
11193 wpt_uint16 usSendSize = 0;
11194 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11195
11196 tSendBeaconReqMsg halSendBeaconReq;
11197 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011198 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011199 -------------------------------------------------------------------------*/
11200 if (( NULL == pEventData ) ||
11201 ( NULL == pEventData->pEventData ) ||
11202 ( NULL == pEventData->pCBfnc ))
11203 {
11204 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11205 "%s: Invalid parameters", __FUNCTION__);
11206 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011207 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011208 }
11209
11210 pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData;
11211 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc;
11212 /*-----------------------------------------------------------------------
11213 Get message buffer
11214 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011215 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011216 sizeof(halSendBeaconReq.sendBeaconParam),
11217 &pSendBuffer, &usDataOffset, &usSendSize))||
11218 ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) )))
11219 {
11220 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11221 "Unable to get send buffer in send beacon req %x %x %x",
11222 pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb);
11223 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011224 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011225 }
11226
11227 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId,
11228 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID,
11229 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011230 halSendBeaconReq.sendBeaconParam.beaconLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070011231 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength;
11232 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon,
11233 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon,
11234 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength);
11235#ifdef WLAN_SOFTAP_FEATURE
Jeff Johnsone7245742012-09-05 17:12:55 -070011236 halSendBeaconReq.sendBeaconParam.timIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011237 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset;
11238#endif
11239#ifdef WLAN_FEATURE_P2P
Jeff Johnsone7245742012-09-05 17:12:55 -070011240 halSendBeaconReq.sendBeaconParam.p2pIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011241 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset;
11242#endif
11243
Jeff Johnsone7245742012-09-05 17:12:55 -070011244 wpalMemoryCopy( pSendBuffer+usDataOffset,
11245 &halSendBeaconReq.sendBeaconParam,
11246 sizeof(halSendBeaconReq.sendBeaconParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070011247
11248 pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011249 pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011250
11251 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011252 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011253 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011254 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11255 wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011256}/*WDI_ProcessSendBeaconParamsReq*/
11257
11258/**
11259 @brief Process Update Beacon Params Request function (called when Main FSM
11260 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011261
11262 @param pWDICtx: pointer to the WLAN DAL context
11263 pEventData: pointer to the event information structure
11264
Jeff Johnson295189b2012-06-20 16:38:30 -070011265 @see
11266 @return Result of the function call
11267*/
11268WDI_Status
11269WDI_ProcessUpdateProbeRspTemplateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011270(
Jeff Johnson295189b2012-06-20 16:38:30 -070011271 WDI_ControlBlockType* pWDICtx,
11272 WDI_EventInfoType* pEventData
11273)
11274{
11275 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams;
11276 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011277 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011278 wpt_uint16 usDataOffset = 0;
11279 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011280 tSendProbeRespReqParams halUpdateProbeRspTmplParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011281 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11282
11283 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011284 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011285 -------------------------------------------------------------------------*/
11286 if (( NULL == pEventData ) ||
11287 ( NULL == pEventData->pEventData) ||
11288 ( NULL == pEventData->pCBfnc))
11289 {
11290 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11291 "%s: Invalid parameters", __FUNCTION__);
11292 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011293 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011294 }
11295
Jeff Johnsone7245742012-09-05 17:12:55 -070011296 pwdiUpdateProbeRespTmplParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011297 (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011298 wdiUpdateProbeRespTmplRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011299 (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc;
11300 /*-----------------------------------------------------------------------
11301 Get message buffer
11302 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011303 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011304 sizeof(halUpdateProbeRspTmplParams),
11305 &pSendBuffer, &usDataOffset, &usSendSize))||
11306 ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) )))
11307 {
11308 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11309 "Unable to get send buffer in set bss key req %x %x %x",
11310 pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb);
11311 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011312 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011313 }
11314
11315 wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070011316 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070011317 WDI_MAC_ADDR_LEN);
11318
Jeff Johnsone7245742012-09-05 17:12:55 -070011319 halUpdateProbeRspTmplParams.probeRespTemplateLen =
Jeff Johnson295189b2012-06-20 16:38:30 -070011320 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen;
11321
11322 wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate,
11323 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070011324 BEACON_TEMPLATE_SIZE);
Jeff Johnson295189b2012-06-20 16:38:30 -070011325
11326
11327 wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap,
11328 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap,
11329 WDI_PROBE_REQ_BITMAP_IE_LEN);
11330
Jeff Johnsone7245742012-09-05 17:12:55 -070011331 wpalMemoryCopy( pSendBuffer+usDataOffset,
11332 &halUpdateProbeRspTmplParams,
11333 sizeof(halUpdateProbeRspTmplParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011334
11335 pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011336 pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011337
11338 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011339 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011340 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011341 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11342 wdiUpdateProbeRespTmplRspCb, pEventData->pUserData,
11343 WDI_UPD_PROBE_RSP_TEMPLATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011344}/*WDI_ProcessUpdateProbeRspTemplateReq*/
11345
11346/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011347 @brief Process NV blob download function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070011348 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011349
11350 @param pWDICtx: pointer to the WLAN DAL context
11351 pEventData: pointer to the event information structure
11352
Jeff Johnson295189b2012-06-20 16:38:30 -070011353 @see
11354 @return Result of the function call
11355*/
11356WDI_Status
11357WDI_ProcessNvDownloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011358(
Jeff Johnson295189b2012-06-20 16:38:30 -070011359 WDI_ControlBlockType* pWDICtx,
11360 WDI_EventInfoType* pEventData
11361)
11362{
11363
11364 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL;
11365 WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL;
11366
11367 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011368 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011369 -------------------------------------------------------------------------*/
11370 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011371 ( NULL == (pwdiNvDownloadReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011372 (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011373 ( NULL == (wdiNvDownloadRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011374 (WDI_NvDownloadRspCb)pEventData->pCBfnc)))
11375 {
11376 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11377 "%s: Invalid parameters", __FUNCTION__);
11378 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011379 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011380 }
11381
11382 /*Intialize the Nv Blob Info */
Jeff Johnsone7245742012-09-05 17:12:55 -070011383 pWDICtx->wdiNvBlobInfo.usTotalFragment =
Jeff Johnson295189b2012-06-20 16:38:30 -070011384 TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize);
11385
11386 /*cache the wdi nv request message here if the the first fragment
11387 * To issue the request to HAL for the next fragment */
11388 if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
11389 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011390 wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq,
11391 pwdiNvDownloadReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070011392 sizeof(pWDICtx->wdiCachedNvDownloadReq));
11393
11394 pWDICtx->pfncRspCB = pEventData->pCBfnc;
11395 pWDICtx->pRspCBUserData = pEventData->pUserData;
11396 }
11397
11398 return WDI_SendNvBlobReq(pWDICtx,pEventData);
11399}
11400
11401/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011402 @brief Process Set Max Tx Power Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011403 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011404
11405 @param pWDICtx: pointer to the WLAN DAL context
11406 pEventData: pointer to the event information structure
11407
Jeff Johnson295189b2012-06-20 16:38:30 -070011408 @see
11409 @return Result of the function call
11410*/
11411WDI_Status WDI_ProcessSetMaxTxPowerReq
11412(
11413 WDI_ControlBlockType* pWDICtx,
11414 WDI_EventInfoType* pEventData
11415)
11416{
11417 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL;
11418 WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011419 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011420 wpt_uint16 usDataOffset = 0;
11421 wpt_uint16 usSendSize = 0;
11422 tSetMaxTxPwrReq halSetMaxTxPower;
11423 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11424
11425 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011426 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011427 -------------------------------------------------------------------------*/
11428 if (( NULL == pEventData ) ||
11429 ( NULL == pEventData->pEventData ) ||
11430 ( NULL == pEventData->pCBfnc ))
11431 {
11432 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11433 "%s: Invalid parameters", __FUNCTION__);
11434 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011435 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011436 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011437 pwdiSetMaxTxPowerParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011438 (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011439 wdiSetMaxTxPowerRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011440 (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc;
11441
11442 /*-----------------------------------------------------------------------
11443 Get message buffer
11444 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011445if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011446 sizeof(halSetMaxTxPower.setMaxTxPwrParams),
11447 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011448 ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams)
Jeff Johnson295189b2012-06-20 16:38:30 -070011449)))
11450 {
11451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11452 "Unable to get Set Max Tx Power req %x %x %x",
11453 pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb);
11454 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011455 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011456 }
11457
11458 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId,
11459 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId,
11460 WDI_MAC_ADDR_LEN);
11461
11462 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr,
11463 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr,
11464 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011465 halSetMaxTxPower.setMaxTxPwrParams.power =
Jeff Johnson295189b2012-06-20 16:38:30 -070011466 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070011467
11468 wpalMemoryCopy( pSendBuffer+usDataOffset,
11469 &halSetMaxTxPower.setMaxTxPwrParams,
11470 sizeof(halSetMaxTxPower.setMaxTxPwrParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011471
11472 pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011473 pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011474
11475 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011476 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011477 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011478 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11479 wdiSetMaxTxPowerRspCb, pEventData->pUserData,
11480 WDI_SET_MAX_TX_POWER_RESP);
11481
Jeff Johnson295189b2012-06-20 16:38:30 -070011482}
11483
11484#ifdef WLAN_FEATURE_P2P
11485
11486/**
11487 @brief Process P2P Notice Of Absence Request function (called when Main FSM
11488 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011489
11490 @param pWDICtx: pointer to the WLAN DAL context
11491 pEventData: pointer to the event information structure
11492
Jeff Johnson295189b2012-06-20 16:38:30 -070011493 @see
11494 @return Result of the function call
11495*/
11496WDI_Status
11497WDI_ProcessP2PGONOAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011498(
Jeff Johnson295189b2012-06-20 16:38:30 -070011499 WDI_ControlBlockType* pWDICtx,
11500 WDI_EventInfoType* pEventData
11501)
11502{
11503 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams;
11504 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011505 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011506 wpt_uint16 usDataOffset = 0;
11507 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011508 tSetP2PGONOAParams halSetP2PGONOAParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011509 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11510
11511 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011512 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011513 -------------------------------------------------------------------------*/
11514 if (( NULL == pEventData ) ||
11515 ( NULL == pEventData->pEventData) ||
11516 ( NULL == pEventData->pCBfnc))
11517 {
11518 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11519 "%s: Invalid parameters", __FUNCTION__);
11520 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011521 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011522 }
11523
Jeff Johnsone7245742012-09-05 17:12:55 -070011524 pwdiP2PGONOAReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011525 (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011526 wdiP2PGONOAReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011527 (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc;
11528 /*-----------------------------------------------------------------------
11529 Get message buffer
11530 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011531 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11532 WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011533 sizeof(halSetP2PGONOAParams),
11534 &pSendBuffer, &usDataOffset, &usSendSize))||
11535 ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) )))
11536 {
11537 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11538 "Unable to get send buffer in set P2P GO NOA REQ %x %x %x",
11539 pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb);
11540 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011541 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011542 }
11543
Jeff Johnsone7245742012-09-05 17:12:55 -070011544 halSetP2PGONOAParams.opp_ps =
Jeff Johnson295189b2012-06-20 16:38:30 -070011545 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps;
Jeff Johnsone7245742012-09-05 17:12:55 -070011546 halSetP2PGONOAParams.ctWindow =
Jeff Johnson295189b2012-06-20 16:38:30 -070011547 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow;
11548 halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount;
Jeff Johnsone7245742012-09-05 17:12:55 -070011549 halSetP2PGONOAParams.duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011550 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011551 halSetP2PGONOAParams.interval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011552 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070011553 halSetP2PGONOAParams.single_noa_duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011554 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011555 halSetP2PGONOAParams.psSelection =
Jeff Johnson295189b2012-06-20 16:38:30 -070011556 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection;
11557
Jeff Johnsone7245742012-09-05 17:12:55 -070011558 wpalMemoryCopy( pSendBuffer+usDataOffset,
11559 &halSetP2PGONOAParams,
11560 sizeof(halSetP2PGONOAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011561
11562 pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011563 pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011564
11565 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011566 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011567 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011568 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11569 wdiP2PGONOAReqRspCb, pEventData->pUserData,
11570 WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011571}/*WDI_ProcessP2PGONOAReq*/
11572
11573#endif
11574
11575
11576/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011577 @brief Function to handle the ack from DXE once the power
Jeff Johnson295189b2012-06-20 16:38:30 -070011578 state is set.
Jeff Johnsone7245742012-09-05 17:12:55 -070011579 @param None
11580
11581 @see
11582 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070011583*/
11584void
11585WDI_SetPowerStateCb
11586(
11587 wpt_status status,
11588 unsigned int dxePhyAddr,
11589 void *pContext
11590)
11591{
11592 wpt_status wptStatus;
11593 WDI_ControlBlockType *pCB = NULL;
11594 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
11595 if(eWLAN_PAL_STATUS_E_FAILURE == status )
11596 {
11597 //it shouldn't happen, put an error msg
11598 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011599 /*
11600 * Trigger the event to bring the Enter BMPS req function to come
11601 * out of wait
Jeff Johnson295189b2012-06-20 16:38:30 -070011602*/
11603 if( NULL != pContext )
11604 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011605 pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnson295189b2012-06-20 16:38:30 -070011606 }
11607 else
11608 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011609 //put an error msg
Jeff Johnson295189b2012-06-20 16:38:30 -070011610 pCB = &gWDICb;
11611 }
11612 pCB->dxePhyAddr = dxePhyAddr;
11613 wptStatus = wpalEventSet(&pCB->setPowerStateEvent);
11614 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
11615 {
11616 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11617 "Failed to set an event");
11618
Jeff Johnsone7245742012-09-05 17:12:55 -070011619 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011620 }
11621 return;
11622}
11623
11624
11625/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011626 @brief Process Enter IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011627 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011628
11629 @param pWDICtx: pointer to the WLAN DAL context
11630 pEventData: pointer to the event information structure
11631
Jeff Johnson295189b2012-06-20 16:38:30 -070011632 @see
11633 @return Result of the function call
11634*/
11635WDI_Status
11636WDI_ProcessEnterImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011637(
Jeff Johnson295189b2012-06-20 16:38:30 -070011638 WDI_ControlBlockType* pWDICtx,
11639 WDI_EventInfoType* pEventData
11640)
11641{
Jeff Johnson43971f52012-07-17 12:26:56 -070011642 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011643 WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011644 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011645 wpt_uint16 usDataOffset = 0;
11646 wpt_uint16 usSendSize = 0;
11647 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11648
11649 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011650 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011651 -------------------------------------------------------------------------*/
11652 if (( NULL == pEventData ) ||
11653 ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc)))
11654 {
11655 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11656 "%s: Invalid parameters", __FUNCTION__);
11657 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011658 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011659 }
11660
11661 /*-----------------------------------------------------------------------
11662 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011663 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011664 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011665 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011666 0,
11667 &pSendBuffer, &usDataOffset, &usSendSize))||
11668 ( usSendSize < (usDataOffset )))
11669 {
11670 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11671 "Unable to get send buffer in Enter IMPS req %x %x",
11672 pEventData, wdiEnterImpsRspCb);
11673 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011674 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011675 }
11676
11677 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011678 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11679 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011680 {
11681 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11682 "WDI Init failed to reset an event");
11683
Jeff Johnsone7245742012-09-05 17:12:55 -070011684 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011685 return VOS_STATUS_E_FAILURE;
11686 }
11687
11688 // notify DTS that we are entering IMPS
11689 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb);
11690
11691 /*
Jeff Johnsone7245742012-09-05 17:12:55 -070011692 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011693 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011694 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11695 WDI_SET_POWER_STATE_TIMEOUT);
11696 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011697 {
11698 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11699 "WDI Init failed to wait on an event");
11700
Jeff Johnsone7245742012-09-05 17:12:55 -070011701 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011702 return VOS_STATUS_E_FAILURE;
11703 }
11704
11705 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011706 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011707 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011708 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11709 wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011710}/*WDI_ProcessEnterImpsReq*/
11711
11712/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011713 @brief Process Exit IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011714 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011715
11716 @param pWDICtx: pointer to the WLAN DAL context
11717 pEventData: pointer to the event information structure
11718
Jeff Johnson295189b2012-06-20 16:38:30 -070011719 @see
11720 @return Result of the function call
11721*/
11722WDI_Status
11723WDI_ProcessExitImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011724(
Jeff Johnson295189b2012-06-20 16:38:30 -070011725 WDI_ControlBlockType* pWDICtx,
11726 WDI_EventInfoType* pEventData
11727)
11728{
11729 WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011730 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011731 wpt_uint16 usDataOffset = 0;
11732 wpt_uint16 usSendSize = 0;
11733 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11734
11735 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011736 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011737 -------------------------------------------------------------------------*/
11738 if (( NULL == pEventData ) ||
11739 ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc)))
11740 {
11741 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11742 "%s: Invalid parameters", __FUNCTION__);
11743 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011744 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011745 }
11746
11747 /*-----------------------------------------------------------------------
11748 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011749 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011750 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011751 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011752 0,
11753 &pSendBuffer, &usDataOffset, &usSendSize))||
11754 ( usSendSize < (usDataOffset )))
11755 {
11756 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11757 "Unable to get send buffer in Exit IMPS req %x %x",
11758 pEventData, wdiExitImpsRspCb);
11759 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011760 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011761 }
11762
11763 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011764 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011765 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011766 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11767 wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011768}/*WDI_ProcessExitImpsReq*/
11769
11770/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011771 @brief Process Enter BMPS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011772 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011773
11774 @param pWDICtx: pointer to the WLAN DAL context
11775 pEventData: pointer to the event information structure
11776
Jeff Johnson295189b2012-06-20 16:38:30 -070011777 @see
11778 @return Result of the function call
11779*/
11780WDI_Status
11781WDI_ProcessEnterBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011782(
Jeff Johnson295189b2012-06-20 16:38:30 -070011783 WDI_ControlBlockType* pWDICtx,
11784 WDI_EventInfoType* pEventData
11785)
11786{
11787 WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL;
11788 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011789 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011790 wpt_uint16 usDataOffset = 0;
11791 wpt_uint16 usSendSize = 0;
11792 tHalEnterBmpsReqParams enterBmpsReq;
Jeff Johnson43971f52012-07-17 12:26:56 -070011793 wpt_status wptStatus;
11794
Jeff Johnson295189b2012-06-20 16:38:30 -070011795 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11796
11797 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011798 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011799 -------------------------------------------------------------------------*/
11800 if (( NULL == pEventData ) ||
11801 ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) ||
11802 ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc)))
11803 {
11804 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11805 "%s: Invalid parameters", __FUNCTION__);
11806 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011807 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011808 }
11809
11810 /*-----------------------------------------------------------------------
11811 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011812 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011813 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011814 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011815 sizeof(enterBmpsReq),
11816 &pSendBuffer, &usDataOffset, &usSendSize))||
11817 ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) )))
11818 {
11819 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11820 "Unable to get send buffer in Enter BMPS req %x %x %x",
11821 pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb);
11822 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011823 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011824 }
11825
11826 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011827 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11828 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011829 {
11830 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11831 "WDI Init failed to reset an event");
11832
Jeff Johnsone7245742012-09-05 17:12:55 -070011833 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011834 return VOS_STATUS_E_FAILURE;
11835 }
11836
11837 // notify DTS that we are entering BMPS
11838 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb);
11839
11840/*
Jeff Johnsone7245742012-09-05 17:12:55 -070011841 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011842 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011843 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11844 WDI_SET_POWER_STATE_TIMEOUT);
11845 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011846 {
11847 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11848 "WDI Init failed to wait on an event");
11849
Jeff Johnsone7245742012-09-05 17:12:55 -070011850 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011851 return VOS_STATUS_E_FAILURE;
11852 }
11853
11854 pWDICtx->bInBmps = eWLAN_PAL_TRUE;
11855
11856 enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx;
11857 enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt;
11858 enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount;
11859 enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod;
11860
11861 // For CCX and 11R Roaming
11862 enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod;
11863 enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage;
11864 enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable;
11865
11866 wpalMemoryCopy( pSendBuffer+usDataOffset,
11867 &enterBmpsReq,
11868 sizeof(enterBmpsReq));
11869
11870 pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011871 pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011872
11873 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011874 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011875 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011876 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11877 wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011878}/*WDI_ProcessEnterBmpsReq*/
11879
11880/**
11881 @brief Process Exit BMPS Request function (called when Main FSM
11882 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011883
11884 @param pWDICtx: pointer to the WLAN DAL context
11885 pEventData: pointer to the event information structure
11886
Jeff Johnson295189b2012-06-20 16:38:30 -070011887 @see
11888 @return Result of the function call
11889*/
11890WDI_Status
11891WDI_ProcessExitBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011892(
Jeff Johnson295189b2012-06-20 16:38:30 -070011893 WDI_ControlBlockType* pWDICtx,
11894 WDI_EventInfoType* pEventData
11895)
11896{
11897 WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL;
11898 WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011899 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011900 wpt_uint16 usDataOffset = 0;
11901 wpt_uint16 usSendSize = 0;
11902 tHalExitBmpsReqParams exitBmpsReq;
11903 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11904
11905 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011906 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011907 -------------------------------------------------------------------------*/
11908 if (( NULL == pEventData ) ||
11909 ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) ||
11910 ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc)))
11911 {
11912 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11913 "%s: Invalid parameters", __FUNCTION__);
11914 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011915 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011916 }
11917
11918 /*-----------------------------------------------------------------------
11919 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011920 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011921 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011922 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011923 sizeof(exitBmpsReq),
11924 &pSendBuffer, &usDataOffset, &usSendSize))||
11925 ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) )))
11926 {
11927 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11928 "Unable to get send buffer in Exit BMPS req %x %x %x",
11929 pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb);
11930 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011931 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011932 }
11933 exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull;
11934
Jeff Johnsone7245742012-09-05 17:12:55 -070011935 exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx;
11936
Jeff Johnson295189b2012-06-20 16:38:30 -070011937 wpalMemoryCopy( pSendBuffer+usDataOffset,
11938 &exitBmpsReq,
11939 sizeof(exitBmpsReq));
11940
11941 pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011942 pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011943
11944 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011945 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011946 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011947 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11948 wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011949}/*WDI_ProcessExitBmpsReq*/
11950
11951/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011952 @brief Process Enter UAPSD Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011953 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011954
11955 @param pWDICtx: pointer to the WLAN DAL context
11956 pEventData: pointer to the event information structure
11957
Jeff Johnson295189b2012-06-20 16:38:30 -070011958 @see
11959 @return Result of the function call
11960*/
11961WDI_Status
11962WDI_ProcessEnterUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011963(
Jeff Johnson295189b2012-06-20 16:38:30 -070011964 WDI_ControlBlockType* pWDICtx,
11965 WDI_EventInfoType* pEventData
11966)
11967{
11968 WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL;
11969 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011970 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011971 wpt_uint16 usDataOffset = 0;
11972 wpt_uint16 usSendSize = 0;
11973 tUapsdReqParams enterUapsdReq;
11974 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11975
11976 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011977 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011978 -------------------------------------------------------------------------*/
11979 if (( NULL == pEventData ) ||
11980 ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) ||
11981 ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc)))
11982 {
11983 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11984 "%s: Invalid parameters", __FUNCTION__);
11985 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011986 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011987 }
11988
11989 /*-----------------------------------------------------------------------
11990 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011991 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011992 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011993 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011994 sizeof(enterUapsdReq),
11995 &pSendBuffer, &usDataOffset, &usSendSize))||
11996 ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) )))
11997 {
11998 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11999 "Unable to get send buffer in Enter UAPSD req %x %x %x",
12000 pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb);
12001 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012002 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012003 }
12004
12005 enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled;
12006 enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled;
12007 enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled;
12008 enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled;
12009 enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled;
12010 enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled;
12011 enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled;
12012 enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070012013 enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070012014
Jeff Johnsone7245742012-09-05 17:12:55 -070012015 wpalMemoryCopy( pSendBuffer+usDataOffset,
12016 &enterUapsdReq,
12017 sizeof(enterUapsdReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012018
12019 pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012020 pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012021
12022 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012023 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012024 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012025 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12026 wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012027}/*WDI_ProcessEnterUapsdReq*/
12028
12029/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012030 @brief Process Exit UAPSD Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012031 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012032
12033 @param pWDICtx: pointer to the WLAN DAL context
12034 pEventData: pointer to the event information structure
12035
Jeff Johnson295189b2012-06-20 16:38:30 -070012036 @see
12037 @return Result of the function call
12038*/
12039WDI_Status
12040WDI_ProcessExitUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012041(
Jeff Johnson295189b2012-06-20 16:38:30 -070012042 WDI_ControlBlockType* pWDICtx,
12043 WDI_EventInfoType* pEventData
12044)
12045{
12046 WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012047 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012048 wpt_uint16 usDataOffset = 0;
12049 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012050 WDI_ExitUapsdReqParamsType *pExitUapsdparams;
12051 wpt_uint8 bssIdx = 0;
12052
Jeff Johnson295189b2012-06-20 16:38:30 -070012053 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12054
12055 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012056 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012057 -------------------------------------------------------------------------*/
12058 if (( NULL == pEventData ) ||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012059 ( NULL == (pExitUapsdparams = (WDI_ExitUapsdReqParamsType *)pEventData->pEventData)) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070012060 ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc)))
12061 {
12062 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12063 "%s: Invalid parameters", __FUNCTION__);
12064 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012065 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012066 }
12067
12068 /*-----------------------------------------------------------------------
12069 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012070 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012071 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012072 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012073 sizeof(wpt_uint8),
Jeff Johnson295189b2012-06-20 16:38:30 -070012074 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012075 ( usSendSize < (usDataOffset + sizeof(wpt_uint8))))
Jeff Johnson295189b2012-06-20 16:38:30 -070012076 {
12077 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12078 "Unable to get send buffer in Exit UAPSD req %x %x",
12079 pEventData, wdiExitUapsdRspCb);
12080 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012081 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012082 }
12083
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012084 bssIdx = pExitUapsdparams->wdiExitUapsdInfo.bssIdx;
12085
12086 wpalMemoryCopy( pSendBuffer+usDataOffset,
12087 &bssIdx,
12088 sizeof(wpt_uint8));
12089
12090 pWDICtx->wdiReqStatusCB = pExitUapsdparams->wdiReqStatusCB;
12091 pWDICtx->pReqStatusUserData = pExitUapsdparams->pUserData;
12092
Jeff Johnson295189b2012-06-20 16:38:30 -070012093 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012094 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012095 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012096 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12097 wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012098}/*WDI_ProcessExitUapsdReq*/
12099
12100/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012101 @brief Process Set UAPSD params Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012102 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012103
12104 @param pWDICtx: pointer to the WLAN DAL context
12105 pEventData: pointer to the event information structure
12106
Jeff Johnson295189b2012-06-20 16:38:30 -070012107 @see
12108 @return Result of the function call
12109*/
12110WDI_Status
12111WDI_ProcessSetUapsdAcParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012112(
Jeff Johnson295189b2012-06-20 16:38:30 -070012113 WDI_ControlBlockType* pWDICtx,
12114 WDI_EventInfoType* pEventData
12115)
12116{
12117 WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL;
12118 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012119 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012120 wpt_uint16 usDataOffset = 0;
12121 wpt_uint16 usSendSize = 0;
12122 tUapsdInfo uapsdAcParamsReq;
12123 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12124
12125 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012126 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012127 -------------------------------------------------------------------------*/
12128 if (( NULL == pEventData ) ||
12129 ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) ||
12130 ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc)))
12131 {
12132 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12133 "%s: Invalid parameters", __FUNCTION__);
12134 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012135 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012136 }
12137
12138 /*-----------------------------------------------------------------------
12139 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012140 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012141 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012142 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012143 sizeof(uapsdAcParamsReq),
12144 &pSendBuffer, &usDataOffset, &usSendSize))||
12145 ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) )))
12146 {
12147 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12148 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12149 pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb);
12150 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012151 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012152 }
12153
12154 uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc;
12155 uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx;
12156 uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp;
12157 uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval;
12158 uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval;
12159 uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval;
12160
Jeff Johnsone7245742012-09-05 17:12:55 -070012161 wpalMemoryCopy( pSendBuffer+usDataOffset,
12162 &uapsdAcParamsReq,
12163 sizeof(uapsdAcParamsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012164
12165 pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012166 pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012167
12168 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012169 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012170 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012171 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12172 wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012173}/*WDI_ProcessSetUapsdAcParamsReq*/
12174
12175/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012176 @brief Process update UAPSD params Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012177 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012178
12179 @param pWDICtx: pointer to the WLAN DAL context
12180 pEventData: pointer to the event information structure
12181
Jeff Johnson295189b2012-06-20 16:38:30 -070012182 @see
12183 @return Result of the function call
12184*/
12185WDI_Status
12186WDI_ProcessUpdateUapsdParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012187(
Jeff Johnson295189b2012-06-20 16:38:30 -070012188 WDI_ControlBlockType* pWDICtx,
12189 WDI_EventInfoType* pEventData
12190)
12191{
12192 WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL;
12193 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012194 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012195 wpt_uint16 usDataOffset = 0;
12196 wpt_uint16 usSendSize = 0;
12197 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12198
12199 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012200 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012201 -------------------------------------------------------------------------*/
12202 if (( NULL == pEventData ) ||
12203 ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) ||
12204 ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc)))
12205 {
12206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12207 "%s: Invalid parameters", __FUNCTION__);
12208 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012209 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012210 }
12211
12212 /*-----------------------------------------------------------------------
12213 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012214 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012215 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012216 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012217 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo),
12218 &pSendBuffer, &usDataOffset, &usSendSize))||
12219 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) )))
12220 {
12221 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12222 "Unable to get send buffer in Update UAPSD params req %x %x %x",
12223 pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb);
12224 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012225 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012226 }
12227
Jeff Johnsone7245742012-09-05 17:12:55 -070012228 wpalMemoryCopy( pSendBuffer+usDataOffset,
12229 &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo,
12230 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012231
12232 pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012233 pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012234
12235 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012236 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012237 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012238 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12239 wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012240}/*WDI_ProcessUpdateUapsdParamsReq*/
12241
12242/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012243 @brief Process Configure RXP filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012244 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012245
12246 @param pWDICtx: pointer to the WLAN DAL context
12247 pEventData: pointer to the event information structure
12248
Jeff Johnson295189b2012-06-20 16:38:30 -070012249 @see
12250 @return Result of the function call
12251*/
12252WDI_Status
12253WDI_ProcessConfigureRxpFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012254(
Jeff Johnson295189b2012-06-20 16:38:30 -070012255 WDI_ControlBlockType* pWDICtx,
12256 WDI_EventInfoType* pEventData
12257)
12258{
12259 WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL;
12260 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012261 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012262 wpt_uint16 usDataOffset = 0;
12263 wpt_uint16 usSendSize = 0;
12264 tHalConfigureRxpFilterReqParams halRxpFilterParams;
12265
12266 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12267
12268 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012269 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012270 -------------------------------------------------------------------------*/
12271 if (( NULL == pEventData ) ||
12272 ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) ||
12273 ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc)))
12274 {
12275 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12276 "%s: Invalid parameters", __FUNCTION__);
12277 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012278 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012279 }
12280
12281 /*-----------------------------------------------------------------------
12282 Get message buffer
12283 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012284 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012285 sizeof(halRxpFilterParams),
12286 &pSendBuffer, &usDataOffset, &usSendSize))||
12287 ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) )))
12288 {
12289 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12290 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12291 pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb);
12292 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012293 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012294 }
12295
Jeff Johnsone7245742012-09-05 17:12:55 -070012296 halRxpFilterParams.setMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070012297 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070012298 halRxpFilterParams.setMcstBcstFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070012299 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter;
12300
Jeff Johnsone7245742012-09-05 17:12:55 -070012301 wpalMemoryCopy( pSendBuffer+usDataOffset,
12302 &halRxpFilterParams,
12303 sizeof(halRxpFilterParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070012304
12305 pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012306 pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012307
12308 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012309 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012310 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012311 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12312 wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012313}/*WDI_ProcessConfigureRxpFilterReq*/
12314
12315/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012316 @brief Process set beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012317 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012318
12319 @param pWDICtx: pointer to the WLAN DAL context
12320 pEventData: pointer to the event information structure
12321
Jeff Johnson295189b2012-06-20 16:38:30 -070012322 @see
12323 @return Result of the function call
12324*/
12325WDI_Status
12326WDI_ProcessSetBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012327(
Jeff Johnson295189b2012-06-20 16:38:30 -070012328 WDI_ControlBlockType* pWDICtx,
12329 WDI_EventInfoType* pEventData
12330)
12331{
12332 WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12333 WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012334 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012335 wpt_uint16 usDataOffset = 0;
12336 wpt_uint16 usSendSize = 0;
12337 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12338
12339 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012340 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012341 -------------------------------------------------------------------------*/
12342 if (( NULL == pEventData ) ||
12343 ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) ||
12344 ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc)))
12345 {
12346 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12347 "%s: Invalid parameters", __FUNCTION__);
12348 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012349 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012350 }
12351
12352 /*-----------------------------------------------------------------------
12353 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012354 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012355 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012356 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012357 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe),
12358 &pSendBuffer, &usDataOffset, &usSendSize))||
12359 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12360 {
12361 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12362 "Unable to get send buffer in Set beacon filter req %x %x %x",
12363 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12364 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012365 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012366 }
12367
Jeff Johnsone7245742012-09-05 17:12:55 -070012368 wpalMemoryCopy( pSendBuffer+usDataOffset,
12369 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12370 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12371 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12372 &pwdiBeaconFilterParams->aFilters[0],
12373 pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe));
Jeff Johnson295189b2012-06-20 16:38:30 -070012374
12375 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012376 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012377
12378 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012379 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012380 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012381 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12382 wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012383}/*WDI_ProcessSetBeaconFilterReq*/
12384
12385/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012386 @brief Process remove beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012387 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012388
12389 @param pWDICtx: pointer to the WLAN DAL context
12390 pEventData: pointer to the event information structure
12391
Jeff Johnson295189b2012-06-20 16:38:30 -070012392 @see
12393 @return Result of the function call
12394*/
12395WDI_Status
12396WDI_ProcessRemBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012397(
Jeff Johnson295189b2012-06-20 16:38:30 -070012398 WDI_ControlBlockType* pWDICtx,
12399 WDI_EventInfoType* pEventData
12400)
12401{
12402 WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12403 WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012404 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012405 wpt_uint16 usDataOffset = 0;
12406 wpt_uint16 usSendSize = 0;
12407 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12408
12409 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012410 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012411 -------------------------------------------------------------------------*/
12412 if (( NULL == pEventData ) ||
12413 ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) ||
12414 ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc)))
12415 {
12416 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12417 "%s: Invalid parameters", __FUNCTION__);
12418 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012419 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012420 }
12421
12422 /*-----------------------------------------------------------------------
12423 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012424 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012425 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012426 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012427 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12428 &pSendBuffer, &usDataOffset, &usSendSize))||
12429 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12430 {
12431 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12432 "Unable to get send buffer in remove beacon filter req %x %x %x",
12433 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12434 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012435 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012436 }
12437
Jeff Johnsone7245742012-09-05 17:12:55 -070012438 wpalMemoryCopy( pSendBuffer+usDataOffset,
12439 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12440 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012441
12442 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012443 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012444
12445 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012446 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012447 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012448 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12449 wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012450}
12451
12452/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012453 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012454 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012455
12456 @param pWDICtx: pointer to the WLAN DAL context
12457 pEventData: pointer to the event information structure
12458
Jeff Johnson295189b2012-06-20 16:38:30 -070012459 @see
12460 @return Result of the function call
12461*/
12462WDI_Status
12463WDI_ProcessSetRSSIThresholdsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012464(
Jeff Johnson295189b2012-06-20 16:38:30 -070012465 WDI_ControlBlockType* pWDICtx,
12466 WDI_EventInfoType* pEventData
12467)
12468{
12469 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL;
12470 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012471 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012472 wpt_uint16 usDataOffset = 0;
12473 wpt_uint16 usSendSize = 0;
12474 tHalRSSIThresholds rssiThresholdsReq;
12475 WDI_Status ret_status = 0;
12476 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12477
12478 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012479 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012480 -------------------------------------------------------------------------*/
12481 if (( NULL == pEventData ) ||
12482 ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) ||
12483 ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc)))
12484 {
12485 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12486 "%s: Invalid parameters", __FUNCTION__);
12487 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012488 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012489 }
12490
12491 /*-----------------------------------------------------------------------
12492 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012493 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012494 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012495 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012496 sizeof(rssiThresholdsReq),
12497 &pSendBuffer, &usDataOffset, &usSendSize))||
12498 ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) )))
12499 {
12500 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12501 "Unable to get send buffer in remove beacon filter req %x %x %x",
12502 pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb);
12503 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012504 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012505 }
12506
Jeff Johnsone7245742012-09-05 17:12:55 -070012507 rssiThresholdsReq.bReserved10 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012508 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10;
Jeff Johnsone7245742012-09-05 17:12:55 -070012509 rssiThresholdsReq.bRssiThres1NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012510 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012511 rssiThresholdsReq.bRssiThres1PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012512 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012513 rssiThresholdsReq.bRssiThres2NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012514 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012515 rssiThresholdsReq.bRssiThres2PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012516 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012517 rssiThresholdsReq.bRssiThres3NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012518 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012519 rssiThresholdsReq.bRssiThres3PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012520 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012521 rssiThresholdsReq.ucRssiThreshold1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012522 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1;
Jeff Johnsone7245742012-09-05 17:12:55 -070012523 rssiThresholdsReq.ucRssiThreshold2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012524 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2;
Jeff Johnsone7245742012-09-05 17:12:55 -070012525 rssiThresholdsReq.ucRssiThreshold3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012526 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3;
12527
Jeff Johnsone7245742012-09-05 17:12:55 -070012528 wpalMemoryCopy( pSendBuffer+usDataOffset,
12529 &rssiThresholdsReq,
12530 sizeof(rssiThresholdsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012531
12532 pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012533 pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012534
12535 /*-------------------------------------------------------------------------
12536 Send Set threshold req to HAL
12537 -------------------------------------------------------------------------*/
12538 if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12539 wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS)
12540 {
12541 // When we are in idle state WDI_STARTED_ST and we receive indication for threshold
12542 // req. Then as a result of processing the threshold cross ind, we trigger
12543 // a Set threshold req, then we need to indicate to WDI that it needs to
12544 // go to busy state as a result of the indication as we sent a req in the
12545 // same WDI context.
12546 // Hence expected state transition is to busy.
12547 pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST;
12548 }
12549
12550 return ret_status;
12551}
12552
12553/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012554 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012555 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012556
12557 @param pWDICtx: pointer to the WLAN DAL context
12558 pEventData: pointer to the event information structure
12559
Jeff Johnson295189b2012-06-20 16:38:30 -070012560 @see
12561 @return Result of the function call
12562*/
12563WDI_Status
12564WDI_ProcessHostOffloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012565(
Jeff Johnson295189b2012-06-20 16:38:30 -070012566 WDI_ControlBlockType* pWDICtx,
12567 WDI_EventInfoType* pEventData
12568)
12569{
12570 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL;
12571 WDI_HostOffloadCb wdiHostOffloadCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012572 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012573 wpt_uint16 usDataOffset = 0;
12574 wpt_uint16 usSendSize = 0;
12575 tHalHostOffloadReq hostOffloadParams;
12576 tHalNSOffloadParams nsOffloadParams;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012577 wpt_uint8 ucCurrentBSSSesIdx = 0;
12578 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012579
12580 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12581
12582 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012583 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012584 -------------------------------------------------------------------------*/
12585 if (( NULL == pEventData ) ||
12586 ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) ||
12587 ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc)))
12588 {
12589 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12590 "%s: Invalid parameters", __FUNCTION__);
12591 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012592 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012593 }
12594
12595 /*-----------------------------------------------------------------------
12596 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012597 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012598 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012599 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012600 sizeof(hostOffloadParams)+sizeof(nsOffloadParams),
12601 &pSendBuffer, &usDataOffset, &usSendSize))||
12602 ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) )))
12603 {
12604 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12605 "Unable to get send buffer in host offload req %x %x %x",
12606 pEventData, pwdiHostOffloadParams, wdiHostOffloadCb);
12607 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012608 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012609 }
12610
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012611 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12612 pwdiHostOffloadParams->wdiHostOffloadInfo.bssId,
12613 &pBSSSes);
12614 if ( NULL == pBSSSes )
12615 {
12616 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12617 " %s : Association for this BSSID does not exist",__FUNCTION__);
12618 return WDI_STATUS_E_FAILURE;
12619 }
12620
Jeff Johnson295189b2012-06-20 16:38:30 -070012621 hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType;
12622 hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012623
Jeff Johnson295189b2012-06-20 16:38:30 -070012624 if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType )
12625 {
12626 // ARP Offload
12627 wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr,
12628 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr,
12629 4);
12630 }
12631 else
12632 {
12633 // NS Offload
12634 wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr,
12635 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr,
12636 16);
12637
12638#ifdef WLAN_NS_OFFLOAD
12639 // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams
12640 wpalMemoryCopy(nsOffloadParams.srcIPv6Addr,
12641 pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr,
12642 16);
12643 wpalMemoryCopy(nsOffloadParams.selfIPv6Addr,
12644 pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr,
12645 16);
12646 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1,
12647 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1,
12648 16);
12649 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2,
12650 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2,
12651 16);
12652 wpalMemoryCopy(nsOffloadParams.selfMacAddr,
12653 pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr,
12654 6);
12655 nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid;
12656 nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid;
12657 nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid;
Jeff Johnsone7245742012-09-05 17:12:55 -070012658
Jeff Johnson295189b2012-06-20 16:38:30 -070012659#endif // WLAN_NS_OFFLOAD
12660 }
12661
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012662 nsOffloadParams.bssIdx = pBSSSes->ucBSSIdx;
12663
Jeff Johnson295189b2012-06-20 16:38:30 -070012664 // copy hostOffloadParams into pSendBuffer
12665 wpalMemoryCopy( pSendBuffer+usDataOffset,
12666 &hostOffloadParams,
12667 sizeof(hostOffloadParams));
12668
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012669 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) )
Jeff Johnson295189b2012-06-20 16:38:30 -070012670 {
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012671 // copy nsOffloadParams into pSendBuffer
12672 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070012673 &nsOffloadParams,
12674 sizeof(nsOffloadParams));
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012675 }
12676 else
12677 {
12678#ifdef WLAN_NS_OFFLOAD
12679 if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType )
12680 {
12681 // copy nsOffloadParams into pSendBuffer
12682 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
12683 &nsOffloadParams,
12684 sizeof(nsOffloadParams));
12685 }
12686#endif
12687 }
Jeff Johnson295189b2012-06-20 16:38:30 -070012688
12689 pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012690 pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012691
12692 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012693 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012694 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012695 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12696 wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012697}/*WDI_ProcessHostOffloadReq*/
12698
12699/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012700 @brief Process Keep Alive Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012701 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012702
12703 @param pWDICtx: pointer to the WLAN DAL context
12704 pEventData: pointer to the event information structure
12705
Jeff Johnson295189b2012-06-20 16:38:30 -070012706 @see
12707 @return Result of the function call
12708*/
12709WDI_Status
12710WDI_ProcessKeepAliveReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012711(
Jeff Johnson295189b2012-06-20 16:38:30 -070012712 WDI_ControlBlockType* pWDICtx,
12713 WDI_EventInfoType* pEventData
12714)
12715{
12716 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL;
12717 WDI_KeepAliveCb wdiKeepAliveCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012718 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012719 wpt_uint16 usDataOffset = 0;
12720 wpt_uint16 usSendSize = 0;
12721 tHalKeepAliveReq keepAliveReq;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012722 wpt_uint8 ucCurrentBSSSesIdx = 0;
12723 WDI_BSSSessionType* pBSSSes = NULL;
12724
Jeff Johnson295189b2012-06-20 16:38:30 -070012725 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12726
12727 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012728 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012729 -------------------------------------------------------------------------*/
12730 if (( NULL == pEventData ) ||
12731 ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) ||
12732 ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc)))
12733 {
12734 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12735 "Invalid parameters in Keep Alive req");
12736 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012737 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012738 }
12739
12740 /*-----------------------------------------------------------------------
12741 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012742 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012743 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012744 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012745 sizeof(keepAliveReq),
12746 &pSendBuffer, &usDataOffset, &usSendSize))||
12747 ( usSendSize < (usDataOffset + sizeof(keepAliveReq) )))
12748 {
12749 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12750 "Unable to get send buffer in keep alive req %x %x %x",
12751 pEventData, pwdiKeepAliveParams, wdiKeepAliveCb);
12752 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012753 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012754 }
12755
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012756 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12757 pwdiKeepAliveParams->wdiKeepAliveInfo.bssId,
12758 &pBSSSes);
12759 if ( NULL == pBSSSes )
12760 {
12761 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12762 " %s : Association for this BSSID does not exist",__FUNCTION__);
12763 return WDI_STATUS_E_FAILURE;
12764 }
12765
Jeff Johnson295189b2012-06-20 16:38:30 -070012766 keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType;
12767 keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod;
12768
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012769 keepAliveReq.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070012770
Jeff Johnson295189b2012-06-20 16:38:30 -070012771 if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2)
12772 {
12773 wpalMemoryCopy(keepAliveReq.hostIpv4Addr,
12774 pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr,
12775 HAL_IPV4_ADDR_LEN);
12776 wpalMemoryCopy(keepAliveReq.destIpv4Addr,
12777 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr,
Jeff Johnsone7245742012-09-05 17:12:55 -070012778 HAL_IPV4_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070012779 wpalMemoryCopy(keepAliveReq.destMacAddr,
12780 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr,
12781 HAL_MAC_ADDR_LEN);
12782 }
Jeff Johnsone7245742012-09-05 17:12:55 -070012783
12784 wpalMemoryCopy( pSendBuffer+usDataOffset,
12785 &keepAliveReq,
12786 sizeof(keepAliveReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012787
12788 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12789 "Process keep alive req %d",sizeof(keepAliveReq));
12790
12791 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12792 "Process keep alive req time period %d",keepAliveReq.timePeriod);
12793
12794 pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012795 pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012796
12797 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12798 "Sending keep alive req to HAL");
12799
12800 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012801 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012802 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012803 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12804 wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012805}/*WDI_ProcessKeepAliveReq*/
12806
12807
12808/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012809 @brief Process Wowl add bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012810 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012811
12812 @param pWDICtx: pointer to the WLAN DAL context
12813 pEventData: pointer to the event information structure
12814
Jeff Johnson295189b2012-06-20 16:38:30 -070012815 @see
12816 @return Result of the function call
12817*/
12818WDI_Status
12819WDI_ProcessWowlAddBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012820(
Jeff Johnson295189b2012-06-20 16:38:30 -070012821 WDI_ControlBlockType* pWDICtx,
12822 WDI_EventInfoType* pEventData
12823)
12824{
12825 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL;
12826 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012827 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012828 wpt_uint16 usDataOffset = 0;
12829 wpt_uint16 usSendSize = 0;
12830 tHalWowlAddBcastPtrn wowlAddBcPtrnReq;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012831 wpt_uint8 ucCurrentBSSSesIdx = 0;
12832 WDI_BSSSessionType* pBSSSes = NULL;
12833
Jeff Johnson295189b2012-06-20 16:38:30 -070012834 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12835
12836 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012837 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012838 -------------------------------------------------------------------------*/
12839 if (( NULL == pEventData ) ||
12840 ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) ||
12841 ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc)))
12842 {
12843 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12844 "%s: Invalid parameters", __FUNCTION__);
12845 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012846 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012847 }
12848
12849 /*-----------------------------------------------------------------------
12850 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012851 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012852 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012853 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012854 sizeof(wowlAddBcPtrnReq),
12855 &pSendBuffer, &usDataOffset, &usSendSize))||
12856 ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) )))
12857 {
12858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12859 "Unable to get send buffer in Wowl add bc ptrn req %x %x %x",
12860 pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb);
12861 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012862 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012863 }
12864
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012865 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12866 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.bssId,
12867 &pBSSSes);
12868 if ( NULL == pBSSSes )
12869 {
12870 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12871 " %s : Association for this BSSID does not exist",__FUNCTION__);
12872 return WDI_STATUS_E_FAILURE;
12873 }
12874
Jeff Johnsone7245742012-09-05 17:12:55 -070012875 wowlAddBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012876 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId;
Jeff Johnsone7245742012-09-05 17:12:55 -070012877 wowlAddBcPtrnReq.ucPatternByteOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070012878 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070012879 wowlAddBcPtrnReq.ucPatternMaskSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012880 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize;
Jeff Johnsone7245742012-09-05 17:12:55 -070012881 wowlAddBcPtrnReq.ucPatternSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012882 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize;
12883
12884 if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE)
12885 {
12886 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12887 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12888 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize);
12889 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12890 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12891 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize);
12892 }
12893 else
12894 {
12895 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12896 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12897 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12898 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12899 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12900 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12901
12902 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12903 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12904 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12905 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12906 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12907 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12908 }
12909
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012910 wowlAddBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx;
12911
Jeff Johnson295189b2012-06-20 16:38:30 -070012912 wpalMemoryCopy( pSendBuffer+usDataOffset,
12913 &wowlAddBcPtrnReq,
12914 sizeof(wowlAddBcPtrnReq));
12915
12916 pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012917 pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012918
12919 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012920 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012921 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012922 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12923 wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012924}/*WDI_ProcessWowlAddBcPtrnReq*/
12925
12926/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012927 @brief Process Wowl delete bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012928 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012929
12930 @param pWDICtx: pointer to the WLAN DAL context
12931 pEventData: pointer to the event information structure
12932
Jeff Johnson295189b2012-06-20 16:38:30 -070012933 @see
12934 @return Result of the function call
12935*/
12936WDI_Status
12937WDI_ProcessWowlDelBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012938(
Jeff Johnson295189b2012-06-20 16:38:30 -070012939 WDI_ControlBlockType* pWDICtx,
12940 WDI_EventInfoType* pEventData
12941)
12942{
12943 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL;
12944 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012945 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012946 wpt_uint16 usDataOffset = 0;
12947 wpt_uint16 usSendSize = 0;
12948 tHalWowlDelBcastPtrn wowlDelBcPtrnReq;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012949 wpt_uint8 ucCurrentBSSSesIdx = 0;
12950 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012951 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12952
12953 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012954 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012955 -------------------------------------------------------------------------*/
12956 if (( NULL == pEventData ) ||
12957 ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) ||
12958 ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc)))
12959 {
12960 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12961 "%s: Invalid parameters", __FUNCTION__);
12962 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012963 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012964 }
12965
12966 /*-----------------------------------------------------------------------
12967 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012968 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012969 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012970 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012971 sizeof(wowlDelBcPtrnReq),
12972 &pSendBuffer, &usDataOffset, &usSendSize))||
12973 ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) )))
12974 {
12975 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12976 "Unable to get send buffer in Wowl del bc ptrn req %x %x %x",
12977 pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb);
12978 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012979 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012980 }
12981
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012982 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12983 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.bssId,
12984 &pBSSSes);
12985 if ( NULL == pBSSSes )
12986 {
12987 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12988 " %s : Association for this BSSID does not exist",__FUNCTION__);
12989 return WDI_STATUS_E_FAILURE;
12990 }
12991
Jeff Johnsone7245742012-09-05 17:12:55 -070012992 wowlDelBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012993 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012994
12995 wowlDelBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx;
12996
Jeff Johnsone7245742012-09-05 17:12:55 -070012997 wpalMemoryCopy( pSendBuffer+usDataOffset,
12998 &wowlDelBcPtrnReq,
12999 sizeof(wowlDelBcPtrnReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013000
13001 pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013002 pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013003
13004 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013005 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013006 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013007 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13008 wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013009}/*WDI_ProcessWowlDelBcPtrnReq*/
13010
13011/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013012 @brief Process Wowl enter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070013013 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013014
13015 @param pWDICtx: pointer to the WLAN DAL context
13016 pEventData: pointer to the event information structure
13017
Jeff Johnson295189b2012-06-20 16:38:30 -070013018 @see
13019 @return Result of the function call
13020*/
13021WDI_Status
13022WDI_ProcessWowlEnterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013023(
Jeff Johnson295189b2012-06-20 16:38:30 -070013024 WDI_ControlBlockType* pWDICtx,
13025 WDI_EventInfoType* pEventData
13026)
13027{
13028 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL;
13029 WDI_WowlEnterReqCb wdiWowlEnterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013030 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013031 wpt_uint16 usDataOffset = 0;
13032 wpt_uint16 usSendSize = 0;
13033 tHalWowlEnterParams wowlEnterReq;
13034 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13035
13036 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013037 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013038 -------------------------------------------------------------------------*/
13039 if (( NULL == pEventData ) ||
13040 ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) ||
13041 ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc)))
13042 {
13043 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13044 "%s: Invalid parameters", __FUNCTION__);
13045 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013046 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013047 }
13048
13049 /*-----------------------------------------------------------------------
13050 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013051 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013052 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013053 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013054 sizeof(wowlEnterReq),
13055 &pSendBuffer, &usDataOffset, &usSendSize))||
13056 ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) )))
13057 {
13058 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13059 "Unable to get send buffer in Wowl enter req %x %x %x",
13060 pEventData, pwdiWowlEnterParams, wdiWowlEnterCb);
13061 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013062 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013063 }
13064
Jeff Johnsone7245742012-09-05 17:12:55 -070013065 wowlEnterReq.ucMagicPktEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070013066 pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070013067 wowlEnterReq.ucPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070013068 pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070013069 wowlEnterReq.ucUcastPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070013070 pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070013071 wowlEnterReq.ucWowChnlSwitchRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070013072 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070013073 wowlEnterReq.ucWowDeauthRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070013074 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070013075 wowlEnterReq.ucWowDisassocRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070013076 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070013077 wowlEnterReq.ucWowMaxMissedBeacons =
Jeff Johnson295189b2012-06-20 16:38:30 -070013078 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons;
Jeff Johnsone7245742012-09-05 17:12:55 -070013079 wowlEnterReq.ucWowMaxSleepUsec =
Jeff Johnson295189b2012-06-20 16:38:30 -070013080 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec;
13081
13082#ifdef WLAN_WAKEUP_EVENTS
13083 wowlEnterReq.ucWoWEAPIDRequestEnable =
13084 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable;
13085
13086 wowlEnterReq.ucWoWEAPOL4WayEnable =
13087 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable;
13088
13089 wowlEnterReq.ucWowNetScanOffloadMatch =
13090 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch;
13091
13092 wowlEnterReq.ucWowGTKRekeyError =
13093 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError;
13094
13095 wowlEnterReq.ucWoWBSSConnLoss =
13096 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss;
13097#endif // WLAN_WAKEUP_EVENTS
13098
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013099 wowlEnterReq.bssIdx = pwdiWowlEnterParams->wdiWowlEnterInfo.bssIdx;
13100
Jeff Johnson295189b2012-06-20 16:38:30 -070013101 wpalMemoryCopy(wowlEnterReq.magicPtrn,
13102 pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn,
13103 sizeof(tSirMacAddr));
13104
Jeff Johnsone7245742012-09-05 17:12:55 -070013105 wpalMemoryCopy( pSendBuffer+usDataOffset,
13106 &wowlEnterReq,
13107 sizeof(wowlEnterReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013108
13109 pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013110 pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013111
13112 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013113 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013114 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013115 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13116 wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013117}/*WDI_ProcessWowlEnterReq*/
13118
13119/**
13120 @brief Process Wowl exit Request function (called when Main FSM
13121 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013122
13123 @param pWDICtx: pointer to the WLAN DAL context
13124 pEventData: pointer to the event information structure
13125
Jeff Johnson295189b2012-06-20 16:38:30 -070013126 @see
13127 @return Result of the function call
13128*/
13129WDI_Status
13130WDI_ProcessWowlExitReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013131(
Jeff Johnson295189b2012-06-20 16:38:30 -070013132 WDI_ControlBlockType* pWDICtx,
13133 WDI_EventInfoType* pEventData
13134)
13135{
13136 WDI_WowlExitReqCb wdiWowlExitCb = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013137 WDI_WowlExitReqParamsType* pwdiWowlExitParams = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013138 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013139 wpt_uint16 usDataOffset = 0;
13140 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013141 tHalWowlExitParams wowlExitparams;
Jeff Johnson295189b2012-06-20 16:38:30 -070013142 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13143
13144 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013145 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013146 -------------------------------------------------------------------------*/
13147 if (( NULL == pEventData ) ||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013148 ( NULL == (pwdiWowlExitParams = (WDI_WowlExitReqParamsType *)pEventData->pEventData)) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070013149 ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc)))
13150 {
13151 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13152 "%s: Invalid parameters", __FUNCTION__);
13153 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013154 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013155 }
13156
13157 /*-----------------------------------------------------------------------
13158 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013159 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013160 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013161 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013162 sizeof(wowlExitparams),
Jeff Johnson295189b2012-06-20 16:38:30 -070013163 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013164 ( usSendSize < (usDataOffset + sizeof(wowlExitparams))))
Jeff Johnson295189b2012-06-20 16:38:30 -070013165 {
13166 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13167 "Unable to get send buffer in Wowl Exit req %x %x",
13168 pEventData, wdiWowlExitCb);
13169 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013170 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013171 }
13172
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013173 wowlExitparams.bssIdx = pwdiWowlExitParams->wdiWowlExitInfo.bssIdx;
13174
13175 wpalMemoryCopy( pSendBuffer+usDataOffset,
13176 &wowlExitparams,
13177 sizeof(wowlExitparams));
Jeff Johnson295189b2012-06-20 16:38:30 -070013178 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013179 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013180 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013181 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13182 wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013183}/*WDI_ProcessWowlExitReq*/
13184
13185/**
13186 @brief Process Configure Apps Cpu Wakeup State Request function
13187 (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013188
13189 @param pWDICtx: pointer to the WLAN DAL context
13190 pEventData: pointer to the event information structure
13191
Jeff Johnson295189b2012-06-20 16:38:30 -070013192 @see
13193 @return Result of the function call
13194*/
13195WDI_Status
13196WDI_ProcessConfigureAppsCpuWakeupStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013197(
Jeff Johnson295189b2012-06-20 16:38:30 -070013198 WDI_ControlBlockType* pWDICtx,
13199 WDI_EventInfoType* pEventData
13200)
13201{
13202 WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL;
13203 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013204 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013205 wpt_uint16 usDataOffset = 0;
13206 wpt_uint16 usSendSize = 0;
13207 tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams;
13208 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13209
13210 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013211 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013212 -------------------------------------------------------------------------*/
13213 if (( NULL == pEventData ) ||
13214 ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) ||
13215 ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc)))
13216 {
13217 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13218 "%s: Invalid parameters", __FUNCTION__);
13219 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013220 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013221 }
13222
13223 /*-----------------------------------------------------------------------
13224 Get message buffer
13225 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013226 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013227 sizeof(halCfgAppsCpuWakeupStateReqParams),
13228 &pSendBuffer, &usDataOffset, &usSendSize))||
13229 ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) )))
13230 {
13231 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13232 "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x",
13233 pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb);
13234 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013235 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013236 }
13237
Jeff Johnsone7245742012-09-05 17:12:55 -070013238 halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake =
Jeff Johnson295189b2012-06-20 16:38:30 -070013239 pwdiAppsCpuWakeupStateParams->bIsAppsAwake;
13240
Jeff Johnsone7245742012-09-05 17:12:55 -070013241 wpalMemoryCopy( pSendBuffer+usDataOffset,
13242 &halCfgAppsCpuWakeupStateReqParams,
13243 sizeof(halCfgAppsCpuWakeupStateReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070013244
13245 pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013246 pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013247
13248 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013249 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013250 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013251 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13252 wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData,
13253 WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013254}/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/
13255
13256#ifdef WLAN_FEATURE_VOWIFI_11R
13257/**
13258 @brief Process Aggregated Add TSpec Request function (called when Main FSM
13259 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013260
13261 @param pWDICtx: pointer to the WLAN DAL context
13262 pEventData: pointer to the event information structure
13263
Jeff Johnson295189b2012-06-20 16:38:30 -070013264 @see
13265 @return Result of the function call
13266*/
13267WDI_Status
13268WDI_ProcessAggrAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013269(
Jeff Johnson295189b2012-06-20 16:38:30 -070013270 WDI_ControlBlockType* pWDICtx,
13271 WDI_EventInfoType* pEventData
13272)
13273{
13274 WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams;
13275 WDI_AggrAddTsRspCb wdiAggrAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013276 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070013277 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013278 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013279 wpt_uint16 usDataOffset = 0;
13280 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070013281 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013282 wpt_macAddr macBSSID;
13283 tAggrAddTsReq halAggrAddTsReq;
13284 int i;
13285 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13286
13287 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013288 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013289 -------------------------------------------------------------------------*/
13290 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
13291 ( NULL == pEventData->pCBfnc ))
13292 {
13293 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13294 "%s: Invalid parameters", __FUNCTION__);
13295 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013296 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013297 }
13298 wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 );
13299 pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData;
13300 wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc;
13301 /*-------------------------------------------------------------------------
13302 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070013303 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070013304 -------------------------------------------------------------------------*/
13305 wpalMutexAcquire(&pWDICtx->wptMutex);
13306
13307 /*------------------------------------------------------------------------
13308 Find the BSS for which the request is made and identify WDI session
13309 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013310 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
13311 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070013312 &macBSSID))
13313 {
13314 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13315 "This station does not exist in the WDI Station Table %d");
13316 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013317 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013318 }
13319
Jeff Johnsone7245742012-09-05 17:12:55 -070013320 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
13321 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070013322 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013323 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13324 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
13325 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013326
13327 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013328 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070013329 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013330
Jeff Johnson295189b2012-06-20 16:38:30 -070013331 /*------------------------------------------------------------------------
13332 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070013333 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070013334 ------------------------------------------------------------------------*/
13335 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
13336 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013337 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13338 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
13339 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013340
Jeff Johnsone7245742012-09-05 17:12:55 -070013341 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070013342 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013343 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070013344 }
13345
13346 wpalMutexRelease(&pWDICtx->wptMutex);
13347 /*-----------------------------------------------------------------------
13348 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013349 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013350 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013351 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013352 sizeof(tAggrAddTsParams),
13353 &pSendBuffer, &usDataOffset, &usSendSize))||
13354 ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) )))
13355 {
13356 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13357 "Unable to get send buffer in set bss key req %x %x %x",
13358 pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb);
13359 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013360 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013361 }
13362
Jeff Johnsone7245742012-09-05 17:12:55 -070013363 halAggrAddTsReq.aggrAddTsParam.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013364 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070013365 halAggrAddTsReq.aggrAddTsParam.tspecIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013366 pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx;
13367
13368 for( i = 0; i < WLAN_HAL_MAX_AC; i++ )
13369 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013370 halAggrAddTsReq.aggrAddTsParam.tspec[i].type =
Jeff Johnson295189b2012-06-20 16:38:30 -070013371 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013372 halAggrAddTsReq.aggrAddTsParam.tspec[i].length =
Jeff Johnson295189b2012-06-20 16:38:30 -070013373 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -070013374 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013375 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13376 ackPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013377 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013378 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13379 accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013380 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -070013381 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13382 userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -070013383 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -070013384 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13385 psb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013386 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -070013387 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13388 aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -070013389 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -070013390 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13391 direction;
Jeff Johnsone7245742012-09-05 17:12:55 -070013392 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013393 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13394 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013395 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013396 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13397 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013398 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -070013399 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -070013400 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -070013401 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule;
Jeff Johnsone7245742012-09-05 17:12:55 -070013402
13403
13404 halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013405 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013406 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013407 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013408 halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013409 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013410 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013411 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013412 halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013413 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013414 halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013415 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013416 halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013417 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070013418 halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013419 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013420 halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013421 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013422 halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013423 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013424 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013425 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013426 halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -070013427 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -070013428 halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013429 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013430 halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -070013431 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -070013432 halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013433 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime;
13434 }
13435
Jeff Johnsone7245742012-09-05 17:12:55 -070013436 wpalMemoryCopy( pSendBuffer+usDataOffset,
13437 &halAggrAddTsReq,
13438 sizeof(halAggrAddTsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013439
13440 pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013441 pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013442
13443 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013444 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013445 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013446 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070013447 wdiAggrAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070013448 WDI_AGGR_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013449}/*WDI_ProcessAggrAddTSpecReq*/
13450#endif /* WLAN_FEATURE_VOWIFI_11R */
13451
13452/**
13453 @brief Process Shutdown Request function (called when Main FSM
13454 allows it)
13455
13456 @param pWDICtx: pointer to the WLAN DAL context
13457 pEventData: pointer to the event information structure
13458
13459 @see
13460 @return Result of the function call
13461*/
13462WDI_Status
13463WDI_ProcessShutdownReq
13464(
13465 WDI_ControlBlockType* pWDICtx,
13466 WDI_EventInfoType* pEventData
13467 )
13468{
13469 wpt_status wptStatus;
13470
13471
13472 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13473
13474 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013475 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013476 -------------------------------------------------------------------------*/
13477 if ( NULL == pEventData )
13478 {
13479 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13480 "%s: Invalid parameters", __FUNCTION__);
13481 WDI_ASSERT(0);
13482 return WDI_STATUS_E_FAILURE;
13483 }
13484
13485 wpalMutexAcquire(&pWDICtx->wptMutex);
13486
13487
13488 gWDIInitialized = eWLAN_PAL_FALSE;
13489 /*! TO DO: stop the data services */
13490 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13491 {
13492 /*Stop the STA Table !UT- check this logic again
13493 It is safer to do it here than on the response - because a stop is imminent*/
13494 WDI_STATableStop(pWDICtx);
13495
13496 /* Stop Transport Driver, DXE */
13497 WDTS_Stop(pWDICtx);
13498 }
13499
13500 /*Clear all pending request*/
13501 WDI_ClearPendingRequests(pWDICtx);
13502 /* Close Data transport*/
13503 /* FTM mode does not open Data Path */
13504 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13505 {
13506 WDTS_Close(pWDICtx);
13507 }
13508 /*Close the STA Table !UT- check this logic again*/
13509 WDI_STATableClose(pWDICtx);
13510 /*close the PAL */
13511 wptStatus = wpalClose(pWDICtx->pPALContext);
13512 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
13513 {
13514 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13515 "Failed to wpal Close %d", wptStatus);
13516 WDI_ASSERT(0);
13517 }
13518
13519 /*Transition back to init state*/
13520 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
13521
13522 wpalMutexRelease(&pWDICtx->wptMutex);
13523
13524 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013525 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070013526
13527
Jeff Johnsone7245742012-09-05 17:12:55 -070013528 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013529}/*WDI_ProcessShutdownReq*/
13530
13531/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013532 Main DAL Control Path Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070013533========================================================================*/
13534
13535/**
13536 @brief Process Start Response function (called when a response
13537 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013538
13539 @param pWDICtx: pointer to the WLAN DAL context
13540 pEventData: pointer to the event information structure
13541
Jeff Johnson295189b2012-06-20 16:38:30 -070013542 @see
13543 @return Result of the function call
13544*/
13545WDI_Status
13546WDI_ProcessStartRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013547(
Jeff Johnson295189b2012-06-20 16:38:30 -070013548 WDI_ControlBlockType* pWDICtx,
13549 WDI_EventInfoType* pEventData
13550)
13551{
13552 WDI_StartRspParamsType wdiRspParams;
13553 WDI_StartRspCb wdiStartRspCb = NULL;
13554
13555 tHalMacStartRspParams* startRspParams;
13556
13557#ifndef HAL_SELF_STA_PER_BSS
13558 WDI_AddStaParams wdiAddSTAParam = {0};
13559#endif
13560 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13561
Jeff Johnsone7245742012-09-05 17:12:55 -070013562 wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013563 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013564 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013565 -------------------------------------------------------------------------*/
13566 if (( NULL == pEventData ) ||
13567 ( NULL == pEventData->pEventData) ||
13568 ( NULL == wdiStartRspCb ))
13569 {
13570 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13571 "%s: Invalid parameters", __FUNCTION__);
13572 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013573 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013574 }
13575
13576 /*-------------------------------------------------------------------------
13577 Extract response and send it to UMAC
13578 -------------------------------------------------------------------------*/
13579 if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize )
13580 {
13581 // not enough data was received
13582 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13583 "Invalid response length in Start Resp Expect %x Rcvd %x",
13584 sizeof(tHalMacStartRspParams), pEventData->uEventDataSize);
13585 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013586 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013587 }
13588
13589 /*-------------------------------------------------------------------------
13590 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013591 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013592 -------------------------------------------------------------------------*/
13593 startRspParams = (tHalMacStartRspParams *) pEventData->pEventData;
13594
13595 wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids;
13596 wdiRspParams.ucMaxStations = startRspParams->ucMaxStations;
13597 wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR;
13598 wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR;
13599 wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION;
13600 wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION;
13601 wdiRspParams.wlanReportedVersion.major =
13602 startRspParams->wcnssWlanVersion.major;
13603 wdiRspParams.wlanReportedVersion.minor =
13604 startRspParams->wcnssWlanVersion.minor;
13605 wdiRspParams.wlanReportedVersion.version =
13606 startRspParams->wcnssWlanVersion.version;
13607 wdiRspParams.wlanReportedVersion.revision =
13608 startRspParams->wcnssWlanVersion.revision;
13609 wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion,
13610 startRspParams->wcnssCrmVersionString,
13611 sizeof(wdiRspParams.wcnssSoftwareVersion));
13612 wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion,
13613 startRspParams->wcnssWlanVersionString,
13614 sizeof(wdiRspParams.wcnssHardwareVersion));
13615 wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status);
13616
13617 wpalMutexAcquire(&pWDICtx->wptMutex);
13618 if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus )
13619 {
13620 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
13621
13622 /*Cache the start response for further use*/
13623 wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams ,
Jeff Johnsone7245742012-09-05 17:12:55 -070013624 &wdiRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070013625 sizeof(pWDICtx->wdiCachedStartRspParams));
13626
13627 }
13628 else
13629 {
13630 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13631 "Failed to start device with status %s(%d)",
13632 WDI_getHALStatusMsgString(startRspParams->status),
13633 startRspParams->status);
13634
13635 /*Set the expected state transition to stopped - because the start has
13636 failed*/
13637 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13638
13639 wpalMutexRelease(&pWDICtx->wptMutex);
13640
13641 /*Notify UMAC*/
13642 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
Jeff Johnsone7245742012-09-05 17:12:55 -070013643
Jeff Johnson295189b2012-06-20 16:38:30 -070013644 WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus);
13645
13646 /*Although the response is an error - it was processed by our function
13647 so as far as the caller is concerned this is a succesful reponse processing*/
13648 return WDI_STATUS_SUCCESS;
13649 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013650
Jeff Johnson295189b2012-06-20 16:38:30 -070013651 wpalMutexRelease(&pWDICtx->wptMutex);
13652
13653 if(eDRIVER_TYPE_MFG == pWDICtx->driverMode)
13654 {
13655 /* FTM mode does not need to execute below */
13656 /* Notify UMAC */
13657 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13658 return WDI_STATUS_SUCCESS;
13659 }
13660
13661 /* START the Data transport */
13662 WDTS_startTransport(pWDICtx);
13663
13664 /*Start the STA Table !- check this logic again*/
13665 WDI_STATableStart(pWDICtx);
13666
13667#ifndef HAL_SELF_STA_PER_BSS
13668 /* Store the Self STA Index */
13669 pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx;
13670
13671 pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId;
13672 wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta,
13673 WDI_MAC_ADDR_LEN);
13674
13675 /* At this point add the self-STA */
13676
13677 /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */
13678 /* !TO DO: wdiAddSTAParam.bcastDpuSignature */
13679 /*! TO DO: wdiAddSTAParam.dpuSig */
13680 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
13681 /*! TO DO: wdiAddSTAParam.ucHTCapable */
13682 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
13683
13684 //all DPU indices are the same for self STA
13685 wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId;
13686 wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId;
13687 wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;;
13688 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta,
13689 WDI_MAC_ADDR_LEN);
13690 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
13691 wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx;
13692
13693 /* Note: Since we don't get an explicit config STA request for self STA, we
13694 add the self STA upon receiving the Start response message. But the
13695 self STA entry in the table is deleted when WDI gets an explicit delete STA
13696 request */
13697 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
13698#endif
13699
13700 /*Notify UMAC*/
13701 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13702
Jeff Johnsone7245742012-09-05 17:12:55 -070013703 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013704}/*WDI_ProcessStartRsp*/
13705
13706
13707/**
13708 @brief Process Stop Response function (called when a response
13709 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013710
13711 @param pWDICtx: pointer to the WLAN DAL context
13712 pEventData: pointer to the event information structure
13713
Jeff Johnson295189b2012-06-20 16:38:30 -070013714 @see
13715 @return Result of the function call
13716*/
13717WDI_Status
13718WDI_ProcessStopRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013719(
Jeff Johnson295189b2012-06-20 16:38:30 -070013720 WDI_ControlBlockType* pWDICtx,
13721 WDI_EventInfoType* pEventData
13722)
13723{
13724 WDI_Status wdiStatus;
13725 WDI_StopRspCb wdiStopRspCb = NULL;
13726
Jeff Johnsone7245742012-09-05 17:12:55 -070013727 tHalMacStopRspMsg halMacStopRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013728 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13729
Jeff Johnsone7245742012-09-05 17:12:55 -070013730 wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013731 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013732 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013733 -------------------------------------------------------------------------*/
13734 if (( NULL == pEventData ) ||
13735 ( NULL == pEventData->pEventData) ||
13736 ( NULL == wdiStopRspCb ))
13737 {
13738 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13739 "%s: Invalid parameters", __FUNCTION__);
13740 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013741 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013742 }
13743
13744 /*-------------------------------------------------------------------------
13745 Extract response and send it to UMAC
13746 -------------------------------------------------------------------------*/
13747 if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize )
13748 {
13749 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13750 "Invalid response length in Stop Resp %x %x",
13751 pEventData->uEventDataSize);
13752 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013753 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013754 }
13755
13756 /*-------------------------------------------------------------------------
13757 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013758 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013759 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013760 wpalMemoryCopy( &halMacStopRspMsg.stopRspParams,
13761 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013762 sizeof(halMacStopRspMsg.stopRspParams));
13763
Jeff Johnsone7245742012-09-05 17:12:55 -070013764 wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013765
13766 wpalMutexAcquire(&pWDICtx->wptMutex);
13767
13768 /*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013769 Check to see if the stop went OK
Jeff Johnson295189b2012-06-20 16:38:30 -070013770 --------------------------------------------------------------------------*/
13771 if ( WDI_STATUS_SUCCESS != wdiStatus )
13772 {
13773 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13774 "Failed to stop the device with status %s (%d)",
13775 WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status),
13776 halMacStopRspMsg.stopRspParams.status);
13777
Jeff Johnsone7245742012-09-05 17:12:55 -070013778 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13779
Jeff Johnson295189b2012-06-20 16:38:30 -070013780 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013781 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013782 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013783
Jeff Johnson295189b2012-06-20 16:38:30 -070013784 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13785
13786 /*Transition now as WDI may get preempted imediately after it sends
13787 up the Stop Response and it will not get to process the state transition
13788 from Main Rsp function*/
13789 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
13790 wpalMutexRelease(&pWDICtx->wptMutex);
13791
13792 /*! TO DO: - STOP the Data transport */
13793
13794 /*Notify UMAC*/
13795 wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13796
Jeff Johnsone7245742012-09-05 17:12:55 -070013797 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013798}/*WDI_ProcessStopRsp*/
13799
13800/**
13801 @brief Process Close Rsp function (called when a response
13802 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013803
13804 @param pWDICtx: pointer to the WLAN DAL context
13805 pEventData: pointer to the event information structure
13806
Jeff Johnson295189b2012-06-20 16:38:30 -070013807 @see
13808 @return Result of the function call
13809*/
13810WDI_Status
13811WDI_ProcessCloseRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013812(
Jeff Johnson295189b2012-06-20 16:38:30 -070013813 WDI_ControlBlockType* pWDICtx,
13814 WDI_EventInfoType* pEventData
13815)
13816{
13817 /*There is no close response comming from HAL - function just kept for
13818 simmetry */
13819 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013820 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013821}/*WDI_ProcessCloseRsp*/
13822
13823
13824/*============================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013825 SCAN RESPONSE PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -070013826============================================================================*/
13827
13828/**
13829 @brief Process Init Scan Rsp function (called when a response
13830 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013831
13832 @param pWDICtx: pointer to the WLAN DAL context
13833 pEventData: pointer to the event information structure
13834
Jeff Johnson295189b2012-06-20 16:38:30 -070013835 @see
13836 @return Result of the function call
13837*/
13838WDI_Status
13839WDI_ProcessInitScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013840(
Jeff Johnson295189b2012-06-20 16:38:30 -070013841 WDI_ControlBlockType* pWDICtx,
13842 WDI_EventInfoType* pEventData
13843)
13844{
13845 WDI_Status wdiStatus;
13846 WDI_InitScanRspCb wdiInitScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013847 tHalInitScanRspMsg halInitScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013848 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13849
13850 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013851 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013852 -------------------------------------------------------------------------*/
13853 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13854 ( NULL == pEventData->pEventData))
13855 {
13856 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13857 "%s: Invalid parameters", __FUNCTION__);
13858 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013859 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013860 }
13861
13862 wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB;
13863 if( NULL == wdiInitScanRspCb)
13864 {
13865 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13866 "%s: call back function is NULL", __FUNCTION__);
13867 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013868 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013869 }
13870
13871 /*-------------------------------------------------------------------------
13872 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013873 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013874 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013875 wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams,
13876 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013877 sizeof(halInitScanRspMsg.initScanRspParams));
13878
Jeff Johnsone7245742012-09-05 17:12:55 -070013879 wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013880
13881 if ( pWDICtx->bInBmps )
13882 {
13883 // notify DTS that we are entering Full power
13884 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
13885 }
13886
13887 /*Notify UMAC*/
13888 wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13889
Jeff Johnsone7245742012-09-05 17:12:55 -070013890 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013891}/*WDI_ProcessInitScanRsp*/
13892
13893
13894/**
13895 @brief Process Start Scan Rsp function (called when a response
13896 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013897
13898 @param pWDICtx: pointer to the WLAN DAL context
13899 pEventData: pointer to the event information structure
13900
Jeff Johnson295189b2012-06-20 16:38:30 -070013901 @see
13902 @return Result of the function call
13903*/
13904WDI_Status
13905WDI_ProcessStartScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013906(
Jeff Johnson295189b2012-06-20 16:38:30 -070013907 WDI_ControlBlockType* pWDICtx,
13908 WDI_EventInfoType* pEventData
13909)
13910{
13911 WDI_StartScanRspParamsType wdiStartScanParams;
13912 WDI_StartScanRspCb wdiStartScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013913
13914 tHalStartScanRspMsg halStartScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013915 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13916
13917 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013918 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013919 -------------------------------------------------------------------------*/
13920 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13921 ( NULL == pEventData->pEventData))
13922 {
13923 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13924 "%s: Invalid parameters", __FUNCTION__);
13925 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013926 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013927 }
13928
13929 wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB;
13930 if( NULL == wdiStartScanRspCb)
13931 {
13932 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13933 "%s: call back function is NULL", __FUNCTION__);
13934 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013935 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013936 }
13937
13938 /*-------------------------------------------------------------------------
13939 Extract response and send it to UMAC
13940 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013941 wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams,
13942 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013943 sizeof(halStartScanRspMsg.startScanRspParams));
13944
13945 wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13946 halStartScanRspMsg.startScanRspParams.status);
13947#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070013948 wdiStartScanParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070013949 halStartScanRspMsg.startScanRspParams.txMgmtPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070013950 wpalMemoryCopy( wdiStartScanParams.aStartTSF,
Jeff Johnson295189b2012-06-20 16:38:30 -070013951 halStartScanRspMsg.startScanRspParams.startTSF,
13952 2);
Jeff Johnsone7245742012-09-05 17:12:55 -070013953#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070013954
13955 if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status )
13956 {
13957 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13958 "Start scan failed with status %s (%d)",
13959 WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status),
13960 halStartScanRspMsg.startScanRspParams.status);
13961 /* send the status to UMAC, don't return from here*/
13962 }
13963
13964 /*Notify UMAC*/
13965 wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData);
13966
Jeff Johnsone7245742012-09-05 17:12:55 -070013967 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013968
13969}/*WDI_ProcessStartScanRsp*/
13970
13971
13972/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013973 @brief Process End Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070013974 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013975
13976 @param pWDICtx: pointer to the WLAN DAL context
13977 pEventData: pointer to the event information structure
13978
Jeff Johnson295189b2012-06-20 16:38:30 -070013979 @see
13980 @return Result of the function call
13981*/
13982WDI_Status
13983WDI_ProcessEndScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013984(
Jeff Johnson295189b2012-06-20 16:38:30 -070013985 WDI_ControlBlockType* pWDICtx,
13986 WDI_EventInfoType* pEventData
13987)
13988{
13989 WDI_Status wdiStatus;
13990 tHalEndScanRspMsg halEndScanRspMsg;
13991 WDI_EndScanRspCb wdiEndScanRspCb;
13992 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13993
13994 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013995 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013996 -------------------------------------------------------------------------*/
13997 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13998 ( NULL == pEventData->pEventData))
13999 {
14000 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14001 "%s: Invalid parameters", __FUNCTION__);
14002 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014003 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014004 }
14005
14006 wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB;
14007
14008 /*-------------------------------------------------------------------------
14009 Extract response and send it to UMAC
14010 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014011 wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams,
14012 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014013 sizeof(halEndScanRspMsg.endScanRspParams));
14014
Jeff Johnsone7245742012-09-05 17:12:55 -070014015 wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014016
14017 if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status )
14018 {
14019 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14020 "End Scan failed with status %s (%d )",
14021 WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status),
14022 halEndScanRspMsg.endScanRspParams.status);
14023 /* send the status to UMAC, don't return from here*/
14024 }
14025
14026 /*Notify UMAC*/
14027 wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14028
Jeff Johnsone7245742012-09-05 17:12:55 -070014029 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014030}/*WDI_ProcessEndScanRsp*/
14031
14032
14033/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014034 @brief Process Finish Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014035 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014036
14037 @param pWDICtx: pointer to the WLAN DAL context
14038 pEventData: pointer to the event information structure
14039
Jeff Johnson295189b2012-06-20 16:38:30 -070014040 @see
14041 @return Result of the function call
14042*/
14043WDI_Status
14044WDI_ProcessFinishScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014045(
Jeff Johnson295189b2012-06-20 16:38:30 -070014046 WDI_ControlBlockType* pWDICtx,
14047 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -070014048)
Jeff Johnson295189b2012-06-20 16:38:30 -070014049{
14050 WDI_Status wdiStatus;
14051 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014052
14053 tHalFinishScanRspMsg halFinishScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014054 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14055
14056 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014057 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014058 -------------------------------------------------------------------------*/
14059 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14060 ( NULL == pEventData->pEventData))
14061 {
14062 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14063 "%s: Invalid parameters", __FUNCTION__);
14064 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014065 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014066 }
14067
14068 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB;
14069
14070 /*-------------------------------------------------------------------------
14071 Extract response and send it to UMAC
14072 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014073 wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status,
14074 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014075 sizeof(halFinishScanRspMsg.finishScanRspParams.status));
14076
Jeff Johnsone7245742012-09-05 17:12:55 -070014077 wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014078
14079 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
Jeff Johnsone7245742012-09-05 17:12:55 -070014080 "Finish scan response reported status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070014081 halFinishScanRspMsg.finishScanRspParams.status);
14082
14083 if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&&
14084 ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status ))
14085 {
14086 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14087 "Finish Scan failed with status %s (%d)",
14088 WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status),
14089 halFinishScanRspMsg.finishScanRspParams.status);
14090 /* send the status to UMAC, don't return from here*/
14091 }
14092
14093 /*Notify UMAC*/
14094 wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14095
Jeff Johnsone7245742012-09-05 17:12:55 -070014096 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014097}/*WDI_ProcessFinishScanRsp*/
14098
14099/**
14100 @brief Process Join Response function (called when a response
14101 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014102
14103 @param pWDICtx: pointer to the WLAN DAL context
14104 pEventData: pointer to the event information structure
14105
Jeff Johnson295189b2012-06-20 16:38:30 -070014106 @see
14107 @return Result of the function call
14108*/
14109WDI_Status
14110WDI_ProcessJoinRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014111(
Jeff Johnson295189b2012-06-20 16:38:30 -070014112 WDI_ControlBlockType* pWDICtx,
14113 WDI_EventInfoType* pEventData
14114)
14115{
14116 WDI_Status wdiStatus;
14117 WDI_JoinRspCb wdiJoinRspCb;
14118 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014119
14120 tHalJoinRspMsg halJoinRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014121 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14122
14123 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014124 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014125 -------------------------------------------------------------------------*/
14126 if (( NULL == pWDICtx ) ||
14127 ( NULL == pWDICtx->pfncRspCB ) ||
14128 ( NULL == pEventData ) ||
14129 ( NULL == pEventData->pEventData))
14130 {
14131 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14132 "%s: Invalid parameters", __FUNCTION__);
14133 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014134 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014135 }
14136
14137 wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB;
14138
14139 /*-------------------------------------------------------------------------
14140 Extract response and send it to UMAC
14141 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014142 wpalMemoryCopy( &halJoinRspMsg.joinRspParams,
14143 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014144 sizeof(halJoinRspMsg.joinRspParams));
14145
Jeff Johnsone7245742012-09-05 17:12:55 -070014146 wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014147
14148 wpalMutexAcquire(&pWDICtx->wptMutex);
14149
14150 /*-----------------------------------------------------------------------
14151 Join response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014152 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014153 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014154 if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014155 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14156 {
14157 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070014158 "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or "
14159 "association no longer in progress %d - mysterious HAL response",
14160 __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress);
Jeff Johnson295189b2012-06-20 16:38:30 -070014161
Jeff Johnsone7245742012-09-05 17:12:55 -070014162 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
Jeff Johnson295189b2012-06-20 16:38:30 -070014163 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014164 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014165 }
14166
14167 pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx];
14168
14169 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014170 Join Response is only allowed in init state
Jeff Johnson295189b2012-06-20 16:38:30 -070014171 -----------------------------------------------------------------------*/
14172 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14173 {
14174 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14175 "Join only allowed in Joining state - failure state is %d "
14176 "strange HAL response", pBSSSes->wdiAssocState);
14177
Jeff Johnsone7245742012-09-05 17:12:55 -070014178 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14179
Jeff Johnson295189b2012-06-20 16:38:30 -070014180 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014181 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014182 }
14183
14184
14185 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014186 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014187 -----------------------------------------------------------------------*/
14188 if ( WDI_STATUS_SUCCESS != wdiStatus )
14189 {
14190 /*Association was failed by HAL - remove session*/
14191 WDI_DeleteSession(pWDICtx, pBSSSes);
14192
14193 /*Association no longer in progress */
14194 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14195
14196 /*Association no longer in progress - prepare pending assoc for processing*/
14197 WDI_DequeueAssocRequest(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014198
Jeff Johnson295189b2012-06-20 16:38:30 -070014199 }
14200 else
14201 {
14202 /*Transition to state Joining - this may be redundant as we are supposed
14203 to be in this state already - but just to be safe*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014204 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014205 }
14206
14207 wpalMutexRelease(&pWDICtx->wptMutex);
14208
14209 /*Notify UMAC*/
14210 wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14211
Jeff Johnsone7245742012-09-05 17:12:55 -070014212 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014213}/*WDI_ProcessJoinRsp*/
14214
14215
14216/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014217 @brief Process Config BSS Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014218 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014219
14220 @param pWDICtx: pointer to the WLAN DAL context
14221 pEventData: pointer to the event information structure
14222
Jeff Johnson295189b2012-06-20 16:38:30 -070014223 @see
14224 @return Result of the function call
14225*/
14226WDI_Status
14227WDI_ProcessConfigBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014228(
Jeff Johnson295189b2012-06-20 16:38:30 -070014229 WDI_ControlBlockType* pWDICtx,
14230 WDI_EventInfoType* pEventData
14231)
14232{
14233 WDI_ConfigBSSRspParamsType wdiConfigBSSParams;
14234 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014235 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014236 WDI_BSSSessionType* pBSSSes = NULL;
14237
Jeff Johnsone7245742012-09-05 17:12:55 -070014238 tConfigBssRspMsg halConfigBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014239 WDI_AddStaParams wdiBcastAddSTAParam = {0};
14240 WDI_AddStaParams wdiAddSTAParam = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -070014241
Jeff Johnson295189b2012-06-20 16:38:30 -070014242 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14243
14244 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014245 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014246 -------------------------------------------------------------------------*/
14247 if (( NULL == pEventData ) ||
14248 ( NULL == pEventData->pEventData))
14249 {
14250 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14251 "%s: Invalid parameters", __FUNCTION__);
14252 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014253 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014254 }
14255
14256 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB;
14257
14258 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014259 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014260 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014261 wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams,
14262 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014263 sizeof(halConfigBssRspMsg.configBssRspParams));
14264
14265 wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
14266 halConfigBssRspMsg.configBssRspParams.status);
14267 if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus)
14268 {
Jeff Johnsone7245742012-09-05 17:12:55 -070014269 wpalMemoryCopy( wdiConfigBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014270 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID,
14271 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014272
Jeff Johnson295189b2012-06-20 16:38:30 -070014273 wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014274
14275 wdiConfigBSSParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014276 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014277
14278 wdiConfigBSSParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014279 halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014280
Jeff Johnson295189b2012-06-20 16:38:30 -070014281 wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014282
Jeff Johnson295189b2012-06-20 16:38:30 -070014283 #ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070014284 wdiConfigBSSParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070014285 halConfigBssRspMsg.configBssRspParams.txMgmtPower;
14286 #endif
14287 wpalMemoryCopy( wdiConfigBSSParams.macSTA,
14288 halConfigBssRspMsg.configBssRspParams.staMac,
14289 WDI_MAC_ADDR_LEN );
Jeff Johnsone7245742012-09-05 17:12:55 -070014290
Jeff Johnson295189b2012-06-20 16:38:30 -070014291 wpalMutexAcquire(&pWDICtx->wptMutex);
14292 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014293 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014294 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014295 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
14296 wdiConfigBSSParams.macBSSID,
14297 &pBSSSes);
14298
Jeff Johnson295189b2012-06-20 16:38:30 -070014299 /*-----------------------------------------------------------------------
14300 Config BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014301 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014302 -----------------------------------------------------------------------*/
14303 if ( NULL == pBSSSes )
14304 {
14305 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14306 "Association sequence for this BSS does not yet exist "
14307 "- mysterious HAL response");
Jeff Johnsone7245742012-09-05 17:12:55 -070014308
14309 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14310
Jeff Johnson295189b2012-06-20 16:38:30 -070014311 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014312 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014313 }
Jeff Johnsone7245742012-09-05 17:12:55 -070014314
Jeff Johnson295189b2012-06-20 16:38:30 -070014315 /*Save data for this BSS*/
14316 pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType;
14317 pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014318 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014319 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014320 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014321 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014322 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014323 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014324 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014325 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014326 pBSSSes->ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014327 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14328 pBSSSes->bcastStaIdx =
14329 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014330
Jeff Johnson295189b2012-06-20 16:38:30 -070014331 /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */
Jeff Johnsone7245742012-09-05 17:12:55 -070014332
Jeff Johnson295189b2012-06-20 16:38:30 -070014333 /*-------------------------------------------------------------------------
14334 Add Peer STA
14335 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014336 wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070014337 wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx;
14338 wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014339
Jeff Johnson295189b2012-06-20 16:38:30 -070014340 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014341 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014342 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014343 wdiAddSTAParam.ucHTCapable =
14344 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable;
14345 wdiAddSTAParam.ucStaType =
14346 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType;
14347
Jeff Johnson295189b2012-06-20 16:38:30 -070014348 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070014349 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
14350 halConfigBssRspMsg.configBssRspParams.staMac,
Jeff Johnson295189b2012-06-20 16:38:30 -070014351 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014352
14353 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
14354 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID ,
14355 WDI_MAC_ADDR_LEN);
14356
Jeff Johnson295189b2012-06-20 16:38:30 -070014357 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014358 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014359 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014360 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014361 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014362 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014363 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014364 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014365 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014366 wdiAddSTAParam.ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014367 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014368 wdiAddSTAParam.ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014369 halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014370
Jeff Johnson295189b2012-06-20 16:38:30 -070014371 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14372 "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014373
Jeff Johnson295189b2012-06-20 16:38:30 -070014374 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
14375 /*-------------------------------------------------------------------------
14376 Add Broadcast STA only in AP mode
14377 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014378 if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode ==
Jeff Johnson295189b2012-06-20 16:38:30 -070014379 WDI_BSS_OPERATIONAL_MODE_AP )
14380 {
14381 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14382 "Add BCAST STA to table for index: %d",
14383 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014384
14385 wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070014386 sizeof(WDI_AddStaParams) );
Jeff Johnsone7245742012-09-05 17:12:55 -070014387
Jeff Johnson295189b2012-06-20 16:38:30 -070014388 WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam,
14389 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14390 }
14391 wpalMutexRelease(&pWDICtx->wptMutex);
14392 }
14393 else
14394 {
14395 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14396 "Config BSS RSP failed with status : %s(%d)",
14397 WDI_getHALStatusMsgString(
Jeff Johnsone7245742012-09-05 17:12:55 -070014398 halConfigBssRspMsg.configBssRspParams.status),
Jeff Johnson295189b2012-06-20 16:38:30 -070014399 halConfigBssRspMsg.configBssRspParams.status);
14400
Jeff Johnsone7245742012-09-05 17:12:55 -070014401
Jeff Johnson295189b2012-06-20 16:38:30 -070014402 /*Association was failed by HAL - remove session*/
14403 WDI_DeleteSession(pWDICtx, pBSSSes);
14404
14405 /*Association no longer in progress */
14406 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14407
14408 /*Association no longer in progress - prepare pending assoc for processing*/
14409 WDI_DequeueAssocRequest(pWDICtx);
14410
14411 }
14412
14413 /*Notify UMAC*/
14414 wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData);
14415
Jeff Johnsone7245742012-09-05 17:12:55 -070014416 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014417}/*WDI_ProcessConfigBSSRsp*/
14418
14419
14420/**
14421 @brief Process Del BSS Response function (called when a response
14422 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014423
14424 @param pWDICtx: pointer to the WLAN DAL context
14425 pEventData: pointer to the event information structure
14426
Jeff Johnson295189b2012-06-20 16:38:30 -070014427 @see
14428 @return Result of the function call
14429*/
14430WDI_Status
14431WDI_ProcessDelBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014432(
Jeff Johnson295189b2012-06-20 16:38:30 -070014433 WDI_ControlBlockType* pWDICtx,
14434 WDI_EventInfoType* pEventData
14435)
14436{
14437 WDI_DelBSSRspParamsType wdiDelBSSParams;
14438 WDI_DelBSSRspCb wdiDelBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014439 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014440 WDI_BSSSessionType* pBSSSes = NULL;
14441
Jeff Johnsone7245742012-09-05 17:12:55 -070014442 tDeleteBssRspMsg halDelBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14444
14445 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014446 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014447 -------------------------------------------------------------------------*/
14448 if (( NULL == pEventData ) ||
14449 ( NULL == pEventData->pEventData))
14450 {
14451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14452 "%s: Invalid parameters", __FUNCTION__);
14453 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014454 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014455 }
14456
14457 wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB;
14458
14459 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014460 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014461 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014462 wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams,
14463 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014464 sizeof(halDelBssRspMsg.deleteBssRspParams));
14465
14466
14467 wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
Jeff Johnsone7245742012-09-05 17:12:55 -070014468 halDelBssRspMsg.deleteBssRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014469
14470 wpalMutexAcquire(&pWDICtx->wptMutex);
14471
14472 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014473 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014474 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014475 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
14476 halDelBssRspMsg.deleteBssRspParams.bssIdx,
14477 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014478
14479 /*-----------------------------------------------------------------------
14480 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014481 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014482 -----------------------------------------------------------------------*/
14483 if ( NULL == pBSSSes )
14484 {
14485 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14486 "Association sequence for this BSS does not yet exist or "
14487 "association no longer in progress - mysterious HAL response");
14488
Jeff Johnsone7245742012-09-05 17:12:55 -070014489 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14490
Jeff Johnson295189b2012-06-20 16:38:30 -070014491 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014492 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014493 }
14494
14495 /*Extract BSSID for the response to UMAC*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014496 wpalMemoryCopy(wdiDelBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014497 pBSSSes->macBSSID, WDI_MAC_ADDR_LEN);
14498
14499 wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx;
14500
14501 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014502 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014503 -----------------------------------------------------------------------*/
14504 WDI_DeleteSession(pWDICtx, pBSSSes);
14505
Jeff Johnsone7245742012-09-05 17:12:55 -070014506
Jeff Johnson295189b2012-06-20 16:38:30 -070014507 /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */
14508 if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType)
14509 {
14510 (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx );
14511 }
14512
14513 /* Delete the STA's in this BSS */
14514 WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014515
Jeff Johnson295189b2012-06-20 16:38:30 -070014516 wpalMutexRelease(&pWDICtx->wptMutex);
14517
14518 /*Notify UMAC*/
14519 wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData);
14520
Jeff Johnsone7245742012-09-05 17:12:55 -070014521 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014522}/*WDI_ProcessDelBSSRsp*/
14523
14524/**
14525 @brief Process Post Assoc Rsp function (called when a response
14526 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014527
14528 @param pWDICtx: pointer to the WLAN DAL context
14529 pEventData: pointer to the event information structure
14530
Jeff Johnson295189b2012-06-20 16:38:30 -070014531 @see
14532 @return Result of the function call
14533*/
14534WDI_Status
14535WDI_ProcessPostAssocRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014536(
Jeff Johnson295189b2012-06-20 16:38:30 -070014537 WDI_ControlBlockType* pWDICtx,
14538 WDI_EventInfoType* pEventData
14539)
14540{
14541 WDI_PostAssocRspParamsType wdiPostAssocParams;
14542 WDI_PostAssocRspCb wdiPostAssocRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014543 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014544 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014545 tPostAssocRspMsg halPostAssocRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014546 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14547
14548 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014549 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014550 -------------------------------------------------------------------------*/
14551 if (( NULL == pEventData ) ||
14552 ( NULL == pEventData->pEventData))
14553 {
14554 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14555 "%s: Invalid parameters", __FUNCTION__);
14556 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014557 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014558 }
14559
14560 wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB;
14561
14562 /*-------------------------------------------------------------------------
14563 Extract response and send it to UMAC
14564 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014565 wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams,
14566 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014567 sizeof(halPostAssocRspMsg.postAssocRspParams));
14568
14569 /*Extract the Post Assoc STA Params */
14570
Jeff Johnsone7245742012-09-05 17:12:55 -070014571 wdiPostAssocParams.staParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014572 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014573 wdiPostAssocParams.staParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014574 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070014575 wdiPostAssocParams.staParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014576 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14577
Jeff Johnsone7245742012-09-05 17:12:55 -070014578 wdiPostAssocParams.wdiStatus =
14579 WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014580
14581 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14582 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014583 wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA,
14584 pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014585 WDI_MAC_ADDR_LEN);
14586
14587 /* Extract Post Assoc BSS Params */
14588
Jeff Johnsone7245742012-09-05 17:12:55 -070014589 wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID,
14590 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID,
14591 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070014592
14593 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14594 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014595 wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014596 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext
14597 .macSTA, WDI_MAC_ADDR_LEN);
14598
Jeff Johnsone7245742012-09-05 17:12:55 -070014599 wdiPostAssocParams.bssParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014600 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14601
Jeff Johnsone7245742012-09-05 17:12:55 -070014602 wdiPostAssocParams.bssParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014603 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14604
14605 wdiPostAssocParams.bssParams.ucBSSIdx =
14606 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14607
Jeff Johnsone7245742012-09-05 17:12:55 -070014608 wdiPostAssocParams.bssParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014609 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx;
14610
14611 wpalMutexAcquire(&pWDICtx->wptMutex);
14612
14613 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014614 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014615 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014616 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070014617 wdiPostAssocParams.bssParams.
Jeff Johnsone7245742012-09-05 17:12:55 -070014618 macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014619
14620 /*-----------------------------------------------------------------------
14621 Post assoc response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014622 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014623 -----------------------------------------------------------------------*/
14624 if (( NULL == pBSSSes ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070014625 ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014626 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14627 {
14628 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14629 "Association sequence for this BSS does not yet exist or "
14630 "association no longer in progress - mysterious HAL response");
14631
Jeff Johnsone7245742012-09-05 17:12:55 -070014632 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14633
Jeff Johnson295189b2012-06-20 16:38:30 -070014634 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014635 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014636 }
14637
14638 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014639 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -070014640 -----------------------------------------------------------------------*/
14641 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14642 {
14643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14644 "Post Assoc not allowed before JOIN - failing request "
14645 "strange HAL response");
14646
Jeff Johnsone7245742012-09-05 17:12:55 -070014647 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14648
Jeff Johnson295189b2012-06-20 16:38:30 -070014649 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014650 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014651 }
14652
14653 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014654 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014655 -----------------------------------------------------------------------*/
14656 if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus )
14657 {
14658 /*Association was failed by HAL - remove session*/
14659 WDI_DeleteSession(pWDICtx, pBSSSes);
14660 }
14661 else
14662 {
14663 /*Transition to state POST Assoc*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014664 pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014665
14666 /*Save DPU Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014667 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014668 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014669 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014670 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014671 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014672 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014673 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014674 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature;
14675
Jeff Johnsone7245742012-09-05 17:12:55 -070014676 pBSSSes->ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014677 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14678 }
14679
14680 /*Association no longer in progress */
14681 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14682
14683 /*Association no longer in progress - prepare pending assoc for processing*/
14684 WDI_DequeueAssocRequest(pWDICtx);
14685
14686 wpalMutexRelease(&pWDICtx->wptMutex);
14687
14688 /*Notify UMAC*/
14689 wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData);
14690
Jeff Johnsone7245742012-09-05 17:12:55 -070014691 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014692}/*WDI_ProcessPostAssocRsp*/
14693
14694/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014695 @brief Process Del STA Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070014696 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014697
14698 @param pWDICtx: pointer to the WLAN DAL context
14699 pEventData: pointer to the event information structure
14700
Jeff Johnson295189b2012-06-20 16:38:30 -070014701 @see
14702 @return Result of the function call
14703*/
14704WDI_Status
14705WDI_ProcessDelSTARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014706(
Jeff Johnson295189b2012-06-20 16:38:30 -070014707 WDI_ControlBlockType* pWDICtx,
14708 WDI_EventInfoType* pEventData
14709)
14710{
14711 WDI_DelSTARspParamsType wdiDelSTARsp;
14712 WDI_DelSTARspCb wdiDelSTARspCb;
14713 wpt_uint8 staType;
Jeff Johnsone7245742012-09-05 17:12:55 -070014714 tDeleteStaRspMsg halDelStaRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014715 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14716
14717 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014718 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014719 -------------------------------------------------------------------------*/
14720 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14721 ( NULL == pEventData->pEventData))
14722 {
14723 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14724 "%s: Invalid parameters", __FUNCTION__);
14725 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014726 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014727 }
14728
14729 wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB;
14730
14731 /*-------------------------------------------------------------------------
14732 Extract response and send it to UMAC
14733 -------------------------------------------------------------------------*/
14734 wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070014735 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014736 sizeof(halDelStaRspMsg.delStaRspParams));
14737
14738 wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070014739 wdiDelSTARsp.wdiStatus =
14740 WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014741
14742 WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType);
14743
14744 /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */
14745 if(staType == WDI_STA_ENTRY_SELF)
14746 {
14747 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
14748
14749 /* At this point add the self-STA */
14750
14751 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
14752 /*! TO DO: wdiAddSTAParam.ucHTCapable */
14753 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
14754
14755#define WDI_DPU_SELF_STA_DEFAULT_IDX 0
14756#define WDI_DPU_SELF_STA_DEFAULT_SIG 0
14757
14758 //all DPU indices are the same for self STA
14759 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14760 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14761 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14762 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14763 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14764 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG;
Madan Mohan Koyyalamudi15a48f02012-10-05 17:13:53 -070014765
14766 pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070014767 }
14768 else
14769 {
14770 //Delete the station in the table
14771 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14772 }
14773
14774 /*Notify UMAC*/
14775 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14776
Jeff Johnsone7245742012-09-05 17:12:55 -070014777 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014778}/*WDI_ProcessDelSTARsp*/
14779
14780
14781/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070014782 Security Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070014783==========================================================================*/
14784
14785/**
14786 @brief Process Set BSS Key Rsp function (called when a response
14787 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014788
14789 @param pWDICtx: pointer to the WLAN DAL context
14790 pEventData: pointer to the event information structure
14791
Jeff Johnson295189b2012-06-20 16:38:30 -070014792 @see
14793 @return Result of the function call
14794*/
14795WDI_Status
14796WDI_ProcessSetBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014797(
Jeff Johnson295189b2012-06-20 16:38:30 -070014798 WDI_ControlBlockType* pWDICtx,
14799 WDI_EventInfoType* pEventData
14800)
14801{
14802 WDI_Status wdiStatus;
14803 eHalStatus halStatus;
14804 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14805 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14806
14807 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014808 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014809 -------------------------------------------------------------------------*/
14810 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14811 ( NULL == pEventData->pEventData))
14812 {
14813 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14814 "%s: Invalid parameters", __FUNCTION__);
14815 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014816 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014817 }
14818
14819 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14820
14821 /*-------------------------------------------------------------------------
14822 Extract response and send it to UMAC
14823 -------------------------------------------------------------------------*/
14824 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014825 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014826
14827 if ( eHAL_STATUS_SUCCESS != halStatus )
14828 {
14829 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14830 "Set BSS Key failed with status %s (%d)",
14831 WDI_getHALStatusMsgString(halStatus),
14832 halStatus);
14833 /* send the status to UMAC, don't return from here*/
14834 }
14835
14836 /*Notify UMAC*/
14837 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14838
Jeff Johnsone7245742012-09-05 17:12:55 -070014839 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014840}/*WDI_ProcessSetBssKeyRsp*/
14841
14842/**
14843 @brief Process Remove BSS Key Rsp function (called when a response
14844 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014845
14846 @param pWDICtx: pointer to the WLAN DAL context
14847 pEventData: pointer to the event information structure
14848
Jeff Johnson295189b2012-06-20 16:38:30 -070014849 @see
14850 @return Result of the function call
14851*/
14852WDI_Status
14853WDI_ProcessRemoveBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014854(
Jeff Johnson295189b2012-06-20 16:38:30 -070014855 WDI_ControlBlockType* pWDICtx,
14856 WDI_EventInfoType* pEventData
14857)
14858{
14859 WDI_Status wdiStatus;
14860 eHalStatus halStatus;
14861 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14862 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14863
14864 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014865 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014866 -------------------------------------------------------------------------*/
14867 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14868 ( NULL == pEventData->pEventData))
14869 {
14870 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14871 "%s: Invalid parameters", __FUNCTION__);
14872 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014873 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014874 }
14875
14876 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14877
14878 /*-------------------------------------------------------------------------
14879 Extract response and send it to UMAC
14880 -------------------------------------------------------------------------*/
14881 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014882 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014883
14884 if ( eHAL_STATUS_SUCCESS != halStatus )
14885 {
14886 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14887 "Remove BSS Key failed with status %s (%d )",
14888 WDI_getHALStatusMsgString(halStatus),
14889 halStatus);
14890 /* send the status to UMAC, don't return from here*/
14891 }
14892
14893 /*Notify UMAC*/
14894 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14895
Jeff Johnsone7245742012-09-05 17:12:55 -070014896 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014897}/*WDI_ProcessSetBssKeyRsp*/
14898
14899
14900/**
14901 @brief Process Set STA Key Rsp function (called when a response
14902 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014903
14904 @param pWDICtx: pointer to the WLAN DAL context
14905 pEventData: pointer to the event information structure
14906
Jeff Johnson295189b2012-06-20 16:38:30 -070014907 @see
14908 @return Result of the function call
14909*/
14910WDI_Status
14911WDI_ProcessSetStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014912(
Jeff Johnson295189b2012-06-20 16:38:30 -070014913 WDI_ControlBlockType* pWDICtx,
14914 WDI_EventInfoType* pEventData
14915)
14916{
14917 WDI_Status wdiStatus;
14918 eHalStatus halStatus;
14919 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14920 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14921
14922 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014923 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014924 -------------------------------------------------------------------------*/
14925 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14926 ( NULL == pEventData->pEventData))
14927 {
14928 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14929 "%s: Invalid parameters", __FUNCTION__);
14930 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014931 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014932 }
14933
14934 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14935
14936 /*-------------------------------------------------------------------------
14937 Extract response and send it to UMAC
14938 -------------------------------------------------------------------------*/
14939 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014940 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014941
14942 if ( eHAL_STATUS_SUCCESS != halStatus )
14943 {
14944 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14945 "Set STA Key failed with status %s (%d)",
14946 WDI_getHALStatusMsgString(halStatus),
14947 halStatus);
14948 /* send the status to UMAC, don't return from here*/
14949 }
14950
14951 /*Notify UMAC*/
14952 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14953
Jeff Johnsone7245742012-09-05 17:12:55 -070014954 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014955}/*WDI_ProcessSetSTAKeyRsp*/
14956
14957/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014958 @brief Process Remove STA Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014959 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014960
14961 @param pWDICtx: pointer to the WLAN DAL context
14962 pEventData: pointer to the event information structure
14963
Jeff Johnson295189b2012-06-20 16:38:30 -070014964 @see
14965 @return Result of the function call
14966*/
14967WDI_Status
14968WDI_ProcessRemoveStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014969(
Jeff Johnson295189b2012-06-20 16:38:30 -070014970 WDI_ControlBlockType* pWDICtx,
14971 WDI_EventInfoType* pEventData
14972)
14973{
14974 WDI_Status wdiStatus;
14975 eHalStatus halStatus;
14976 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14977 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14978
14979 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014980 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014981 -------------------------------------------------------------------------*/
14982 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14983 ( NULL == pEventData->pEventData))
14984 {
14985 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14986 "%s: Invalid parameters", __FUNCTION__);
14987 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014988 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014989 }
14990
14991 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14992
14993 /*-------------------------------------------------------------------------
14994 Extract response and send it to UMAC
14995 -------------------------------------------------------------------------*/
14996 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014997 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014998
14999 if ( eHAL_STATUS_SUCCESS != halStatus )
15000 {
15001 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15002 "Remove STA Key failed with status %s (%d)",
15003 WDI_getHALStatusMsgString(halStatus),
15004 halStatus);
15005 /* send the status to UMAC, don't return from here*/
15006 }
15007
15008 /*Notify UMAC*/
15009 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15010
Jeff Johnsone7245742012-09-05 17:12:55 -070015011 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015012}/*WDI_ProcessRemoveStaKeyRsp*/
15013
15014/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015015 @brief Process Set STA Bcast Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015016 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015017
15018 @param pWDICtx: pointer to the WLAN DAL context
15019 pEventData: pointer to the event information structure
15020
Jeff Johnson295189b2012-06-20 16:38:30 -070015021 @see
15022 @return Result of the function call
15023*/
15024WDI_Status
15025WDI_ProcessSetStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015026(
Jeff Johnson295189b2012-06-20 16:38:30 -070015027 WDI_ControlBlockType* pWDICtx,
15028 WDI_EventInfoType* pEventData
15029)
15030{
15031 WDI_Status wdiStatus;
15032 eHalStatus halStatus;
15033 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
15034 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15035
15036 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015037 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015038 -------------------------------------------------------------------------*/
15039 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15040 ( NULL == pEventData->pEventData))
15041 {
15042 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15043 "%s: Invalid parameters", __FUNCTION__);
15044 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015045 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015046 }
15047
15048 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
15049
15050 /*-------------------------------------------------------------------------
15051 Extract response and send it to UMAC
15052 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015053 wpalMemoryCopy( &halStatus,
15054 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015055 sizeof(halStatus));
15056
Jeff Johnsone7245742012-09-05 17:12:55 -070015057 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015058
15059 if ( eHAL_STATUS_SUCCESS != halStatus )
15060 {
15061 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15062 "Set STA Key failed with status %s (%d)",
15063 WDI_getHALStatusMsgString(halStatus),
15064 halStatus);
15065 /* send the status to UMAC, don't return from here*/
15066 }
15067
15068 /*Notify UMAC*/
15069 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15070
Jeff Johnsone7245742012-09-05 17:12:55 -070015071 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015072}/*WDI_ProcessSetSTABcastKeyRsp*/
15073
15074/**
15075 @brief Process Remove STA Bcast Key Rsp function (called when a
15076 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015077
15078 @param pWDICtx: pointer to the WLAN DAL context
15079 pEventData: pointer to the event information structure
15080
Jeff Johnson295189b2012-06-20 16:38:30 -070015081 @see
15082 @return Result of the function call
15083*/
15084WDI_Status
15085WDI_ProcessRemoveStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015086(
Jeff Johnson295189b2012-06-20 16:38:30 -070015087 WDI_ControlBlockType* pWDICtx,
15088 WDI_EventInfoType* pEventData
15089)
15090{
15091 WDI_Status wdiStatus;
15092 eHalStatus halStatus;
15093 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
15094 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15095
15096 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015097 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015098 -------------------------------------------------------------------------*/
15099 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15100 ( NULL == pEventData->pEventData))
15101 {
15102 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15103 "%s: Invalid parameters", __FUNCTION__);
15104 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015105 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015106 }
15107
15108 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
15109
15110 /*-------------------------------------------------------------------------
15111 Extract response and send it to UMAC
15112 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015113 wpalMemoryCopy( &halStatus,
15114 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015115 sizeof(halStatus));
15116
Jeff Johnsone7245742012-09-05 17:12:55 -070015117 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015118
15119 if ( eHAL_STATUS_SUCCESS != halStatus )
15120 {
15121 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15122 "Remove STA Key failed with status %s (%d)",
15123 WDI_getHALStatusMsgString(halStatus),
15124 halStatus);
15125 /* send the status to UMAC, don't return from here*/
15126 }
15127
15128 /*Notify UMAC*/
15129 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15130
Jeff Johnsone7245742012-09-05 17:12:55 -070015131 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015132}/*WDI_ProcessRemoveStaBcastKeyRsp*/
15133
15134
15135/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015136 QoS and BA Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070015137==========================================================================*/
15138
15139/**
15140 @brief Process Add TSpec Rsp function (called when a response
15141 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015142
15143 @param pWDICtx: pointer to the WLAN DAL context
15144 pEventData: pointer to the event information structure
15145
Jeff Johnson295189b2012-06-20 16:38:30 -070015146 @see
15147 @return Result of the function call
15148*/
15149WDI_Status
15150WDI_ProcessAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015151(
Jeff Johnson295189b2012-06-20 16:38:30 -070015152 WDI_ControlBlockType* pWDICtx,
15153 WDI_EventInfoType* pEventData
15154)
15155{
15156 WDI_Status wdiStatus;
15157 eHalStatus halStatus;
15158 WDI_AddTsRspCb wdiAddTsRspCb;
15159 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15160
15161 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015162 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015163 -------------------------------------------------------------------------*/
15164 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15165 ( NULL == pEventData->pEventData))
15166 {
15167 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15168 "%s: Invalid parameters", __FUNCTION__);
15169 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015170 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015171 }
15172
15173 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
15174
15175 /*-------------------------------------------------------------------------
15176 Extract response and send it to UMAC
15177 -------------------------------------------------------------------------*/
15178 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015179 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015180
15181 /*Notify UMAC*/
15182 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15183
Jeff Johnsone7245742012-09-05 17:12:55 -070015184 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015185}/*WDI_ProcessAddTSpecRsp*/
15186
15187
15188/**
15189 @brief Process Del TSpec Rsp function (called when a response
15190 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015191
15192 @param pWDICtx: pointer to the WLAN DAL context
15193 pEventData: pointer to the event information structure
15194
Jeff Johnson295189b2012-06-20 16:38:30 -070015195 @see
15196 @return Result of the function call
15197*/
15198WDI_Status
15199WDI_ProcessDelTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015200(
Jeff Johnson295189b2012-06-20 16:38:30 -070015201 WDI_ControlBlockType* pWDICtx,
15202 WDI_EventInfoType* pEventData
15203)
15204{
15205 WDI_Status wdiStatus;
15206 eHalStatus halStatus;
15207 WDI_DelTsRspCb wdiDelTsRspCb;
15208 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15209
15210 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015211 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015212 -------------------------------------------------------------------------*/
15213 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15214 ( NULL == pEventData->pEventData))
15215 {
15216 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15217 "%s: Invalid parameters", __FUNCTION__);
15218 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015219 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015220 }
15221
15222 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
15223
15224 /*-------------------------------------------------------------------------
15225 Extract response and send it to UMAC
15226 -------------------------------------------------------------------------*/
15227 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015228 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015229
15230 /*Notify UMAC*/
15231 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15232
Jeff Johnsone7245742012-09-05 17:12:55 -070015233 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015234}/*WDI_ProcessDelTSpecRsp*/
15235
15236/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015237 @brief Process Update EDCA Parameters Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015238 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015239
15240 @param pWDICtx: pointer to the WLAN DAL context
15241 pEventData: pointer to the event information structure
15242
Jeff Johnson295189b2012-06-20 16:38:30 -070015243 @see
15244 @return Result of the function call
15245*/
15246WDI_Status
15247WDI_ProcessUpdateEDCAParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015248(
Jeff Johnson295189b2012-06-20 16:38:30 -070015249 WDI_ControlBlockType* pWDICtx,
15250 WDI_EventInfoType* pEventData
15251)
15252{
15253 WDI_Status wdiStatus;
15254 eHalStatus halStatus;
15255 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
15256 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15257
15258 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015259 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015260 -------------------------------------------------------------------------*/
15261 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15262 ( NULL == pEventData->pEventData))
15263 {
15264 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15265 "%s: Invalid parameters", __FUNCTION__);
15266 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015267 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015268 }
15269
15270 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
15271
15272 /*-------------------------------------------------------------------------
15273 Extract response and send it to UMAC
15274 -------------------------------------------------------------------------*/
15275 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015276 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015277
15278 /*Notify UMAC*/
15279 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15280
Jeff Johnsone7245742012-09-05 17:12:55 -070015281 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015282}/*WDI_ProcessUpdateEDCAParamsRsp*/
15283
15284
15285/**
15286 @brief Process Add BA Rsp function (called when a response
15287 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015288
15289 @param pWDICtx: pointer to the WLAN DAL context
15290 pEventData: pointer to the event information structure
15291
Jeff Johnson295189b2012-06-20 16:38:30 -070015292 @see
15293 @return Result of the function call
15294*/
15295WDI_Status
15296WDI_ProcessAddBASessionRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015297(
Jeff Johnson295189b2012-06-20 16:38:30 -070015298 WDI_ControlBlockType* pWDICtx,
15299 WDI_EventInfoType* pEventData
15300)
15301{
15302 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
15303
15304 tAddBASessionRspParams halBASessionRsp;
15305 WDI_AddBASessionRspParamsType wdiBASessionRsp;
15306
Jeff Johnsone7245742012-09-05 17:12:55 -070015307
Jeff Johnson295189b2012-06-20 16:38:30 -070015308 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15309
15310 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015311 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015312 -------------------------------------------------------------------------*/
15313 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15314 ( NULL == pEventData->pEventData))
15315 {
15316 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15317 "%s: Invalid parameters", __FUNCTION__);
15318 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015319 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015320 }
15321
15322 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
15323
15324 /*-------------------------------------------------------------------------
15325 Extract response and send it to UMAC
15326 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015327 wpalMemoryCopy( &halBASessionRsp,
15328 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015329 sizeof(halBASessionRsp));
15330
15331 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
15332
Jeff Johnson43971f52012-07-17 12:26:56 -070015333 if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015334 {
15335 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
15336 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
15337 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
15338 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
15339 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
15340 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
15341 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
15342 }
15343
15344 /*Notify UMAC*/
15345 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
15346
Jeff Johnsone7245742012-09-05 17:12:55 -070015347 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015348}/*WDI_ProcessAddSessionBARsp*/
15349
15350
15351/**
15352 @brief Process Del BA Rsp function (called when a response
15353 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015354
15355 @param pWDICtx: pointer to the WLAN DAL context
15356 pEventData: pointer to the event information structure
15357
Jeff Johnson295189b2012-06-20 16:38:30 -070015358 @see
15359 @return Result of the function call
15360*/
15361WDI_Status
15362WDI_ProcessDelBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015363(
Jeff Johnson295189b2012-06-20 16:38:30 -070015364 WDI_ControlBlockType* pWDICtx,
15365 WDI_EventInfoType* pEventData
15366)
15367{
15368 WDI_Status wdiStatus;
15369 eHalStatus halStatus;
15370 WDI_DelBARspCb wdiDelBARspCb;
15371 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15372
15373 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015374 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015375 -------------------------------------------------------------------------*/
15376 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15377 ( NULL == pEventData->pEventData))
15378 {
15379 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15380 "%s: Invalid parameters", __FUNCTION__);
15381 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015382 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015383 }
15384
15385 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15386
15387 /*-------------------------------------------------------------------------
15388 Extract response and send it to UMAC
15389 -------------------------------------------------------------------------*/
15390 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015391 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015392
15393 if ( eHAL_STATUS_SUCCESS == halStatus )
15394 {
15395 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15396 }
15397
15398 /*Notify UMAC*/
15399 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15400
Jeff Johnsone7245742012-09-05 17:12:55 -070015401 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015402}/*WDI_ProcessDelBARsp*/
15403
15404#ifdef FEATURE_WLAN_CCX
15405/**
15406 @brief Process TSM Stats Rsp function (called when a response
15407 is being received over the bus from HAL)
15408
15409 @param pWDICtx: pointer to the WLAN DAL context
15410 pEventData: pointer to the event information structure
15411
15412 @see
15413 @return Result of the function call
15414*/
15415WDI_Status
15416WDI_ProcessTsmStatsRsp
15417(
15418 WDI_ControlBlockType* pWDICtx,
15419 WDI_EventInfoType* pEventData
15420)
15421{
15422 WDI_TsmRspCb wdiTsmStatsRspCb;
15423 tTsmStatsRspMsg halTsmStatsRspMsg;
15424 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15425 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15426
15427 /*-------------------------------------------------------------------------
15428 Sanity check
15429 -------------------------------------------------------------------------*/
15430 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15431 ( NULL == pEventData->pEventData))
15432 {
15433 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15434 "%s: Invalid parameters", __FUNCTION__);
15435 WDI_ASSERT(0);
15436 return WDI_STATUS_E_FAILURE;
15437 }
15438
15439 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15440
15441 /*-------------------------------------------------------------------------
15442 Unpack HAL Response Message - the header was already extracted by the
15443 main Response Handling procedure
15444 -------------------------------------------------------------------------*/
15445 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15446 pEventData->pEventData,
15447 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15448
15449 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15450 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15451 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15452 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15453 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15454 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15455 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15456 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15457 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15458 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15459 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15460 halTsmStatsRspMsg.tsmStatsRspParams.status);
15461
15462 /*Notify UMAC*/
15463 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15464
15465 return WDI_STATUS_SUCCESS;
15466}/*WDI_ProcessTsmStatsRsp*/
15467
15468#endif
15469
15470
15471
15472/**
15473 @brief Process Flush AC Rsp function (called when a response
15474 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015475
15476 @param pWDICtx: pointer to the WLAN DAL context
15477 pEventData: pointer to the event information structure
15478
Jeff Johnson295189b2012-06-20 16:38:30 -070015479 @see
15480 @return Result of the function call
15481*/
15482WDI_Status
15483WDI_ProcessFlushAcRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015484(
Jeff Johnson295189b2012-06-20 16:38:30 -070015485 WDI_ControlBlockType* pWDICtx,
15486 WDI_EventInfoType* pEventData
15487)
15488{
15489 WDI_Status wdiStatus;
15490 eHalStatus halStatus;
15491 WDI_FlushAcRspCb wdiFlushAcRspCb;
15492 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15493
15494 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015495 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015496 -------------------------------------------------------------------------*/
15497 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15498 ( NULL == pEventData->pEventData))
15499 {
15500 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15501 "%s: Invalid parameters", __FUNCTION__);
15502 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015503 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015504 }
15505
15506 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15507
15508 /*-------------------------------------------------------------------------
15509 Extract response and send it to UMAC
15510 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015511 wpalMemoryCopy( &halStatus,
15512 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015513 sizeof(halStatus));
15514
Jeff Johnsone7245742012-09-05 17:12:55 -070015515 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015516
15517 /*Notify UMAC*/
15518 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15519
Jeff Johnsone7245742012-09-05 17:12:55 -070015520 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015521}/*WDI_ProcessFlushAcRsp*/
15522
15523/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015524 @brief Process BT AMP event Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015525 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015526
15527 @param pWDICtx: pointer to the WLAN DAL context
15528 pEventData: pointer to the event information structure
15529
Jeff Johnson295189b2012-06-20 16:38:30 -070015530 @see
15531 @return Result of the function call
15532*/
15533WDI_Status
15534WDI_ProcessBtAmpEventRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015535(
Jeff Johnson295189b2012-06-20 16:38:30 -070015536 WDI_ControlBlockType* pWDICtx,
15537 WDI_EventInfoType* pEventData
15538)
15539{
15540 WDI_Status wdiStatus;
15541 eHalStatus halStatus;
15542 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15543 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15544
15545 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015546 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015547 -------------------------------------------------------------------------*/
15548 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15549 ( NULL == pEventData->pEventData))
15550 {
15551 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15552 "%s: Invalid parameters", __FUNCTION__);
15553 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015554 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015555 }
15556
15557 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15558
15559 /*-------------------------------------------------------------------------
15560 Extract response and send it to UMAC
15561 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015562 wpalMemoryCopy( &halStatus,
15563 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015564 sizeof(halStatus));
15565
Jeff Johnsone7245742012-09-05 17:12:55 -070015566 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015567
15568 /*Notify UMAC*/
15569 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15570
Jeff Johnsone7245742012-09-05 17:12:55 -070015571 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015572}/*WDI_ProcessBtAmpEventRsp*/
15573
15574
15575/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015576 @brief Process ADD STA SELF Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070015577 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015578
15579 @param pWDICtx: pointer to the WLAN DAL context
15580 pEventData: pointer to the event information structure
15581
Jeff Johnson295189b2012-06-20 16:38:30 -070015582 @see
15583 @return Result of the function call
15584*/
15585WDI_Status
15586WDI_ProcessAddSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015587(
Jeff Johnson295189b2012-06-20 16:38:30 -070015588 WDI_ControlBlockType* pWDICtx,
15589 WDI_EventInfoType* pEventData
15590)
15591{
15592 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15593 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15594 tAddStaSelfRspMsg halAddStaSelfRsp;
15595 WDI_AddStaParams wdiAddSTAParam = {0};
15596 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15597
15598 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015599 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015600 -------------------------------------------------------------------------*/
15601 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15602 ( NULL == pEventData->pEventData))
15603 {
15604 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15605 "%s: Invalid parameters", __FUNCTION__);
15606 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015607 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015608 }
15609
Jeff Johnsone7245742012-09-05 17:12:55 -070015610 wdiAddSTASelfReqParamsRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070015611 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15612
15613 /*-------------------------------------------------------------------------
15614 Extract response and send it to UMAC
15615 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015616 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15617 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015618 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15619
15620
Jeff Johnsone7245742012-09-05 17:12:55 -070015621 wdiAddSTASelfParams.wdiStatus =
15622 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015623
Jeff Johnsone7245742012-09-05 17:12:55 -070015624 wdiAddSTASelfParams.ucSTASelfIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015625 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015626 wdiAddSTASelfParams.dpuIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015627 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015628 wdiAddSTASelfParams.dpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015629 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15630
15631 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15632 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15633 WDI_MAC_ADDR_LEN);
15634
15635
15636#ifdef HAL_SELF_STA_PER_BSS
15637
15638 /* At this point add the self-STA */
15639
15640 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15641 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15642 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15643
15644 //all DPU indices are the same for self STA
15645
15646 /*DPU Information*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015647 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015648 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15649 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15650 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15651 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15652 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15653
15654 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15655 WDI_MAC_ADDR_LEN);
15656
15657 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15658 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15659
Jeff Johnsone7245742012-09-05 17:12:55 -070015660 if(halAddStaSelfRsp.addStaSelfRspParams.status
Jeff Johnson295189b2012-06-20 16:38:30 -070015661 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15662 {
15663 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15664 }
15665#endif
15666
15667 /*Notify UMAC*/
15668 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15669
Jeff Johnsone7245742012-09-05 17:12:55 -070015670 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015671}/*WDI_ProcessAddSTASelfRsp*/
15672
15673
15674
15675/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015676 @brief WDI_ProcessDelSTASelfRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015677 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015678
15679 @param pWDICtx: pointer to the WLAN DAL context
15680 pEventData: pointer to the event information structure
15681
Jeff Johnson295189b2012-06-20 16:38:30 -070015682 @see
15683 @return Result of the function call
15684*/
15685WDI_Status
15686WDI_ProcessDelSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015687(
Jeff Johnson295189b2012-06-20 16:38:30 -070015688 WDI_ControlBlockType* pWDICtx,
15689 WDI_EventInfoType* pEventData
15690)
15691{
15692 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15693 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15694 tDelStaSelfRspParams delStaSelfRspParams;
15695 wpt_uint8 ucStaIdx;
15696
15697 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15698
15699 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015700 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015701 -------------------------------------------------------------------------*/
15702 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15703 ( NULL == pEventData->pEventData))
15704 {
15705 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15706 "%s: Invalid parameters", __FUNCTION__);
15707 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015708 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015709 }
15710
15711 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15712
15713 /*-------------------------------------------------------------------------
15714 Extract response and send it to UMAC
15715 -------------------------------------------------------------------------*/
15716
Jeff Johnsone7245742012-09-05 17:12:55 -070015717 wpalMemoryCopy( &delStaSelfRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070015718 (wpt_uint8*)pEventData->pEventData,
15719 sizeof(tDelStaSelfRspParams));
15720
Jeff Johnsone7245742012-09-05 17:12:55 -070015721 wdiDelStaSelfRspParams.wdiStatus =
15722 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015723
Jeff Johnsone7245742012-09-05 17:12:55 -070015724 /* delStaSelfRspParams.status is not
Jeff Johnson295189b2012-06-20 16:38:30 -070015725 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15726 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15727 {
15728 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070015729 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070015730 delStaSelfRspParams.selfMacAddr,
15731 &ucStaIdx);
15732 if(WDI_STATUS_E_FAILURE == wdiStatus)
15733 {
15734 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15735 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15736 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015737 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015738 }
15739 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15740 }
15741
15742 /*Notify UMAC*/
15743 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15744
15745 return WDI_STATUS_SUCCESS;
15746}
15747
Jeff Johnsone7245742012-09-05 17:12:55 -070015748#ifdef FEATURE_OEM_DATA_SUPPORT
15749/**
15750 @brief Start Oem Data Rsp function (called when a
15751 response is being received over the bus from HAL)
Jeff Johnson295189b2012-06-20 16:38:30 -070015752
Jeff Johnsone7245742012-09-05 17:12:55 -070015753 @param pWDICtx: pointer to the WLAN DAL context
15754 pEventData: pointer to the event information structure
15755
15756 @see
15757 @return Result of the function call
15758*/
15759#define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName)
15760
15761WDI_Status
15762WDI_ProcessStartOemDataRsp
15763(
15764 WDI_ControlBlockType* pWDICtx,
15765 WDI_EventInfoType* pEventData
15766)
15767{
15768 WDI_oemDataRspCb wdiOemDataRspCb;
15769 WDI_oemDataRspParamsType* wdiOemDataRspParams;
15770 tStartOemDataRspParams* halStartOemDataRspParams;
15771
15772 /*-------------------------------------------------------------------------
15773 Sanity check
15774 -------------------------------------------------------------------------*/
15775 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15776 ( NULL == pEventData->pEventData))
15777 {
15778 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15779 "%s: Invalid parameters", __FUNCTION__);
15780 WDI_ASSERT(0);
15781 return WDI_STATUS_E_FAILURE;
15782 }
15783
15784 wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB;
15785
15786 /*-------------------------------------------------------------------------
15787 Extract response and send it to UMAC
15788 -------------------------------------------------------------------------*/
15789 halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData;
15790
15791
15792 //It is the responsibility of the application code to check for failure
15793 //conditions!
15794
15795 //Allocate memory for WDI OEM DATA RSP structure
15796 wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ;
15797
15798 if(NULL == wdiOemDataRspParams)
15799 {
15800 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15801 "Failed to allocate memory in OEM DATA Response %x %x %x ",
15802 pWDICtx, pEventData, pEventData->pEventData);
15803 WDI_ASSERT(0);
15804 return WDI_STATUS_E_FAILURE;
15805 }
15806
15807 /* Populate WDI structure members */
15808 wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE);
15809
15810 /*Notify UMAC*/
15811 wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData);
15812
15813 //Free memory allocated for WDI OEM_DATA MEAS RSP structure
15814 wpalMemoryFree(wdiOemDataRspParams);
15815
15816 return WDI_STATUS_SUCCESS;
15817}/*WDI_PrcoessStartOemDataRsp*/
15818#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070015819
15820/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015821 Miscellaneous Control Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070015822===========================================================================*/
15823
15824/**
15825 @brief Process Channel Switch Rsp function (called when a response
15826 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015827
15828 @param pWDICtx: pointer to the WLAN DAL context
15829 pEventData: pointer to the event information structure
15830
Jeff Johnson295189b2012-06-20 16:38:30 -070015831 @see
15832 @return Result of the function call
15833*/
15834WDI_Status
15835WDI_ProcessChannelSwitchRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015836(
Jeff Johnson295189b2012-06-20 16:38:30 -070015837 WDI_ControlBlockType* pWDICtx,
15838 WDI_EventInfoType* pEventData
15839)
15840{
15841 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15842 WDI_SwitchChRspCb wdiChSwitchRspCb;
15843 tSwitchChannelRspParams halSwitchChannelRsp;
15844 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15845
15846 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015847 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015848 -------------------------------------------------------------------------*/
15849 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15850 ( NULL == pEventData->pEventData))
15851 {
15852 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15853 "%s: Invalid parameters", __FUNCTION__);
15854 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015855 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015856 }
15857
15858 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15859
15860 /*-------------------------------------------------------------------------
15861 Extract response and send it to UMAC
15862 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015863 wpalMemoryCopy( &halSwitchChannelRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -070015864 (wpt_uint8*)pEventData->pEventData,
15865 sizeof(halSwitchChannelRsp));
15866
Jeff Johnsone7245742012-09-05 17:12:55 -070015867 wdiSwitchChRsp.wdiStatus =
15868 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015869 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15870
15871#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070015872 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070015873#endif
15874
15875 /*Notify UMAC*/
15876 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15877
Jeff Johnsone7245742012-09-05 17:12:55 -070015878 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015879}/*WDI_ProcessChannelSwitchRsp*/
15880
15881
15882/**
15883 @brief Process Config STA Rsp function (called when a response
15884 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015885
15886 @param pWDICtx: pointer to the WLAN DAL context
15887 pEventData: pointer to the event information structure
15888
Jeff Johnson295189b2012-06-20 16:38:30 -070015889 @see
15890 @return Result of the function call
15891*/
15892WDI_Status
15893WDI_ProcessConfigStaRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015894(
Jeff Johnson295189b2012-06-20 16:38:30 -070015895 WDI_ControlBlockType* pWDICtx,
15896 WDI_EventInfoType* pEventData
15897)
15898{
15899 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15900 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15901 WDI_AddStaParams wdiAddSTAParam;
15902
15903 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015904 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015905
Jeff Johnsone7245742012-09-05 17:12:55 -070015906 tConfigStaRspMsg halConfigStaRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070015907 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15908
15909 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015910 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015911 -------------------------------------------------------------------------*/
15912 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15913 ( NULL == pEventData->pEventData))
15914 {
15915 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15916 "%s: Invalid parameters", __FUNCTION__);
15917 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015918 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015919 }
15920
15921 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15922
15923 /*-------------------------------------------------------------------------
15924 Extract response and send it to UMAC
15925 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015926 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15927 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015928 sizeof(halConfigStaRsp.configStaRspParams));
15929
15930
15931 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15932 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15933 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15934 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15935 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15936
15937 /* MAC Address of STA - take from cache as it does not come back in the
15938 response*/
15939 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070015940 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015941 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015942
15943 wdiCfgSTAParams.wdiStatus =
15944 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015945
15946 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15947 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15948 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15949
15950 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15951 {
15952 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15953 {
15954 /* ADD STA to table */
Jeff Johnsone7245742012-09-05 17:12:55 -070015955 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015956 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15957 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015958
Jeff Johnson295189b2012-06-20 16:38:30 -070015959 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015960 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070015961 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070015962 wdiAddSTAParam.ucHTCapable =
15963 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15964 wdiAddSTAParam.ucStaType =
15965 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15966
Jeff Johnson295189b2012-06-20 16:38:30 -070015967 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070015968 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15969 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015970 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015971
15972 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15973 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15974 WDI_MAC_ADDR_LEN);
15975
15976 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15977 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15978 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070015979
15980 if ( NULL == pBSSSes )
15981 {
15982 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15983 "Association for this BSSID is not in place");
Jeff Johnsone7245742012-09-05 17:12:55 -070015984
Jeff Johnson295189b2012-06-20 16:38:30 -070015985 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015986 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070015987 }
15988
15989 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015990 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015991 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015992 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015993 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070015994 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015995 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015996 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015997 halConfigStaRsp.configStaRspParams.ucBcastSig;
15998 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
15999 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070016000
Jeff Johnson295189b2012-06-20 16:38:30 -070016001 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
16002 }
16003 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
16004 {
16005 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
16006
Jeff Johnsone7245742012-09-05 17:12:55 -070016007 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016008 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016009 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070016010 halConfigStaRsp.configStaRspParams.ucBcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070016011 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016012 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070016013 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070016014 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070016015 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070016016 halConfigStaRsp.configStaRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070016017 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016018 halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016019 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070016020 halConfigStaRsp.configStaRspParams.ucUcastSig;
16021 }
16022 }
16023
16024 /*Notify UMAC*/
16025 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
16026
Jeff Johnsone7245742012-09-05 17:12:55 -070016027 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016028}/*WDI_ProcessConfigStaRsp*/
16029
16030
16031/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016032 @brief Process Set Link State Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016033 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016034
16035 @param pWDICtx: pointer to the WLAN DAL context
16036 pEventData: pointer to the event information structure
16037
Jeff Johnson295189b2012-06-20 16:38:30 -070016038 @see
16039 @return Result of the function call
16040*/
16041WDI_Status
16042WDI_ProcessSetLinkStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016043(
Jeff Johnson295189b2012-06-20 16:38:30 -070016044 WDI_ControlBlockType* pWDICtx,
16045 WDI_EventInfoType* pEventData
16046)
16047{
16048 WDI_Status wdiStatus;
16049 eHalStatus halStatus;
16050 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
16051
16052 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070016053 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070016054 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16055
16056 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016057 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016058 -------------------------------------------------------------------------*/
16059 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16060 ( NULL == pEventData->pEventData))
16061 {
16062 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16063 "%s: Invalid parameters", __FUNCTION__);
16064 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016065 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016066 }
16067
16068 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
16069
16070 wpalMutexAcquire(&pWDICtx->wptMutex);
16071
16072 /*If the link is being transitioned to idle - the BSS is to be deleted
16073 - this type of ending a session is possible when UMAC has failed an
16074 - association session during Join*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016075 if ( WDI_LINK_IDLE_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016076 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16077 {
16078 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016079 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070016080 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016081 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
16082 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
16083 &pBSSSes);
16084
Jeff Johnson295189b2012-06-20 16:38:30 -070016085 /*-----------------------------------------------------------------------
16086 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070016087 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070016088 -----------------------------------------------------------------------*/
16089 if ( NULL == pBSSSes )
16090 {
16091 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
16092 "Set link response received outside association session");
16093 }
16094 else
16095 {
16096 /* For BT AMP roles no need to delete the sessions if assoc fails. There
16097 will be del BSS coming after this to stop the beaconing & cleaning up the
16098 sessions*/
16099 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
16100 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
16101 {
16102 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016103 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070016104 -----------------------------------------------------------------------*/
16105 WDI_DeleteSession(pWDICtx, pBSSSes);
16106
16107 /*-----------------------------------------------------------------------
16108 Check to see if this association is in progress - if so disable the
16109 flag as this has ended
16110 -----------------------------------------------------------------------*/
16111 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
Jeff Johnsone7245742012-09-05 17:12:55 -070016112 {
Jeff Johnson295189b2012-06-20 16:38:30 -070016113 /*Association no longer in progress */
16114 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16115 /*Association no longer in progress - prepare pending assoc for processing*/
16116 WDI_DequeueAssocRequest(pWDICtx);
16117 }
16118 }
16119 }
16120 }
16121 /* If the link state has been set to POST ASSOC, reset the "association in
16122 progress" flag */
Jeff Johnsone7245742012-09-05 17:12:55 -070016123 if ( WDI_LINK_POSTASSOC_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016124 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16125 {
16126 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16127 WDI_DequeueAssocRequest(pWDICtx);
16128 }
16129
16130 wpalMutexRelease(&pWDICtx->wptMutex);
16131
16132 /*-------------------------------------------------------------------------
16133 Extract response and send it to UMAC
16134 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016135 wpalMemoryCopy( &halStatus,
16136 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016137 sizeof(halStatus));
16138
Jeff Johnsone7245742012-09-05 17:12:55 -070016139 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016140
16141 /*Notify UMAC*/
16142 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16143
Jeff Johnsone7245742012-09-05 17:12:55 -070016144 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016145}/*WDI_ProcessSetLinkStateRsp*/
16146
16147/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016148 @brief Process Get Stats Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016149 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016150
16151 @param pWDICtx: pointer to the WLAN DAL context
16152 pEventData: pointer to the event information structure
16153
Jeff Johnson295189b2012-06-20 16:38:30 -070016154 @see
16155 @return Result of the function call
16156*/
16157WDI_Status
16158WDI_ProcessGetStatsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016159(
Jeff Johnson295189b2012-06-20 16:38:30 -070016160 WDI_ControlBlockType* pWDICtx,
16161 WDI_EventInfoType* pEventData
16162)
16163{
16164 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
16165 WDI_GetStatsRspCb wdiGetStatsRspCb;
16166 tHalStatsRspParams* pHalStatsRspParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070016167
Jeff Johnson295189b2012-06-20 16:38:30 -070016168 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16169
16170 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016171 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016172 -------------------------------------------------------------------------*/
16173 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16174 ( NULL == pEventData->pEventData))
16175 {
16176 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16177 "%s: Invalid parameters", __FUNCTION__);
16178 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016179 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016180 }
16181
16182 /*-------------------------------------------------------------------------
16183 Extract response and send it to UMAC
16184 -------------------------------------------------------------------------*/
16185 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
16186
16187 /*allocate the stats response buffer */
16188 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
16189 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
16190 + sizeof(WDI_GetStatsRspParamsType));
16191
16192 if(NULL == wdiGetStatsRsp)
16193 {
16194 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16195 "Failed to allocate memory in Get Stats Response %x %x %x ",
16196 pWDICtx, pEventData, pEventData->pEventData);
16197 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016198 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016199 }
16200
16201 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
16202
16203 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
16204 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
16205 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
16206 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
16207 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
16208 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
16209
16210 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
16211 wpalMemoryCopy(wdiGetStatsRsp + 1,
16212 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
16213 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
16214
16215 /*Notify UMAC*/
16216 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
16217
16218 wpalMemoryFree(wdiGetStatsRsp);
16219
Jeff Johnsone7245742012-09-05 17:12:55 -070016220 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016221}/*WDI_ProcessGetStatsRsp*/
16222
16223
16224/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016225 @brief Process Update Cfg Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016226 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016227
16228 @param pWDICtx: pointer to the WLAN DAL context
16229 pEventData: pointer to the event information structure
16230
Jeff Johnson295189b2012-06-20 16:38:30 -070016231 @see
16232 @return Result of the function call
16233*/
16234WDI_Status
16235WDI_ProcessUpdateCfgRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016236(
Jeff Johnson295189b2012-06-20 16:38:30 -070016237 WDI_ControlBlockType* pWDICtx,
16238 WDI_EventInfoType* pEventData
16239)
16240{
16241 WDI_Status wdiStatus;
16242 eHalStatus halStatus;
16243 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
16244 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16245
16246 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016247 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016248 -------------------------------------------------------------------------*/
16249 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16250 ( NULL == pEventData->pEventData))
16251 {
16252 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16253 "%s: Invalid parameters", __FUNCTION__);
16254 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016255 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016256 }
16257
16258 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
16259
16260 /*-------------------------------------------------------------------------
16261 Extract response and send it to UMAC
16262 -------------------------------------------------------------------------*/
16263 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016264 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016265
16266 /*Notify UMAC*/
16267 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16268
Jeff Johnsone7245742012-09-05 17:12:55 -070016269 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016270}/*WDI_ProcessUpdateCfgRsp*/
16271
16272
16273
16274/**
16275 @brief Process Add BA Rsp function (called when a response
16276 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016277
16278 @param pWDICtx: pointer to the WLAN DAL context
16279 pEventData: pointer to the event information structure
16280
Jeff Johnson295189b2012-06-20 16:38:30 -070016281 @see
16282 @return Result of the function call
16283*/
16284WDI_Status
16285WDI_ProcessAddBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016286(
Jeff Johnson295189b2012-06-20 16:38:30 -070016287 WDI_ControlBlockType* pWDICtx,
16288 WDI_EventInfoType* pEventData
16289)
16290{
16291 WDI_AddBARspCb wdiAddBARspCb;
16292
16293 tAddBARspParams halAddBARsp;
16294 WDI_AddBARspinfoType wdiAddBARsp;
16295
16296 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16297
16298 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016299 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016300 -------------------------------------------------------------------------*/
16301 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16302 ( NULL == pEventData->pEventData))
16303 {
16304 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16305 "%s: Invalid parameters", __FUNCTION__);
16306 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016307 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016308 }
16309
16310 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
16311
16312 /*-------------------------------------------------------------------------
16313 Extract response and send it to UMAC
16314 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016315 wpalMemoryCopy( &halAddBARsp,
16316 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016317 sizeof(halAddBARsp));
16318
16319 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
16320
Jeff Johnson43971f52012-07-17 12:26:56 -070016321 if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070016322 {
16323 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
16324 }
16325
16326 /*Notify UMAC*/
16327 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
16328
Jeff Johnsone7245742012-09-05 17:12:55 -070016329 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016330}/*WDI_ProcessAddSessionBARsp*/
16331
16332/**
16333 @brief Process Add BA Rsp function (called when a response
16334 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016335
16336 @param pWDICtx: pointer to the WLAN DAL context
16337 pEventData: pointer to the event information structure
16338
Jeff Johnson295189b2012-06-20 16:38:30 -070016339 @see
16340 @return Result of the function call
16341*/
16342WDI_Status
16343WDI_ProcessTriggerBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016344(
Jeff Johnson295189b2012-06-20 16:38:30 -070016345 WDI_ControlBlockType* pWDICtx,
16346 WDI_EventInfoType* pEventData
16347)
16348{
16349 WDI_TriggerBARspCb wdiTriggerBARspCb;
16350
16351 tTriggerBARspParams* halTriggerBARsp;
16352 tTriggerBaRspCandidate* halBaCandidate;
16353 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
16354 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
16355 wpt_uint16 index;
16356 wpt_uint16 TidIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016357
Jeff Johnson295189b2012-06-20 16:38:30 -070016358 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16359
16360 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016361 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016362 -------------------------------------------------------------------------*/
16363 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16364 ( NULL == pEventData->pEventData))
16365 {
16366 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16367 "%s: Invalid parameters", __FUNCTION__);
16368 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016369 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016370 }
16371
16372 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
16373
16374 /*-------------------------------------------------------------------------
16375 Extract response and send it to UMAC
16376 -------------------------------------------------------------------------*/
16377 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
16378
Jeff Johnsone7245742012-09-05 17:12:55 -070016379 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
16380 halTriggerBARsp->baCandidateCnt *
Jeff Johnson295189b2012-06-20 16:38:30 -070016381 sizeof(WDI_TriggerBARspCandidateType));
16382 if(NULL == wdiTriggerBARsp)
16383 {
16384 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16385 "Failed to allocate memory in Trigger BA Response %x %x %x ",
16386 pWDICtx, pEventData, pEventData->pEventData);
16387 wpalMemoryFree(halTriggerBARsp);
16388 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016389 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016390 }
16391
16392 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
16393
16394 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
16395 {
16396 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
Jeff Johnsone7245742012-09-05 17:12:55 -070016397 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070016398 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
16399
16400 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
16401 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
16402
16403 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
16404 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016405 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070016406 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
16407 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
16408 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016409 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070016410 halBaCandidate->baInfo[TidIndex].fBaEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070016411 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
Jeff Johnson295189b2012-06-20 16:38:30 -070016412 halBaCandidate->baInfo[TidIndex].startingSeqNum;
16413 }
16414 wdiTriggerBARspCandidate++;
16415 halBaCandidate++;
16416 }
16417 }
16418
16419 /*Notify UMAC*/
16420 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16421
16422 wpalMemoryFree(wdiTriggerBARsp);
Jeff Johnsone7245742012-09-05 17:12:55 -070016423 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016424}/*WDI_ProcessAddSessionBARsp*/
16425
16426/**
16427 @brief Process Update Beacon Params Rsp function (called when a response
16428 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016429
16430 @param pWDICtx: pointer to the WLAN DAL context
16431 pEventData: pointer to the event information structure
16432
Jeff Johnson295189b2012-06-20 16:38:30 -070016433 @see
16434 @return Result of the function call
16435*/
16436WDI_Status
16437WDI_ProcessUpdateBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016438(
Jeff Johnson295189b2012-06-20 16:38:30 -070016439 WDI_ControlBlockType* pWDICtx,
16440 WDI_EventInfoType* pEventData
16441)
16442{
16443 WDI_Status wdiStatus;
16444 eHalStatus halStatus;
16445 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16446 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16447
16448 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016449 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016450 -------------------------------------------------------------------------*/
16451 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16452 ( NULL == pEventData->pEventData))
16453 {
16454 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16455 "%s: Invalid parameters", __FUNCTION__);
16456 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016457 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016458 }
16459
16460 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16461
16462 /*-------------------------------------------------------------------------
16463 Extract response and send it to UMAC
16464 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016465 wpalMemoryCopy( &halStatus,
16466 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016467 sizeof(halStatus));
16468
Jeff Johnsone7245742012-09-05 17:12:55 -070016469 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016470
16471 /*Notify UMAC*/
16472 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16473
Jeff Johnsone7245742012-09-05 17:12:55 -070016474 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016475}/*WDI_ProcessUpdateBeaconParamsRsp*/
16476
16477/**
16478 @brief Process Send Beacon template Rsp function (called when a response
16479 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016480
16481 @param pWDICtx: pointer to the WLAN DAL context
16482 pEventData: pointer to the event information structure
16483
Jeff Johnson295189b2012-06-20 16:38:30 -070016484 @see
16485 @return Result of the function call
16486*/
16487WDI_Status
16488WDI_ProcessSendBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016489(
Jeff Johnson295189b2012-06-20 16:38:30 -070016490 WDI_ControlBlockType* pWDICtx,
16491 WDI_EventInfoType* pEventData
16492)
16493{
16494 WDI_Status wdiStatus;
16495 eHalStatus halStatus;
16496 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16497 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16498
16499 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016500 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016501 -------------------------------------------------------------------------*/
16502 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16503 ( NULL == pEventData->pEventData))
16504 {
16505 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16506 "%s: Invalid parameters", __FUNCTION__);
16507 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016508 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016509 }
16510
16511 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16512
16513 /*-------------------------------------------------------------------------
16514 Extract response and send it to UMAC
16515 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016516 wpalMemoryCopy( &halStatus,
16517 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016518 sizeof(halStatus));
16519
Jeff Johnsone7245742012-09-05 17:12:55 -070016520 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016521
16522 /*Notify UMAC*/
16523 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16524
Jeff Johnsone7245742012-09-05 17:12:55 -070016525 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016526}/*WDI_ProcessSendBeaconParamsRsp*/
16527
Jeff Johnsone7245742012-09-05 17:12:55 -070016528
Jeff Johnson295189b2012-06-20 16:38:30 -070016529/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016530 @brief Process Update Probe Resp Template Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016531 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016532
16533 @param pWDICtx: pointer to the WLAN DAL context
16534 pEventData: pointer to the event information structure
16535
Jeff Johnson295189b2012-06-20 16:38:30 -070016536 @see
16537 @return Result of the function call
16538*/
16539WDI_Status
16540WDI_ProcessUpdateProbeRspTemplateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016541(
Jeff Johnson295189b2012-06-20 16:38:30 -070016542 WDI_ControlBlockType* pWDICtx,
16543 WDI_EventInfoType* pEventData
16544)
16545{
16546 WDI_Status wdiStatus;
16547 eHalStatus halStatus;
16548 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16549 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16550
16551 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016552 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016553 -------------------------------------------------------------------------*/
16554 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16555 ( NULL == pEventData->pEventData))
16556 {
16557 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16558 "%s: Invalid parameters", __FUNCTION__);
16559 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016560 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016561 }
16562
16563 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16564
16565 /*-------------------------------------------------------------------------
16566 Extract response and send it to UMAC
16567 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016568 wpalMemoryCopy( &halStatus,
16569 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016570 sizeof(halStatus));
16571
Jeff Johnsone7245742012-09-05 17:12:55 -070016572 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016573
16574 /*Notify UMAC*/
16575 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16576
Jeff Johnsone7245742012-09-05 17:12:55 -070016577 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016578}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16579
16580 /**
16581 @brief Process Set Max Tx Power Rsp function (called when a response
16582 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016583
16584 @param pWDICtx: pointer to the WLAN DAL context
16585 pEventData: pointer to the event information structure
16586
Jeff Johnson295189b2012-06-20 16:38:30 -070016587 @see
16588 @return Result of the function call
16589*/
16590WDI_Status
16591WDI_ProcessSetMaxTxPowerRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016592(
Jeff Johnson295189b2012-06-20 16:38:30 -070016593 WDI_ControlBlockType* pWDICtx,
16594 WDI_EventInfoType* pEventData
16595)
16596{
16597 tSetMaxTxPwrRspMsg halTxpowerrsp;
Jeff Johnsone7245742012-09-05 17:12:55 -070016598
Jeff Johnson295189b2012-06-20 16:38:30 -070016599 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070016600
Jeff Johnson295189b2012-06-20 16:38:30 -070016601 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16602 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16603
16604 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016605 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016606 -------------------------------------------------------------------------*/
16607 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16608 ( NULL == pEventData->pEventData))
16609 {
16610 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16611 "%s: Invalid parameters", __FUNCTION__);
16612 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016613 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016614 }
16615
16616 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16617
16618 /*-------------------------------------------------------------------------
16619 Extract response and send it to UMAC
16620 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016621 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16622 pEventData->pEventData,
16623 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070016624
16625 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16626 {
16627 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16628 "Error status returned in Set Max Tx Power Response ");
Jeff Johnsone7245742012-09-05 17:12:55 -070016629 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16630 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016631 }
16632
Jeff Johnsone7245742012-09-05 17:12:55 -070016633 wdiSetMaxTxPowerRspMsg.wdiStatus =
Jeff Johnson295189b2012-06-20 16:38:30 -070016634 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
Jeff Johnsone7245742012-09-05 17:12:55 -070016635 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
Jeff Johnson295189b2012-06-20 16:38:30 -070016636
16637 /*Notify UMAC*/
16638 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16639
Jeff Johnsone7245742012-09-05 17:12:55 -070016640 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016641}
16642
16643#ifdef WLAN_FEATURE_P2P
16644/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016645 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016646 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016647
16648 @param pWDICtx: pointer to the WLAN DAL context
16649 pEventData: pointer to the event information structure
16650
Jeff Johnson295189b2012-06-20 16:38:30 -070016651 @see
16652 @return Result of the function call
16653*/
16654WDI_Status
16655WDI_ProcessP2PGONOARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016656(
Jeff Johnson295189b2012-06-20 16:38:30 -070016657 WDI_ControlBlockType* pWDICtx,
16658 WDI_EventInfoType* pEventData
16659)
16660{
16661 WDI_Status wdiStatus;
16662 eHalStatus halStatus;
16663 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16664 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16665
16666 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016667 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016668 -------------------------------------------------------------------------*/
16669 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16670 ( NULL == pEventData->pEventData))
16671 {
16672 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16673 "%s: Invalid parameters", __FUNCTION__);
16674 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016675 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016676 }
16677
16678 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16679
16680 /*-------------------------------------------------------------------------
16681 Extract response and send it to UMAC
16682 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016683 wpalMemoryCopy( &halStatus,
16684 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016685 sizeof(halStatus));
16686
Jeff Johnsone7245742012-09-05 17:12:55 -070016687 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016688
16689 /*Notify UMAC*/
16690 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16691
Jeff Johnsone7245742012-09-05 17:12:55 -070016692 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016693}/*WDI_ProcessP2PGONOARsp*/
16694#endif
16695/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016696 @brief Process Enter IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016697 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016698
16699 @param pWDICtx: pointer to the WLAN DAL context
16700 pEventData: pointer to the event information structure
16701
Jeff Johnson295189b2012-06-20 16:38:30 -070016702 @see
16703 @return Result of the function call
16704*/
16705WDI_Status
16706WDI_ProcessEnterImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016707(
Jeff Johnson295189b2012-06-20 16:38:30 -070016708 WDI_ControlBlockType* pWDICtx,
16709 WDI_EventInfoType* pEventData
16710)
16711{
16712 WDI_Status wdiStatus;
16713 eHalStatus halStatus;
16714 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16715 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16716
16717 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016718 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016719 -------------------------------------------------------------------------*/
16720 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16721 ( NULL == pEventData->pEventData))
16722 {
16723 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16724 "%s: Invalid parameters", __FUNCTION__);
16725 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016726 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016727 }
16728
16729 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16730
16731 /*-------------------------------------------------------------------------
16732 Extract response and send it to UMAC
16733 -------------------------------------------------------------------------*/
16734 halStatus = *((eHalStatus*)pEventData->pEventData);
16735
Jeff Johnsone7245742012-09-05 17:12:55 -070016736 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016737
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016738 /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state.
16739 * Other module states are taken care by PMC.
16740 * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails??
16741 */
16742 if (wdiStatus != WDI_STATUS_SUCCESS) {
16743
16744 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16745 "WDI PRocess Enter IMPS RSP failed With HAL Status Code: %d",halStatus);
16746 /* Call Back is not required as we are putting the DXE in FULL
16747 * and riva is already in full (IMPS RSP Failed)*/
16748 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16749 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016750 /*Notify UMAC*/
16751 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16752
Jeff Johnsone7245742012-09-05 17:12:55 -070016753 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016754}/*WDI_ProcessEnterImpsRsp*/
16755
16756/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016757 @brief Process Exit IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016758 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016759
16760 @param pWDICtx: pointer to the WLAN DAL context
16761 pEventData: pointer to the event information structure
16762
Jeff Johnson295189b2012-06-20 16:38:30 -070016763 @see
16764 @return Result of the function call
16765*/
16766WDI_Status
16767WDI_ProcessExitImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016768(
Jeff Johnson295189b2012-06-20 16:38:30 -070016769 WDI_ControlBlockType* pWDICtx,
16770 WDI_EventInfoType* pEventData
16771)
16772{
16773 WDI_Status wdiStatus;
16774 eHalStatus halStatus;
16775 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16776 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16777
16778 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016779 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016780 -------------------------------------------------------------------------*/
16781 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16782 ( NULL == pEventData->pEventData))
16783 {
16784 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16785 "%s: Invalid parameters", __FUNCTION__);
16786 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016787 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016788 }
16789
16790 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16791
16792 /*-------------------------------------------------------------------------
16793 Extract response and send it to UMAC
16794 -------------------------------------------------------------------------*/
16795 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016796 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016797
16798 // notify DTS that we are entering Full power
16799 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16800
16801 /*Notify UMAC*/
16802 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16803
Jeff Johnsone7245742012-09-05 17:12:55 -070016804 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016805}/*WDI_ProcessExitImpsRsp*/
16806
16807/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016808 @brief Process Enter BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016809 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016810
16811 @param pWDICtx: pointer to the WLAN DAL context
16812 pEventData: pointer to the event information structure
16813
Jeff Johnson295189b2012-06-20 16:38:30 -070016814 @see
16815 @return Result of the function call
16816*/
16817WDI_Status
16818WDI_ProcessEnterBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016819(
Jeff Johnson295189b2012-06-20 16:38:30 -070016820 WDI_ControlBlockType* pWDICtx,
16821 WDI_EventInfoType* pEventData
16822)
16823{
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016824 eHalStatus halStatus = eHAL_STATUS_FAILURE;
16825 tHalEnterBmpsRspParams halEnterBmpsRsp;
16826 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16827 WDI_EnterBmpsRspParamsType wdiEnterBmpsRspparams;
16828
Jeff Johnson295189b2012-06-20 16:38:30 -070016829 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16830
16831 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016832 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016833 -------------------------------------------------------------------------*/
16834 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16835 ( NULL == pEventData->pEventData))
16836 {
16837 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16838 "%s: Invalid parameters", __FUNCTION__);
16839 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016840 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016841 }
16842
Jeff Johnson295189b2012-06-20 16:38:30 -070016843 /*-------------------------------------------------------------------------
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016844 Extract response and send it to UMAC
16845 -------------------------------------------------------------------------*/
16846 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
16847 {
16848 wpalMemoryCopy( &halEnterBmpsRsp,
16849 pEventData->pEventData,
16850 sizeof(halEnterBmpsRsp));
16851
16852 //Used to print debug message
16853 halStatus = halEnterBmpsRsp.status;
16854 wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterBmpsRsp.status);
16855 wdiEnterBmpsRspparams.bssIdx = halEnterBmpsRsp.bssIdx;
16856 }
16857 else
16858 {
16859 halStatus = *((eHalStatus*)pEventData->pEventData);
16860 wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16861 }
16862
16863 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070016864
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016865 /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state.
16866 * Other module states are taken care by PMC.
16867 * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails??
16868 */
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016869 if (wdiEnterBmpsRspparams.wdiStatus != WDI_STATUS_SUCCESS)
16870 {
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016871
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016872 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16873 "WDI PRocess Enter BMPS RSP failed With HAL Status Code: %d",halStatus);
16874 /* Call Back is not required as we are putting the DXE in FULL
16875 * and riva is already in FULL (BMPS RSP Failed)*/
16876 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16877 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016878 }
16879
Jeff Johnson295189b2012-06-20 16:38:30 -070016880 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016881 wdiEnterBmpsRspCb( &wdiEnterBmpsRspparams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070016882
Jeff Johnsone7245742012-09-05 17:12:55 -070016883 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016884}/*WDI_ProcessEnterBmpsRsp*/
16885
16886/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016887 @brief Process Exit BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016888 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016889
16890 @param pWDICtx: pointer to the WLAN DAL context
16891 pEventData: pointer to the event information structure
16892
Jeff Johnson295189b2012-06-20 16:38:30 -070016893 @see
16894 @return Result of the function call
16895*/
16896WDI_Status
16897WDI_ProcessExitBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016898(
Jeff Johnson295189b2012-06-20 16:38:30 -070016899 WDI_ControlBlockType* pWDICtx,
16900 WDI_EventInfoType* pEventData
16901)
16902{
Jeff Johnson295189b2012-06-20 16:38:30 -070016903 eHalStatus halStatus;
16904 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016905 tHalExitBmpsRspParams halExitBmpsRsp;
16906 WDI_ExitBmpsRspParamsType wdiExitBmpsRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070016907 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16908
16909 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016910 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016911 -------------------------------------------------------------------------*/
16912 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16913 ( NULL == pEventData->pEventData))
16914 {
16915 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16916 "%s: Invalid parameters", __FUNCTION__);
16917 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016918 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016919 }
16920
16921 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16922
16923 /*-------------------------------------------------------------------------
16924 Extract response and send it to UMAC
16925 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016926
16927 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
16928 {
16929 wpalMemoryCopy( &halExitBmpsRsp,
16930 pEventData->pEventData,
16931 sizeof(halExitBmpsRsp));
16932
16933 wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitBmpsRsp.status);
16934 wdiExitBmpsRspParams.bssIdx = halExitBmpsRsp.bssIdx;
16935 }
16936 else
16937 {
16938 halStatus = *((eHalStatus*)pEventData->pEventData);
16939 wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16940 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016941
16942 // notify DTS that we are entering Full power
16943 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16944
16945 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16946
16947 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016948 wdiExitBmpsRspCb( &wdiExitBmpsRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070016949
Jeff Johnsone7245742012-09-05 17:12:55 -070016950 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016951}/*WDI_ProcessExitBmpsRsp*/
16952
16953/**
16954 @brief Process Enter UAPSD Rsp function (called when a response
16955 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016956
16957 @param pWDICtx: pointer to the WLAN DAL context
16958 pEventData: pointer to the event information structure
16959
Jeff Johnson295189b2012-06-20 16:38:30 -070016960 @see
16961 @return Result of the function call
16962*/
16963WDI_Status
16964WDI_ProcessEnterUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016965(
Jeff Johnson295189b2012-06-20 16:38:30 -070016966 WDI_ControlBlockType* pWDICtx,
16967 WDI_EventInfoType* pEventData
16968)
16969{
Jeff Johnson295189b2012-06-20 16:38:30 -070016970 eHalStatus halStatus;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016971 tUapsdRspParams halEnterUapsdRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070016972 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016973 WDI_EnterUapsdRspParamsType wdiEnterUapsdRspParams;
16974
Jeff Johnson295189b2012-06-20 16:38:30 -070016975 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16976
16977 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016978 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016979 -------------------------------------------------------------------------*/
16980 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16981 ( NULL == pEventData->pEventData))
16982 {
16983 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16984 "%s: Invalid parameters", __FUNCTION__);
16985 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016986 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016987 }
16988
16989 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16990
16991 /*-------------------------------------------------------------------------
16992 Extract response and send it to UMAC
16993 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016994 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
16995 {
16996 wpalMemoryCopy( &halEnterUapsdRsp,
16997 pEventData->pEventData,
16998 sizeof(halEnterUapsdRsp));
Jeff Johnson295189b2012-06-20 16:38:30 -070016999
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017000 wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterUapsdRsp.status);
17001 wdiEnterUapsdRspParams.bssIdx = halEnterUapsdRsp.bssIdx;
17002 }
17003 else
17004 {
17005 halStatus = *((eHalStatus*)pEventData->pEventData);
17006 wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17007 }
17008
17009 if(WDI_STATUS_SUCCESS == wdiEnterUapsdRspParams.wdiStatus)
Jeff Johnson295189b2012-06-20 16:38:30 -070017010 {
17011 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
17012 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
17013 // the traffic to decide when to suspend the trigger frames when there is no traffic
17014 // activity on the trigger enabled ACs
17015 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
17016
17017#ifdef WLAN_PERF
17018 // Increment the BD signature to refresh the fast path BD utilization
17019 pWDICtx->uBdSigSerialNum++;
17020#endif
17021 }
17022
17023 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017024 wdiEnterUapsdRspCb( &wdiEnterUapsdRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017025
Jeff Johnsone7245742012-09-05 17:12:55 -070017026 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017027}/*WDI_ProcessEnterUapsdRsp*/
17028
17029/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017030 @brief Process Exit UAPSD Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017031 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017032
17033 @param pWDICtx: pointer to the WLAN DAL context
17034 pEventData: pointer to the event information structure
17035
Jeff Johnson295189b2012-06-20 16:38:30 -070017036 @see
17037 @return Result of the function call
17038*/
17039WDI_Status
17040WDI_ProcessExitUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017041(
Jeff Johnson295189b2012-06-20 16:38:30 -070017042 WDI_ControlBlockType* pWDICtx,
17043 WDI_EventInfoType* pEventData
17044)
17045{
Jeff Johnson295189b2012-06-20 16:38:30 -070017046 eHalStatus halStatus;
17047 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017048 tHalExitUapsdRspParams halExitUapsdRsp;
17049 WDI_ExitUapsdRspParamsType wdiExitUapsdRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070017050 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17051
17052 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017053 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017054 -------------------------------------------------------------------------*/
17055 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17056 ( NULL == pEventData->pEventData))
17057 {
17058 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17059 "%s: Invalid parameters", __FUNCTION__);
17060 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017061 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017062 }
17063
17064 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
17065
17066 /*-------------------------------------------------------------------------
17067 Extract response and send it to UMAC
17068 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017069 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17070 {
17071 wpalMemoryCopy( &halExitUapsdRsp,
17072 pEventData->pEventData,
17073 sizeof(halExitUapsdRsp));
17074
17075 wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitUapsdRsp.status);
17076 wdiExitUapsdRspParams.bssIdx = halExitUapsdRsp.bssIdx;
17077 }
17078 else
17079 {
17080 halStatus = *((eHalStatus*)pEventData->pEventData);
17081 wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17082 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017083 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
17084 // directly instead of the FW WQ.
17085 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
17086
17087#ifdef WLAN_PERF
17088 // Increment the BD signature to refresh the fast path BD utilization
17089 pWDICtx->uBdSigSerialNum++;
17090#endif
17091
17092 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017093 wdiExitUapsdRspCb( &wdiExitUapsdRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017094
Jeff Johnsone7245742012-09-05 17:12:55 -070017095 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017096}/*WDI_ProcessExitUapsdRsp*/
17097
17098/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017099 @brief Process set UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017100 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017101
17102 @param pWDICtx: pointer to the WLAN DAL context
17103 pEventData: pointer to the event information structure
17104
Jeff Johnson295189b2012-06-20 16:38:30 -070017105 @see
17106 @return Result of the function call
17107*/
17108WDI_Status
17109WDI_ProcessSetUapsdAcParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017110(
Jeff Johnson295189b2012-06-20 16:38:30 -070017111 WDI_ControlBlockType* pWDICtx,
17112 WDI_EventInfoType* pEventData
17113)
17114{
17115 WDI_Status wdiStatus;
17116 eHalStatus halStatus;
17117 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
17118 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17119
17120 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017121 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017122 -------------------------------------------------------------------------*/
17123 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17124 ( NULL == pEventData->pEventData))
17125 {
17126 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17127 "%s: Invalid parameters", __FUNCTION__);
17128 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017129 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017130 }
17131
17132 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
17133
17134 /*-------------------------------------------------------------------------
17135 Extract response and send it to UMAC
17136 -------------------------------------------------------------------------*/
17137 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017138 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017139
17140 /*Notify UMAC*/
17141 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17142
Jeff Johnsone7245742012-09-05 17:12:55 -070017143 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017144}/*WDI_ProcessSetUapsdAcParamsRsp*/
17145
17146/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017147 @brief Process update UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017148 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017149
17150 @param pWDICtx: pointer to the WLAN DAL context
17151 pEventData: pointer to the event information structure
17152
Jeff Johnson295189b2012-06-20 16:38:30 -070017153 @see
17154 @return Result of the function call
17155*/
17156WDI_Status
17157WDI_ProcessUpdateUapsdParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017158(
Jeff Johnson295189b2012-06-20 16:38:30 -070017159 WDI_ControlBlockType* pWDICtx,
17160 WDI_EventInfoType* pEventData
17161)
17162{
17163 WDI_Status wdiStatus;
17164 eHalStatus halStatus;
17165 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
17166 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17167
17168 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017169 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017170 -------------------------------------------------------------------------*/
17171 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17172 ( NULL == pEventData->pEventData))
17173 {
17174 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17175 "%s: Invalid parameters", __FUNCTION__);
17176 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017177 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017178 }
17179
17180 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
17181
17182 /*-------------------------------------------------------------------------
17183 Extract response and send it to UMAC
17184 -------------------------------------------------------------------------*/
17185 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017186 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017187
17188 /*Notify UMAC*/
17189 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17190
Jeff Johnsone7245742012-09-05 17:12:55 -070017191 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017192}/*WDI_ProcessUpdateUapsdParamsRsp*/
17193
17194/**
17195 @brief Process Configure RXP filter Rsp function (called when a
17196 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017197
17198 @param pWDICtx: pointer to the WLAN DAL context
17199 pEventData: pointer to the event information structure
17200
Jeff Johnson295189b2012-06-20 16:38:30 -070017201 @see
17202 @return Result of the function call
17203*/
17204WDI_Status
17205WDI_ProcessConfigureRxpFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017206(
Jeff Johnson295189b2012-06-20 16:38:30 -070017207 WDI_ControlBlockType* pWDICtx,
17208 WDI_EventInfoType* pEventData
17209)
17210{
17211 WDI_Status wdiStatus;
17212 eHalStatus halStatus;
17213 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
17214 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17215
17216 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017217 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017218 -------------------------------------------------------------------------*/
17219 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17220 ( NULL == pEventData->pEventData))
17221 {
17222 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17223 "%s: Invalid parameters", __FUNCTION__);
17224 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017225 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017226 }
17227
17228 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
17229
17230 /*-------------------------------------------------------------------------
17231 Extract response and send it to UMAC
17232 -------------------------------------------------------------------------*/
17233 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017234 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017235
17236 /*Notify UMAC*/
17237 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17238
Jeff Johnsone7245742012-09-05 17:12:55 -070017239 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017240}/*WDI_ProcessConfigureRxpFilterRsp*/
17241
17242/**
17243 @brief Process Set beacon filter Rsp function (called when a
17244 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017245
17246 @param pWDICtx: pointer to the WLAN DAL context
17247 pEventData: pointer to the event information structure
17248
Jeff Johnson295189b2012-06-20 16:38:30 -070017249 @see
17250 @return Result of the function call
17251*/
17252WDI_Status
17253WDI_ProcessSetBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017254(
Jeff Johnson295189b2012-06-20 16:38:30 -070017255 WDI_ControlBlockType* pWDICtx,
17256 WDI_EventInfoType* pEventData
17257)
17258{
17259 WDI_Status wdiStatus;
17260 eHalStatus halStatus;
17261 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
17262 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17263
17264 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017265 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017266 -------------------------------------------------------------------------*/
17267 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17268 ( NULL == pEventData->pEventData))
17269 {
17270 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17271 "%s: Invalid parameters", __FUNCTION__);
17272 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017273 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017274 }
17275
17276 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
17277
17278 /*-------------------------------------------------------------------------
17279 Extract response and send it to UMAC
17280 -------------------------------------------------------------------------*/
17281 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017282 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017283
17284 /*Notify UMAC*/
17285 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17286
Jeff Johnsone7245742012-09-05 17:12:55 -070017287 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017288}/*WDI_ProcessSetBeaconFilterRsp*/
17289
17290/**
17291 @brief Process remove beacon filter Rsp function (called when a
17292 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017293
17294 @param pWDICtx: pointer to the WLAN DAL context
17295 pEventData: pointer to the event information structure
17296
Jeff Johnson295189b2012-06-20 16:38:30 -070017297 @see
17298 @return Result of the function call
17299*/
17300WDI_Status
17301WDI_ProcessRemBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017302(
Jeff Johnson295189b2012-06-20 16:38:30 -070017303 WDI_ControlBlockType* pWDICtx,
17304 WDI_EventInfoType* pEventData
17305)
17306{
17307 WDI_Status wdiStatus;
17308 eHalStatus halStatus;
17309 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
17310 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17311
17312 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017313 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017314 -------------------------------------------------------------------------*/
17315 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17316 ( NULL == pEventData->pEventData))
17317 {
17318 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17319 "%s: Invalid parameters", __FUNCTION__);
17320 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017321 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017322 }
17323
17324 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
17325
17326 /*-------------------------------------------------------------------------
17327 Extract response and send it to UMAC
17328 -------------------------------------------------------------------------*/
17329 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017330 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017331
17332 /*Notify UMAC*/
17333 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17334
Jeff Johnsone7245742012-09-05 17:12:55 -070017335 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017336}/*WDI_ProcessRemBeaconFilterRsp*/
17337
17338/**
17339 @brief Process set RSSI thresholds Rsp function (called when a
17340 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017341
17342 @param pWDICtx: pointer to the WLAN DAL context
17343 pEventData: pointer to the event information structure
17344
Jeff Johnson295189b2012-06-20 16:38:30 -070017345 @see
17346 @return Result of the function call
17347*/
17348WDI_Status
17349WDI_ProcessSetRSSIThresoldsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017350(
Jeff Johnson295189b2012-06-20 16:38:30 -070017351 WDI_ControlBlockType* pWDICtx,
17352 WDI_EventInfoType* pEventData
17353)
17354{
17355 WDI_Status wdiStatus;
17356 eHalStatus halStatus;
17357 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
17358 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17359
17360 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017361 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017362 -------------------------------------------------------------------------*/
17363 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17364 ( NULL == pEventData->pEventData))
17365 {
17366 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17367 "%s: Invalid parameters", __FUNCTION__);
17368 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017369 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017370 }
17371
17372 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
17373
17374 /*-------------------------------------------------------------------------
17375 Extract response and send it to UMAC
17376 -------------------------------------------------------------------------*/
17377 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017378 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017379
17380 /*Notify UMAC*/
17381 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
17382
Jeff Johnsone7245742012-09-05 17:12:55 -070017383 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017384}/*WDI_ProcessSetRSSIThresoldsRsp*/
17385
17386/**
17387 @brief Process host offload Rsp function (called when a
17388 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017389
17390 @param pWDICtx: pointer to the WLAN DAL context
17391 pEventData: pointer to the event information structure
17392
Jeff Johnson295189b2012-06-20 16:38:30 -070017393 @see
17394 @return Result of the function call
17395*/
17396WDI_Status
17397WDI_ProcessHostOffloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017398(
Jeff Johnson295189b2012-06-20 16:38:30 -070017399 WDI_ControlBlockType* pWDICtx,
17400 WDI_EventInfoType* pEventData
17401)
17402{
17403 WDI_Status wdiStatus;
17404 eHalStatus halStatus;
17405 WDI_HostOffloadCb wdiHostOffloadCb;
17406 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17407
17408 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017409 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017410 -------------------------------------------------------------------------*/
17411 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17412 ( NULL == pEventData->pEventData))
17413 {
17414 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17415 "%s: Invalid parameters", __FUNCTION__);
17416 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017417 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017418 }
17419
17420 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
17421
17422 /*-------------------------------------------------------------------------
17423 Extract response and send it to UMAC
17424 -------------------------------------------------------------------------*/
17425 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017426 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017427
17428 /*Notify UMAC*/
17429 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
17430
Jeff Johnsone7245742012-09-05 17:12:55 -070017431 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017432}/*WDI_ProcessHostOffloadRsp*/
17433
17434/**
17435 @brief Process keep alive Rsp function (called when a
17436 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017437
17438 @param pWDICtx: pointer to the WLAN DAL context
17439 pEventData: pointer to the event information structure
17440
Jeff Johnson295189b2012-06-20 16:38:30 -070017441 @see
17442 @return Result of the function call
17443*/
17444WDI_Status
17445WDI_ProcessKeepAliveRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017446(
Jeff Johnson295189b2012-06-20 16:38:30 -070017447 WDI_ControlBlockType* pWDICtx,
17448 WDI_EventInfoType* pEventData
17449)
17450{
17451 WDI_Status wdiStatus;
17452 eHalStatus halStatus;
17453 WDI_KeepAliveCb wdiKeepAliveCb;
17454 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17455 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17456 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
17457
17458
17459 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017460 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017461 -------------------------------------------------------------------------*/
17462 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17463 ( NULL == pEventData->pEventData))
17464 {
17465 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17466 "%s: Invalid parameters", __FUNCTION__);
17467 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017468 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017469 }
17470
Jeff Johnsone7245742012-09-05 17:12:55 -070017471 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
17472
Jeff Johnson295189b2012-06-20 16:38:30 -070017473 /*-------------------------------------------------------------------------
17474 Extract response and send it to UMAC
17475 -------------------------------------------------------------------------*/
17476 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017477 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017478
17479 /*Notify UMAC*/
17480 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
17481
Jeff Johnsone7245742012-09-05 17:12:55 -070017482 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017483}/*WDI_ProcessKeepAliveRsp*/
17484
17485/**
17486 @brief Process wowl add ptrn Rsp function (called when a
17487 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017488
17489 @param pWDICtx: pointer to the WLAN DAL context
17490 pEventData: pointer to the event information structure
17491
Jeff Johnson295189b2012-06-20 16:38:30 -070017492 @see
17493 @return Result of the function call
17494*/
17495WDI_Status
17496WDI_ProcessWowlAddBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017497(
Jeff Johnson295189b2012-06-20 16:38:30 -070017498 WDI_ControlBlockType* pWDICtx,
17499 WDI_EventInfoType* pEventData
17500)
17501{
Jeff Johnson295189b2012-06-20 16:38:30 -070017502 eHalStatus halStatus;
17503 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017504 tHalAddWowlBcastPtrnRspParams halAddWowlBcastPtrRsp;
17505 WDI_WowlAddBcPtrnRspParamsType wdiWowlAddBcPtrRsp;
17506
Jeff Johnson295189b2012-06-20 16:38:30 -070017507 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17508
17509 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017510 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017511 -------------------------------------------------------------------------*/
17512 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17513 ( NULL == pEventData->pEventData))
17514 {
17515 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17516 "%s: Invalid parameters", __FUNCTION__);
17517 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017518 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017519 }
17520
17521 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17522
17523 /*-------------------------------------------------------------------------
17524 Extract response and send it to UMAC
17525 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017526 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17527 {
17528 wpalMemoryCopy( &halAddWowlBcastPtrRsp,
17529 pEventData->pEventData,
17530 sizeof(halAddWowlBcastPtrRsp));
17531
17532 wdiWowlAddBcPtrRsp.wdiStatus =
17533 WDI_HAL_2_WDI_STATUS(halAddWowlBcastPtrRsp.status);
17534 }
17535 else
17536 {
17537 halStatus = *((eHalStatus*)pEventData->pEventData);
17538 wdiWowlAddBcPtrRsp.wdiStatus =
17539 WDI_HAL_2_WDI_STATUS(halStatus);
17540 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017541
17542 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017543 wdiWowlAddBcPtrnCb( &wdiWowlAddBcPtrRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017544
Jeff Johnsone7245742012-09-05 17:12:55 -070017545 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017546}/*WDI_ProcessWowlAddBcPtrnRsp*/
17547
17548/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017549 @brief Process wowl delete ptrn Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017550 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017551
17552 @param pWDICtx: pointer to the WLAN DAL context
17553 pEventData: pointer to the event information structure
17554
Jeff Johnson295189b2012-06-20 16:38:30 -070017555 @see
17556 @return Result of the function call
17557*/
17558WDI_Status
17559WDI_ProcessWowlDelBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017560(
Jeff Johnson295189b2012-06-20 16:38:30 -070017561 WDI_ControlBlockType* pWDICtx,
17562 WDI_EventInfoType* pEventData
17563)
17564{
Jeff Johnson295189b2012-06-20 16:38:30 -070017565 eHalStatus halStatus;
17566 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017567 tHalDelWowlBcastPtrnRspParams halDelWowlBcastPtrRsp;
17568 WDI_WowlDelBcPtrnRspParamsType wdiWowlDelBcstPtrRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070017569 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17570
17571 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017572 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017573 -------------------------------------------------------------------------*/
17574 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17575 ( NULL == pEventData->pEventData))
17576 {
17577 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17578 "%s: Invalid parameters", __FUNCTION__);
17579 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017580 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017581 }
17582
17583 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17584
17585 /*-------------------------------------------------------------------------
17586 Extract response and send it to UMAC
17587 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017588 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17589 {
17590 wpalMemoryCopy( &halDelWowlBcastPtrRsp,
17591 pEventData->pEventData,
17592 sizeof(halDelWowlBcastPtrRsp));
Jeff Johnson295189b2012-06-20 16:38:30 -070017593
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017594 wdiWowlDelBcstPtrRsp.wdiStatus =
17595 WDI_HAL_2_WDI_STATUS(halDelWowlBcastPtrRsp.status);
17596 }
17597 else
17598 {
17599 halStatus = *((eHalStatus*)pEventData->pEventData);
17600 wdiWowlDelBcstPtrRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17601 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017602 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017603 wdiWowlDelBcPtrnCb( &wdiWowlDelBcstPtrRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017604
Jeff Johnsone7245742012-09-05 17:12:55 -070017605 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017606}/*WDI_ProcessWowlDelBcPtrnRsp*/
17607
17608/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017609 @brief Process wowl enter Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017610 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017611
17612 @param pWDICtx: pointer to the WLAN DAL context
17613 pEventData: pointer to the event information structure
17614
Jeff Johnson295189b2012-06-20 16:38:30 -070017615 @see
17616 @return Result of the function call
17617*/
17618WDI_Status
17619WDI_ProcessWowlEnterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017620(
Jeff Johnson295189b2012-06-20 16:38:30 -070017621 WDI_ControlBlockType* pWDICtx,
17622 WDI_EventInfoType* pEventData
17623)
17624{
Jeff Johnson295189b2012-06-20 16:38:30 -070017625 eHalStatus halStatus;
17626 WDI_WowlEnterReqCb wdiWowlEnterCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017627 WDI_WowlEnterRspParamsType wdiwowlEnterRsp;
17628 tHalEnterWowlRspParams halEnterWowlRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070017629 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17630
17631 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017632 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017633 -------------------------------------------------------------------------*/
17634 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17635 ( NULL == pEventData->pEventData))
17636 {
17637 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17638 "%s: Invalid parameters", __FUNCTION__);
17639 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017640 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017641 }
17642
17643 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17644
17645 /*-------------------------------------------------------------------------
17646 Extract response and send it to UMAC
17647 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017648 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17649 {
17650 wpalMemoryCopy( &halEnterWowlRspParams,
17651 (wpt_uint8*)pEventData->pEventData,
17652 sizeof(halEnterWowlRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070017653
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017654 wdiwowlEnterRsp.bssIdx = halEnterWowlRspParams.bssIdx;
17655 wdiwowlEnterRsp.status =
17656 WDI_HAL_2_WDI_STATUS(halEnterWowlRspParams.status);
17657 }
17658 else
17659 {
17660 halStatus = *((eHalStatus*)pEventData->pEventData);
17661 wdiwowlEnterRsp.status = WDI_HAL_2_WDI_STATUS(halStatus);
17662 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017663 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017664 wdiWowlEnterCb( &wdiwowlEnterRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017665
Jeff Johnsone7245742012-09-05 17:12:55 -070017666 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017667}/*WDI_ProcessWowlEnterRsp*/
17668
17669/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017670 @brief Process wowl exit Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017671 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017672
17673 @param pWDICtx: pointer to the WLAN DAL context
17674 pEventData: pointer to the event information structure
17675
Jeff Johnson295189b2012-06-20 16:38:30 -070017676 @see
17677 @return Result of the function call
17678*/
17679WDI_Status
17680WDI_ProcessWowlExitRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017681(
Jeff Johnson295189b2012-06-20 16:38:30 -070017682 WDI_ControlBlockType* pWDICtx,
17683 WDI_EventInfoType* pEventData
17684)
17685{
Jeff Johnson295189b2012-06-20 16:38:30 -070017686 eHalStatus halStatus;
17687 WDI_WowlExitReqCb wdiWowlExitCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017688 tHalExitWowlRspParams halExitWowlRspParams;
17689 WDI_WowlExitRspParamsType wdiWowlExitRsp;
17690
Jeff Johnson295189b2012-06-20 16:38:30 -070017691 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17692
17693 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017694 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017695 -------------------------------------------------------------------------*/
17696 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17697 ( NULL == pEventData->pEventData))
17698 {
17699 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17700 "%s: Invalid parameters", __FUNCTION__);
17701 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017702 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017703 }
17704
17705 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17706
17707 /*-------------------------------------------------------------------------
17708 Extract response and send it to UMAC
17709 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017710 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17711 {
17712 wpalMemoryCopy( &halExitWowlRspParams,
17713 pEventData->pEventData,
17714 sizeof(halExitWowlRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070017715
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017716 wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halExitWowlRspParams.status);
17717 wdiWowlExitRsp.bssIdx = halExitWowlRspParams.bssIdx;
17718
17719 }
17720 else
17721 {
17722 halStatus = *((eHalStatus*)pEventData->pEventData);
17723 wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halStatus);
17724 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017725 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017726 wdiWowlExitCb( &wdiWowlExitRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017727
Jeff Johnsone7245742012-09-05 17:12:55 -070017728 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017729}/*WDI_ProcessWowlExitRsp*/
17730
17731/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017732 @brief Process Configure Apps CPU wakeup State Rsp function
Jeff Johnson295189b2012-06-20 16:38:30 -070017733 (called when a response is being received over the bus
17734 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017735
17736 @param pWDICtx: pointer to the WLAN DAL context
17737 pEventData: pointer to the event information structure
17738
Jeff Johnson295189b2012-06-20 16:38:30 -070017739 @see
17740 @return Result of the function call
17741*/
17742WDI_Status
17743WDI_ProcessConfigureAppsCpuWakeupStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017744(
Jeff Johnson295189b2012-06-20 16:38:30 -070017745 WDI_ControlBlockType* pWDICtx,
17746 WDI_EventInfoType* pEventData
17747)
17748{
17749 WDI_Status wdiStatus;
17750 eHalStatus halStatus;
17751 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17752 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17753
17754 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017755 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017756 -------------------------------------------------------------------------*/
17757 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17758 ( NULL == pEventData->pEventData))
17759 {
17760 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17761 "%s: Invalid parameters", __FUNCTION__);
17762 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017763 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017764 }
17765
17766 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17767
17768 /*-------------------------------------------------------------------------
17769 Extract response and send it to UMAC
17770 -------------------------------------------------------------------------*/
17771 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017772 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017773
17774 /*Notify UMAC*/
17775 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17776
Jeff Johnsone7245742012-09-05 17:12:55 -070017777 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017778}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17779
17780
17781/**
17782 @brief Process Nv download(called when a response
17783 is being received over the bus from HAL,will check if the responce is )
Jeff Johnsone7245742012-09-05 17:12:55 -070017784
17785 @param pWDICtx: pointer to the WLAN DAL context
17786 pEventData: pointer to the event information structure
17787
Jeff Johnson295189b2012-06-20 16:38:30 -070017788 @see
17789 @return Result of the function call
17790*/
17791WDI_Status
17792WDI_ProcessNvDownloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017793(
Jeff Johnson295189b2012-06-20 16:38:30 -070017794 WDI_ControlBlockType* pWDICtx,
17795 WDI_EventInfoType* pEventData
17796)
17797{
17798
17799 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17800 tHalNvImgDownloadRspParams halNvDownloadRsp;
17801 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17802
17803 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017804 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017805 -------------------------------------------------------------------------*/
17806 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17807 ( NULL == pEventData->pEventData))
17808 {
17809 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17810 "%s: Invalid parameters", __FUNCTION__);
17811 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017812 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017813 }
17814
17815 /*-------------------------------------------------------------------------
17816 Extract response and send it to UMAC
17817 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017818 wpalMemoryCopy( &halNvDownloadRsp,
17819 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017820 sizeof(halNvDownloadRsp));
17821
17822 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17823
17824 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
Jeff Johnsone7245742012-09-05 17:12:55 -070017825 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17826 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
Jeff Johnson295189b2012-06-20 16:38:30 -070017827 {
17828 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
Jeff Johnsone7245742012-09-05 17:12:55 -070017829 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017830 }
17831 else
17832 {
17833 /*Reset the Nv related global information in WDI context information */
17834 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17835 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17836 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17837 /*call WDA callback function for last fragment */
17838 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17839 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17840 }
17841
Jeff Johnsone7245742012-09-05 17:12:55 -070017842 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017843}
17844#ifdef WLAN_FEATURE_VOWIFI_11R
17845/**
17846 @brief Process Add TSpec Rsp function (called when a response
17847 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017848
17849 @param pWDICtx: pointer to the WLAN DAL context
17850 pEventData: pointer to the event information structure
17851
Jeff Johnson295189b2012-06-20 16:38:30 -070017852 @see
17853 @return Result of the function call
17854*/
17855WDI_Status
17856WDI_ProcessAggrAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017857(
Jeff Johnson295189b2012-06-20 16:38:30 -070017858 WDI_ControlBlockType* pWDICtx,
17859 WDI_EventInfoType* pEventData
17860)
17861{
17862 WDI_Status wdiStatus;
17863 tAggrAddTsRspParams aggrAddTsRsp;
17864 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17865 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17866
17867 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017868 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017869 -------------------------------------------------------------------------*/
17870 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17871 ( NULL == pEventData->pEventData))
17872 {
17873 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17874 "%s: Invalid parameters", __FUNCTION__);
17875 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017876 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017877 }
17878
17879 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17880
17881 /*-------------------------------------------------------------------------
17882 Extract response and send it to UMAC
17883 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017884 wpalMemoryCopy( &aggrAddTsRsp,
17885 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017886 sizeof(aggrAddTsRsp));
17887
17888 /* What is the difference between status0 and status1? */
Jeff Johnsone7245742012-09-05 17:12:55 -070017889 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
Jeff Johnson295189b2012-06-20 16:38:30 -070017890
17891 /*Notify UMAC*/
17892 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17893
Jeff Johnsone7245742012-09-05 17:12:55 -070017894 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017895}/*WDI_ProcessAddTSpecRsp*/
17896#endif /* WLAN_FEATURE_VOWIFI_11R */
17897
17898/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017899 @brief WDI_ProcessHostResumeRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017900 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017901
17902 @param pWDICtx: pointer to the WLAN DAL context
17903 pEventData: pointer to the event information structure
17904
Jeff Johnson295189b2012-06-20 16:38:30 -070017905 @see
17906 @return Result of the function call
17907*/
17908WDI_Status
17909WDI_ProcessHostResumeRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017910(
Jeff Johnson295189b2012-06-20 16:38:30 -070017911 WDI_ControlBlockType* pWDICtx,
17912 WDI_EventInfoType* pEventData
17913)
17914{
17915 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17916 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17917 tHalHostResumeRspParams hostResumeRspMsg;
17918 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17919
17920 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017921 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017922 -------------------------------------------------------------------------*/
17923 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17924 ( NULL == pEventData->pEventData))
17925 {
17926 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17927 "%s: Invalid parameters", __FUNCTION__);
17928 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017929 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017930 }
17931
17932 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17933
17934 /*-------------------------------------------------------------------------
17935 Extract response and send it to UMAC
17936 -------------------------------------------------------------------------*/
17937
Jeff Johnsone7245742012-09-05 17:12:55 -070017938 wpalMemoryCopy( &hostResumeRspMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -070017939 (wpt_uint8*)pEventData->pEventData,
17940 sizeof(hostResumeRspMsg));
17941
Jeff Johnsone7245742012-09-05 17:12:55 -070017942 wdiResumeRspParams.wdiStatus =
17943 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070017944
17945 /*Notify UMAC*/
17946 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17947
17948 return WDI_STATUS_SUCCESS;
17949}
17950
17951/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017952 @brief Process Set Tx PER Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017953 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017954
17955 @param pWDICtx: pointer to the WLAN DAL context
17956 pEventData: pointer to the event information structure
17957
Jeff Johnson295189b2012-06-20 16:38:30 -070017958 @see
17959 @return Result of the function call
17960*/
17961WDI_Status
17962WDI_ProcessSetTxPerTrackingRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017963(
Jeff Johnson295189b2012-06-20 16:38:30 -070017964 WDI_ControlBlockType* pWDICtx,
17965 WDI_EventInfoType* pEventData
17966)
17967{
17968 WDI_Status wdiStatus;
17969 eHalStatus halStatus;
17970 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17971 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17972
17973 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017974 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017975 -------------------------------------------------------------------------*/
17976 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17977 ( NULL == pEventData->pEventData))
17978 {
17979 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17980 "%s: Invalid parameters", __FUNCTION__);
17981 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017982 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017983 }
Jeff Johnsone7245742012-09-05 17:12:55 -070017984
17985 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070017986
17987 /*-------------------------------------------------------------------------
17988 Extract response and send it to UMAC
17989 -------------------------------------------------------------------------*/
17990 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017991 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017992
17993 /*Notify UMAC*/
17994 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17995
Jeff Johnsone7245742012-09-05 17:12:55 -070017996 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017997}/*WDI_ProcessSetTxPerTrackingRsp*/
17998
17999/*==========================================================================
18000 Indications from HAL
18001 ==========================================================================*/
18002/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018003 @brief Process Low RSSI Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070018004 indication of this kind is being received over the bus
18005 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018006
18007 @param pWDICtx: pointer to the WLAN DAL context
18008 pEventData: pointer to the event information structure
18009
Jeff Johnson295189b2012-06-20 16:38:30 -070018010 @see
18011 @return Result of the function call
18012*/
18013WDI_Status
18014WDI_ProcessLowRSSIInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018015(
Jeff Johnson295189b2012-06-20 16:38:30 -070018016 WDI_ControlBlockType* pWDICtx,
18017 WDI_EventInfoType* pEventData
18018)
18019{
18020 WDI_LowLevelIndType wdiInd;
18021 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
18022 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18023
18024 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018025 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018026 -------------------------------------------------------------------------*/
18027 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18028 ( NULL == pEventData->pEventData))
18029 {
18030 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18031 "%s: Invalid parameters", __FUNCTION__);
18032 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018033 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018034 }
18035
18036 /*-------------------------------------------------------------------------
18037 Extract indication and send it to UMAC
18038 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018039 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
18040 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018041 sizeof(tHalRSSINotification));
18042
18043 /*Fill in the indication parameters*/
18044 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
18045 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
18046 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
18047 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
18048 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
18049 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
18050 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
18051 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
18052 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
18053 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
18054 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
18055 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
18056 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
18057
18058 /*Notify UMAC*/
18059 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018060
18061 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018062}/*WDI_ProcessLowRSSIInd*/
18063
18064
18065/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018066 @brief Process Missed Beacon Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018067 an indication of this kind is being received over the
18068 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018069
18070 @param pWDICtx: pointer to the WLAN DAL context
18071 pEventData: pointer to the event information structure
18072
Jeff Johnson295189b2012-06-20 16:38:30 -070018073 @see
18074 @return Result of the function call
18075*/
18076WDI_Status
18077WDI_ProcessMissedBeaconInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018078(
Jeff Johnson295189b2012-06-20 16:38:30 -070018079 WDI_ControlBlockType* pWDICtx,
18080 WDI_EventInfoType* pEventData
18081)
18082{
18083 WDI_Status wdiStatus;
18084 eHalStatus halStatus;
18085 WDI_LowLevelIndType wdiInd;
18086 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18087
18088 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018089 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018090 -------------------------------------------------------------------------*/
18091 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18092 ( NULL == pEventData->pEventData))
18093 {
18094 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18095 "%s: Invalid parameters", __FUNCTION__);
18096 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018097 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018098 }
18099
18100 /*-------------------------------------------------------------------------
18101 Extract indication and send it to UMAC
18102 -------------------------------------------------------------------------*/
18103 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18104 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018105 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018106
18107 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018108 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
18109
Jeff Johnson295189b2012-06-20 16:38:30 -070018110 /*Notify UMAC*/
18111 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018112
18113 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018114}/*WDI_ProcessMissedBeaconInd*/
18115
18116
18117/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018118 @brief Process Unk Addr Frame Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018119 an indication of this kind is being received over the
18120 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018121
18122 @param pWDICtx: pointer to the WLAN DAL context
18123 pEventData: pointer to the event information structure
18124
Jeff Johnson295189b2012-06-20 16:38:30 -070018125 @see
18126 @return Result of the function call
18127*/
18128WDI_Status
18129WDI_ProcessUnkAddrFrameInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018130(
Jeff Johnson295189b2012-06-20 16:38:30 -070018131 WDI_ControlBlockType* pWDICtx,
18132 WDI_EventInfoType* pEventData
18133)
18134{
18135 WDI_Status wdiStatus;
18136 eHalStatus halStatus;
18137 WDI_LowLevelIndType wdiInd;
18138 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18139
18140 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018141 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018142 -------------------------------------------------------------------------*/
18143 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18144 ( NULL == pEventData->pEventData))
18145 {
18146 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18147 "%s: Invalid parameters", __FUNCTION__);
18148 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018149 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018150 }
18151
18152 /*-------------------------------------------------------------------------
18153 Extract indication and send it to UMAC
18154 -------------------------------------------------------------------------*/
18155 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18156 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018157 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018158
18159 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018160 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018161 /* ! TO DO - fill in from HAL struct:
18162 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
18163
18164 /*Notify UMAC*/
18165 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018166
18167 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018168}/*WDI_ProcessUnkAddrFrameInd*/
18169
18170
18171/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018172 @brief Process MIC Failure Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070018173 indication of this kind is being received over the bus
18174 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018175
18176 @param pWDICtx: pointer to the WLAN DAL context
18177 pEventData: pointer to the event information structure
18178
Jeff Johnson295189b2012-06-20 16:38:30 -070018179 @see
18180 @return Result of the function call
18181*/
18182WDI_Status
18183WDI_ProcessMicFailureInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018184(
Jeff Johnson295189b2012-06-20 16:38:30 -070018185 WDI_ControlBlockType* pWDICtx,
18186 WDI_EventInfoType* pEventData
18187)
18188{
18189 WDI_LowLevelIndType wdiInd;
18190 tpSirMicFailureInd pHalMicFailureInd;
18191
18192 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18193
18194 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018195 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018196 -------------------------------------------------------------------------*/
18197 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18198 ( NULL == pEventData->pEventData))
18199 {
18200 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18201 "%s: Invalid parameters", __FUNCTION__);
18202 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018203 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018204 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018205
Jeff Johnson295189b2012-06-20 16:38:30 -070018206 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
18207 /*-------------------------------------------------------------------------
18208 Extract indication and send it to UMAC
18209 -------------------------------------------------------------------------*/
18210
18211 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018212 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018213 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
18214 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
18215 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
18216 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
18217 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
18218 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
18219 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
18220 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070018221 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
Jeff Johnson295189b2012-06-20 16:38:30 -070018222 pHalMicFailureInd->info.multicast;
Jeff Johnsone7245742012-09-05 17:12:55 -070018223 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018224 pHalMicFailureInd->info.IV1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018225 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
Jeff Johnson295189b2012-06-20 16:38:30 -070018226 pHalMicFailureInd->info.keyId;
18227 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
18228 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
18229 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
18230 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
18231 /*Notify UMAC*/
18232 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018233
18234 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018235}/*WDI_ProcessMicFailureInd*/
18236
18237
18238/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018239 @brief Process Fatal Failure Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018240 an indication of this kind is being received over the
18241 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018242
18243 @param pWDICtx: pointer to the WLAN DAL context
18244 pEventData: pointer to the event information structure
18245
Jeff Johnson295189b2012-06-20 16:38:30 -070018246 @see
18247 @return Result of the function call
18248*/
18249WDI_Status
18250WDI_ProcessFatalErrorInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018251(
Jeff Johnson295189b2012-06-20 16:38:30 -070018252 WDI_ControlBlockType* pWDICtx,
18253 WDI_EventInfoType* pEventData
18254)
18255{
18256 WDI_Status wdiStatus;
18257 eHalStatus halStatus;
18258 WDI_LowLevelIndType wdiInd;
18259 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18260
18261 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018262 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018263 -------------------------------------------------------------------------*/
18264 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18265 ( NULL == pEventData->pEventData))
18266 {
18267 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18268 "%s: Invalid parameters", __FUNCTION__);
18269 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018270 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018271 }
18272
18273 /*-------------------------------------------------------------------------
18274 Extract indication and send it to UMAC
18275 -------------------------------------------------------------------------*/
18276
18277 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18278 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018279 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018280
18281 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18282 "Fatal failure received from device %d ", halStatus );
Jeff Johnsone7245742012-09-05 17:12:55 -070018283
Jeff Johnson295189b2012-06-20 16:38:30 -070018284 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018285 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18286 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018287
18288 /*Notify UMAC*/
18289 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018290
18291 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018292}/*WDI_ProcessFatalErrorInd*/
18293
18294/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018295 @brief Process Delete STA Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018296 an indication of this kind is being received over the
18297 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018298
18299 @param pWDICtx: pointer to the WLAN DAL context
18300 pEventData: pointer to the event information structure
18301
Jeff Johnson295189b2012-06-20 16:38:30 -070018302 @see
18303 @return Result of the function call
18304*/
18305WDI_Status
18306WDI_ProcessDelSTAInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018307(
Jeff Johnson295189b2012-06-20 16:38:30 -070018308 WDI_ControlBlockType* pWDICtx,
18309 WDI_EventInfoType* pEventData
18310)
18311{
18312 tDeleteStaContextParams halDelSTACtx;
18313 WDI_LowLevelIndType wdiInd;
18314 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18315
18316 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018317 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018318 -------------------------------------------------------------------------*/
18319 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18320 ( NULL == pEventData->pEventData))
18321 {
18322 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18323 "%s: Invalid parameters", __FUNCTION__);
18324 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018325 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018326 }
18327
18328 /*-------------------------------------------------------------------------
18329 Extract indication and send it to UMAC
18330 -------------------------------------------------------------------------*/
18331
18332 /* Parameters need to be unpacked according to HAL struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018333 wpalMemoryCopy( &halDelSTACtx,
18334 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018335 sizeof(halDelSTACtx));
18336
18337 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018338 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018339
18340 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
18341 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
18342 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
18343 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
18344
Jeff Johnsone7245742012-09-05 17:12:55 -070018345 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
Jeff Johnson295189b2012-06-20 16:38:30 -070018346 halDelSTACtx.assocId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018347 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070018348 halDelSTACtx.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018349 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
18350 halDelSTACtx.reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070018351
18352 /*Notify UMAC*/
18353 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018354
18355 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018356}/*WDI_ProcessDelSTAInd*/
18357
18358/**
18359*@brief Process Coex Indication function (called when
18360 an indication of this kind is being received over the
18361 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018362
18363 @param pWDICtx: pointer to the WLAN DAL context
18364 pEventData: pointer to the event information structure
18365
Jeff Johnson295189b2012-06-20 16:38:30 -070018366 @see
18367 @return Result of the function call
18368*/
18369WDI_Status
18370WDI_ProcessCoexInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018371(
Jeff Johnson295189b2012-06-20 16:38:30 -070018372 WDI_ControlBlockType* pWDICtx,
18373 WDI_EventInfoType* pEventData
18374)
18375{
18376 WDI_LowLevelIndType wdiInd;
18377 tCoexIndMsg halCoexIndMsg;
18378 wpt_uint32 index;
18379 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18380
18381 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018382 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018383 -------------------------------------------------------------------------*/
18384 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18385 ( NULL == pEventData->pEventData ))
18386 {
18387 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18388 "%s: Invalid parameters", __FUNCTION__);
18389 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070018390 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018391 }
18392
18393 /*-------------------------------------------------------------------------
18394 Extract indication and send it to UMAC
18395 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018396 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
18397 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018398 sizeof(halCoexIndMsg.coexIndParams) );
18399
18400 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018401 wdiInd.wdiIndicationType = WDI_COEX_IND;
18402 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
Jeff Johnson295189b2012-06-20 16:38:30 -070018403 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
18404 {
Jeff Johnsone7245742012-09-05 17:12:55 -070018405 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
Jeff Johnson295189b2012-06-20 16:38:30 -070018406 }
18407
18408 // DEBUG
18409 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18410 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
Jeff Johnsone7245742012-09-05 17:12:55 -070018411 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
18412 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
18413 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
18414 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
18415 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -070018416
18417 /*Notify UMAC*/
18418 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018419
18420 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018421}/*WDI_ProcessCoexInd*/
18422
18423/**
18424*@brief Process Tx Complete Indication function (called when
18425 an indication of this kind is being received over the
18426 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018427
18428 @param pWDICtx: pointer to the WLAN DAL context
18429 pEventData: pointer to the event information structure
18430
Jeff Johnson295189b2012-06-20 16:38:30 -070018431 @see
18432 @return Result of the function call
18433*/
18434WDI_Status
18435WDI_ProcessTxCompleteInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018436(
Jeff Johnson295189b2012-06-20 16:38:30 -070018437 WDI_ControlBlockType* pWDICtx,
18438 WDI_EventInfoType* pEventData
18439)
18440{
18441 WDI_LowLevelIndType wdiInd;
18442 tTxComplIndMsg halTxComplIndMsg;
18443 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18444
18445 /*-------------------------------------------------------------------------
18446 Sanity check
18447 -------------------------------------------------------------------------*/
18448 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18449 ( NULL == pEventData->pEventData ))
18450 {
18451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18452 "%s: Invalid parameters", __FUNCTION__);
18453 WDI_ASSERT( 0 );
18454 return WDI_STATUS_E_FAILURE;
18455 }
18456
18457 /*-------------------------------------------------------------------------
18458 Extract indication and send it to UMAC
18459 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018460 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
18461 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018462 sizeof(halTxComplIndMsg.txComplParams) );
18463
18464 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018465 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
18466 wdiInd.wdiIndicationData.tx_complete_status
18467 = halTxComplIndMsg.txComplParams.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070018468
18469 /*Notify UMAC*/
18470 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018471
18472 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018473}/*WDI_ProcessTxCompleteInd*/
18474
18475#ifdef WLAN_FEATURE_P2P
18476/**
18477*@brief Process Noa Attr Indication function (called when
18478 an indication of this kind is being received over the
18479 bus from HAL)
18480
18481 @param pWDICtx: pointer to the WLAN DAL context
18482 pEventData: pointer to the event information structure
18483
18484 @see
18485 @return Result of the function call
18486*/
18487WDI_Status
18488WDI_ProcessP2pNoaAttrInd
18489(
18490 WDI_ControlBlockType* pWDICtx,
18491 WDI_EventInfoType* pEventData
18492)
18493{
18494 WDI_LowLevelIndType wdiInd;
18495 tNoaAttrIndMsg halNoaAttrIndMsg;
18496 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18497
18498 /*-------------------------------------------------------------------------
18499 Sanity check
18500 -------------------------------------------------------------------------*/
18501 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18502 ( NULL == pEventData->pEventData ))
18503 {
18504 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18505 "%s: Invalid parameters", __FUNCTION__);
18506 WDI_ASSERT( 0 );
18507 return WDI_STATUS_E_FAILURE;
18508 }
18509
18510 /*-------------------------------------------------------------------------
18511 Extract indication and send it to UMAC
18512 -------------------------------------------------------------------------*/
18513 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
18514 pEventData->pEventData,
18515 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
18516
18517 /*Fill in the indication parameters*/
18518 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -070018519
Jeff Johnson295189b2012-06-20 16:38:30 -070018520 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
18521 = halNoaAttrIndMsg.noaAttrIndParams.status;
Jeff Johnsone7245742012-09-05 17:12:55 -070018522
Jeff Johnson295189b2012-06-20 16:38:30 -070018523 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
18524 = halNoaAttrIndMsg.noaAttrIndParams.index;
18525 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
18526 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
18527 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
18528 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
Jeff Johnsone7245742012-09-05 17:12:55 -070018529
Jeff Johnson295189b2012-06-20 16:38:30 -070018530 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
18531 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
18532 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
18533 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
18534 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
18535 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
18536 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
18537 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070018538
Jeff Johnson295189b2012-06-20 16:38:30 -070018539 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
18540 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
18541 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
18542 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
18543 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
18544 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
18545 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
18546 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
18547
18548 /*Notify UMAC*/
18549 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18550
18551 return WDI_STATUS_SUCCESS;
18552}/*WDI_ProcessNoaAttrInd*/
18553#endif
18554
18555/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018556 @brief Process Tx PER Hit Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018557 an indication of this kind is being received over the
18558 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018559
18560 @param pWDICtx: pointer to the WLAN DAL context
18561 pEventData: pointer to the event information structure
18562
Jeff Johnson295189b2012-06-20 16:38:30 -070018563 @see
18564 @return Result of the function call
18565*/
18566WDI_Status
18567WDI_ProcessTxPerHitInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018568(
Jeff Johnson295189b2012-06-20 16:38:30 -070018569 WDI_ControlBlockType* pWDICtx,
18570 WDI_EventInfoType* pEventData
18571)
18572{
18573 WDI_LowLevelIndType wdiInd;
18574 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070018575
Jeff Johnson295189b2012-06-20 16:38:30 -070018576 /*-------------------------------------------------------------------------
18577 Extract indication and send it to UMAC
18578 -------------------------------------------------------------------------*/
18579 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018580 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18581
Jeff Johnson295189b2012-06-20 16:38:30 -070018582 /*Notify UMAC*/
18583 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18584
Jeff Johnsone7245742012-09-05 17:12:55 -070018585 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018586}/*WDI_ProcessTxPerHitInd*/
18587
18588#ifdef ANI_MANF_DIAG
18589/**
18590 @brief WDI_ProcessFTMCommandReq
18591 Process FTM Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018592
18593 @param pWDICtx: pointer to the WLAN DAL context
18594 pEventData: pointer to the event information structure
18595
Jeff Johnson295189b2012-06-20 16:38:30 -070018596 @see
18597 @return Result of the function call
18598*/
18599WDI_Status
18600WDI_ProcessFTMCommandReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018601(
Jeff Johnson295189b2012-06-20 16:38:30 -070018602 WDI_ControlBlockType* pWDICtx,
18603 WDI_EventInfoType* pEventData
18604)
18605{
18606 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18607 wpt_uint8 *ftmCommandBuffer = NULL;
18608 wpt_uint16 dataOffset;
18609 wpt_uint16 bufferSize;
18610 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018611 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018612 -------------------------------------------------------------------------*/
18613 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18614 ( NULL == pEventData->pEventData))
18615
18616 {
18617 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18618 "%s: Invalid parameters", __FUNCTION__);
18619 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018620 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018621 }
18622
18623 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18624
18625 /* Get MSG Buffer */
18626 WDI_GetMessageBuffer(pWDICtx,
18627 WDI_FTM_CMD_REQ,
18628 ftmCommandReq->bodyLength,
18629 &ftmCommandBuffer,
18630 &dataOffset,
18631 &bufferSize);
18632
18633 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18634 ftmCommandReq->FTMCommandBody,
18635 ftmCommandReq->bodyLength);
18636
18637 /* Send MSG */
18638 return WDI_SendMsg(pWDICtx,
18639 ftmCommandBuffer,
18640 bufferSize,
18641 pEventData->pCBfnc,
18642 pEventData->pUserData,
18643 WDI_FTM_CMD_RESP);
18644}
18645
18646/**
18647 @brief WDI_ProcessFTMCommandRsp
18648 Process FTM Command Response from HAL, simply route to HDD FTM
Jeff Johnsone7245742012-09-05 17:12:55 -070018649
18650 @param pWDICtx: pointer to the WLAN DAL context
18651 pEventData: pointer to the event information structure
18652
Jeff Johnson295189b2012-06-20 16:38:30 -070018653 @see
18654 @return Result of the function call
18655*/
18656WDI_Status
18657WDI_ProcessFTMCommandRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018658(
Jeff Johnson295189b2012-06-20 16:38:30 -070018659 WDI_ControlBlockType* pWDICtx,
18660 WDI_EventInfoType* pEventData
18661)
18662{
18663 WDI_FTMCommandRspCb ftmCMDRspCb;
18664 tProcessPttRspParams *ftmCMDRspData = NULL;
18665 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18666
18667 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018668 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018669 -------------------------------------------------------------------------*/
18670 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18671 ( NULL == pEventData->pEventData))
18672 {
18673 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18674 "%s: Invalid parameters", __FUNCTION__);
18675 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018676 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018677 }
18678
18679 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18680
18681 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18682
Jeff Johnsone7245742012-09-05 17:12:55 -070018683 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18684 (void *)&ftmCMDRspData->pttMsgBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018685 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18686
18687 /*Notify UMAC*/
18688 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18689
Jeff Johnsone7245742012-09-05 17:12:55 -070018690 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018691}
18692#endif /* ANI_MANF_DIAG */
18693/**
18694 @brief WDI_ProcessHalDumpCmdReq
18695 Process hal dump Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018696
18697 @param pWDICtx: pointer to the WLAN DAL context
18698 pEventData: pointer to the event information structure
18699
Jeff Johnson295189b2012-06-20 16:38:30 -070018700 @see
18701 @return Result of the function call
18702*/
18703WDI_Status
18704WDI_ProcessHALDumpCmdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018705(
Jeff Johnson295189b2012-06-20 16:38:30 -070018706 WDI_ControlBlockType* pWDICtx,
18707 WDI_EventInfoType* pEventData
18708)
18709{
18710 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18711 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18712 wpt_uint16 usDataOffset = 0;
18713 wpt_uint16 usSendSize = 0;
18714 tHalDumpCmdReqMsg halDumpCmdReqMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070018715 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070018716
18717 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018718 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018719 -------------------------------------------------------------------------*/
18720 if (( NULL == pEventData ) ||
18721 ( NULL == pEventData->pEventData) ||
18722 ( NULL == pEventData->pCBfnc ))
18723 {
18724 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18725 "%s: Invalid parameters", __FUNCTION__);
18726 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018727 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018728 }
18729
18730 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18731 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18732
18733 /* Copying the HAL DUMP Command Information HAL Structure*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018734 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018735 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
Jeff Johnsone7245742012-09-05 17:12:55 -070018736 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018737 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018738 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018739 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
Jeff Johnsone7245742012-09-05 17:12:55 -070018740 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018741 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
Jeff Johnsone7245742012-09-05 17:12:55 -070018742 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018743 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
Jeff Johnsone7245742012-09-05 17:12:55 -070018744
Jeff Johnson295189b2012-06-20 16:38:30 -070018745 /*-----------------------------------------------------------------------
18746 Get message buffer
18747 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018748 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070018749 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18750 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070018751 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070018752 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18753 {
18754 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18755 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18756 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18757 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018758 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018759 }
18760
Jeff Johnsone7245742012-09-05 17:12:55 -070018761 wpalMemoryCopy( pSendBuffer+usDataOffset,
18762 &halDumpCmdReqMsg.dumpCmdReqParams,
18763 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070018764
18765 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070018766 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018767
18768 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018769 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018770 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018771 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18772 wdiHALDumpCmdRspCb, pEventData->pUserData,
18773 WDI_HAL_DUMP_CMD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070018774}
18775
18776/**
18777 @brief WDI_ProcessHalDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018778 Process hal Dump Command Response from HAL, simply route to HDD
18779
18780 @param pWDICtx: pointer to the WLAN DAL context
18781 pEventData: pointer to the event information structure
18782
Jeff Johnson295189b2012-06-20 16:38:30 -070018783 @see
18784 @return Result of the function call
18785*/
18786WDI_Status
18787WDI_ProcessHALDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018788(
Jeff Johnson295189b2012-06-20 16:38:30 -070018789 WDI_ControlBlockType* pWDICtx,
18790 WDI_EventInfoType* pEventData
18791)
18792{
18793 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18794 tpHalDumpCmdRspParams halDumpCmdRspParams;
18795 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18796
18797 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018798 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018799 -------------------------------------------------------------------------*/
18800 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18801 ( NULL == pEventData->pEventData))
18802 {
18803 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18804 "%s: Invalid parameters", __FUNCTION__);
18805 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018806 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018807 }
18808
Jeff Johnsone7245742012-09-05 17:12:55 -070018809 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070018810
18811 /*Initialize the WDI Response structure */
18812 wdiHALDumpCmdRsp.usBufferLen = 0;
18813 wdiHALDumpCmdRsp.pBuffer = NULL;
18814
18815 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018816
18817 wdiHALDumpCmdRsp.wdiStatus =
18818 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
Jeff Johnson295189b2012-06-20 16:38:30 -070018819
18820 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18821 (halDumpCmdRspParams->rspLength != 0))
18822 {
18823 /* Copy the response data */
18824 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18825 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
Jeff Johnsone7245742012-09-05 17:12:55 -070018826 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18827 wdiHALDumpCmdRsp.pBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018828 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18829 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018830
Jeff Johnson295189b2012-06-20 16:38:30 -070018831 /*Notify UMAC*/
18832 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18833
18834 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18835 {
18836 /* Free the allocated buffer */
18837 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18838 }
18839 return WDI_STATUS_SUCCESS;
18840}
18841
18842/*==========================================================================
18843 CONTRL TRANSPORT INTERACTION
Jeff Johnsone7245742012-09-05 17:12:55 -070018844
Jeff Johnson295189b2012-06-20 16:38:30 -070018845 Callback function registered with the control transport - for receiving
Jeff Johnsone7245742012-09-05 17:12:55 -070018846 notifications and packets
Jeff Johnson295189b2012-06-20 16:38:30 -070018847==========================================================================*/
18848/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018849 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018850 when it wishes to send up a notification like the ones
18851 mentioned above.
Jeff Johnsone7245742012-09-05 17:12:55 -070018852
Jeff Johnson295189b2012-06-20 16:38:30 -070018853 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018854
18855 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018856 wctsEvent: the event being notified
Jeff Johnsone7245742012-09-05 17:12:55 -070018857 wctsNotifyCBData: the callback data of the user
18858
Jeff Johnson295189b2012-06-20 16:38:30 -070018859 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018860
18861 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018862*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018863void
Jeff Johnson295189b2012-06-20 16:38:30 -070018864WDI_NotifyMsgCTSCB
18865(
Jeff Johnsone7245742012-09-05 17:12:55 -070018866 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018867 WCTS_NotifyEventType wctsEvent,
18868 void* wctsNotifyCBData
18869)
18870{
Jeff Johnsone7245742012-09-05 17:12:55 -070018871 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018872 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18873
18874 if (NULL == pWDICtx )
18875 {
18876 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18877 "%s: Invalid parameters", __FUNCTION__);
18878 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018879 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018880 }
18881
18882 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18883 {
18884 /* callback presumably occurred after close */
18885 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18886 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018887 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018888 }
18889
18890 if ( WCTS_EVENT_OPEN == wctsEvent )
18891 {
18892 /*Flag must be set atomically as it is checked from incoming request
18893 functions*/
18894 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018895 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018896
18897 /*Nothing to do - so try to dequeue any pending request that may have
18898 occurred while we were trying to establish this*/
18899 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070018900 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnson295189b2012-06-20 16:38:30 -070018901 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018902 else if ( WCTS_EVENT_CLOSE == wctsEvent )
Jeff Johnson295189b2012-06-20 16:38:30 -070018903 {
18904 /*Flag must be set atomically as it is checked from incoming request
18905 functions*/
18906 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018907 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018908
18909 /*No other request will be processed from now on - fail all*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018910 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070018911 wpalMutexRelease(&pWDICtx->wptMutex);
18912
18913 /*Notify that the Control Channel is closed */
18914 wpalEventSet(&pWDICtx->wctsActionEvent);
18915 }
18916
18917}/*WDI_NotifyMsgCTSCB*/
18918
18919
18920/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018921 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018922 when it wishes to send up a packet received over the
18923 bus.
Jeff Johnsone7245742012-09-05 17:12:55 -070018924
Jeff Johnson295189b2012-06-20 16:38:30 -070018925 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018926
18927 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018928 pMsg: the packet
18929 uLen: the packet length
Jeff Johnsone7245742012-09-05 17:12:55 -070018930 wctsRxMsgCBData: the callback data of the user
18931
Jeff Johnson295189b2012-06-20 16:38:30 -070018932 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018933
18934 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018935*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018936void
18937WDI_RXMsgCTSCB
Jeff Johnson295189b2012-06-20 16:38:30 -070018938(
Jeff Johnsone7245742012-09-05 17:12:55 -070018939 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018940 void* pMsg,
18941 wpt_uint32 uLen,
18942 void* wctsRxMsgCBData
18943)
18944{
Jeff Johnsone7245742012-09-05 17:12:55 -070018945 tHalMsgHeader *pHalMsgHeader;
18946 WDI_EventInfoType wdiEventData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018947 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18948 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18949
18950 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018951 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018952 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018953 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070018954 ( uLen < sizeof(tHalMsgHeader)))
18955 {
18956 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18957 "%s: Invalid parameters", __FUNCTION__);
18958 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018959 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018960 }
18961
18962 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18963 {
18964 /* callback presumably occurred after close */
18965 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18966 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018967 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018968 }
18969
Jeff Johnsone7245742012-09-05 17:12:55 -070018970 /*The RX Callback is expected to be serialized in the proper control thread
Jeff Johnson295189b2012-06-20 16:38:30 -070018971 context - so no serialization is necessary here
18972 ! - revisit this assumption */
18973
18974 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18975
18976 if ( uLen != pHalMsgHeader->msgLen )
18977 {
18978 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18979 "Invalid packet received from HAL - catastrophic failure");
Jeff Johnsone7245742012-09-05 17:12:55 -070018980 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18981 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018982 }
18983
18984 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18985
18986 /*The message itself starts after the header*/
18987 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18988 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18989 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18990 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18991
18992
18993 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
18994 {
18995 /*Stop the timer as the response was received */
18996 /*!UT - check for potential race conditions between stop and response */
18997 wpalTimerStop(&pWDICtx->wptResponseTimer);
18998 }
18999 /* Check if we receive a response message which is not expected */
19000 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
19001 {
19002 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
19003 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
19004 WDI_getRespMsgString(wdiEventData.wdiResponse),
Jeff Johnsone7245742012-09-05 17:12:55 -070019005 wdiEventData.wdiResponse,
Jeff Johnson295189b2012-06-20 16:38:30 -070019006 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19007 pWDICtx->wdiExpectedResponse);
19008 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
19009 return;
19010 }
19011
19012 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19013 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
19014
19015 /*Post response event to the state machine*/
19016 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
19017
19018}/*WDI_RXMsgCTSCB*/
19019
19020
19021/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019022 Internal Helper Routines
Jeff Johnson295189b2012-06-20 16:38:30 -070019023========================================================================*/
19024
19025/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019026 @brief WDI_CleanCB - internal helper routine used to clean the
Jeff Johnson295189b2012-06-20 16:38:30 -070019027 WDI Main Control Block
Jeff Johnsone7245742012-09-05 17:12:55 -070019028
Jeff Johnson295189b2012-06-20 16:38:30 -070019029 @param pWDICtx - pointer to the control block
19030
19031 @return Result of the function call
19032*/
19033WPT_INLINE WDI_Status
19034WDI_CleanCB
19035(
19036 WDI_ControlBlockType* pWDICtx
19037)
19038{
19039 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19040
19041 /*Clean the WDI Control Block*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019042 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
Jeff Johnson295189b2012-06-20 16:38:30 -070019043
Jeff Johnsone7245742012-09-05 17:12:55 -070019044 pWDICtx->uGlobalState = WDI_MAX_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070019045 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
19046 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
19047
19048 WDI_ResetAssocSessions( pWDICtx );
19049
19050 return WDI_STATUS_SUCCESS;
19051}/*WDI_CleanCB*/
19052
19053
19054/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019055 @brief Process request helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019056
Jeff Johnsone7245742012-09-05 17:12:55 -070019057
19058 @param pWDICtx: pointer to the WLAN DAL context
19059 pEventData: pointer to the event information structure
19060
Jeff Johnson295189b2012-06-20 16:38:30 -070019061 @see
19062 @return Result of the function call
19063*/
19064WPT_INLINE WDI_Status
19065WDI_ProcessRequest
19066(
19067 WDI_ControlBlockType* pWDICtx,
19068 WDI_EventInfoType* pEventData
19069)
19070{
19071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19072
Jeff Johnsone7245742012-09-05 17:12:55 -070019073 /*!! Skip sanity check as this is called from the FSM functionss which
Jeff Johnson295189b2012-06-20 16:38:30 -070019074 already checked these pointers*/
19075
19076 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
19077 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019078 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019079 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19080 "Calling request processing function for req %s (%d) %x",
19081 WDI_getReqMsgString(pEventData->wdiRequest),
19082 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
19083 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
19084 }
19085 else
19086 {
19087 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019088 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019089 pEventData->wdiRequest);
19090 return WDI_STATUS_E_NOT_IMPLEMENT;
19091 }
19092}/*WDI_ProcessRequest*/
19093
19094
19095/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019096 @brief Get message helper function - it allocates memory for a
Jeff Johnson295189b2012-06-20 16:38:30 -070019097 message that is to be sent to HAL accross the bus and
Jeff Johnsone7245742012-09-05 17:12:55 -070019098 prefixes it with a send message header
19099
19100 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019101 wdiReqType: type of the request being sent
19102 uBufferLen: message buffer len
19103 pMsgBuffer: resulting allocated buffer
19104 pusDataOffset: offset in the buffer where the caller
19105 can start copying its message data
19106 puBufferSize: the resulting buffer size (offset+buff
19107 len)
Jeff Johnsone7245742012-09-05 17:12:55 -070019108
Jeff Johnson295189b2012-06-20 16:38:30 -070019109 @see
19110 @return Result of the function call
19111*/
19112WDI_Status
19113WDI_GetMessageBuffer
Jeff Johnsone7245742012-09-05 17:12:55 -070019114(
19115 WDI_ControlBlockType* pWDICtx,
19116 WDI_RequestEnumType wdiReqType,
Jeff Johnson295189b2012-06-20 16:38:30 -070019117 wpt_uint16 usBufferLen,
Jeff Johnsone7245742012-09-05 17:12:55 -070019118 wpt_uint8** pMsgBuffer,
19119 wpt_uint16* pusDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070019120 wpt_uint16* pusBufferSize
19121)
19122{
19123 tHalMsgHeader halMsgHeader;
19124 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19125
Jeff Johnsone7245742012-09-05 17:12:55 -070019126 /*!! No sanity check here as we trust the called - ! check this assumption
Jeff Johnson295189b2012-06-20 16:38:30 -070019127 again*/
19128
19129 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019130 Try to allocate message buffer from PAL
Jeff Johnson295189b2012-06-20 16:38:30 -070019131 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019132 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
Jeff Johnson295189b2012-06-20 16:38:30 -070019133 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
19134 if ( NULL == *pMsgBuffer )
19135 {
19136 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19137 "Unable to allocate message buffer for req %s (%d)",
19138 WDI_getReqMsgString(wdiReqType),
Jeff Johnsone7245742012-09-05 17:12:55 -070019139 wdiReqType);
Jeff Johnson295189b2012-06-20 16:38:30 -070019140 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019141 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019142 }
19143
19144 /*-------------------------------------------------------------------------
19145 Fill in the message header
19146 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019147 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
19148 /* Fill msgVersion */
19149#ifdef WLAN_FEATURE_11AC
19150 if (WDI_getFwWlanFeatCaps(DOT11AC))
19151 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1;
19152 else
19153#endif
19154 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0;
Jeff Johnson295189b2012-06-20 16:38:30 -070019155
Jeff Johnsone7245742012-09-05 17:12:55 -070019156 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
19157 *pusDataOffset = sizeof(halMsgHeader);
19158 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
19159
19160 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019161}/*WDI_GetMessageBuffer*/
19162
19163
19164/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019165 @brief Send message helper function - sends a message over the
Jeff Johnson295189b2012-06-20 16:38:30 -070019166 bus using the control tranport and saves some info in
Jeff Johnsone7245742012-09-05 17:12:55 -070019167 the CB
19168
19169 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019170 pSendBuffer: buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019171
Jeff Johnson295189b2012-06-20 16:38:30 -070019172 usSendSize size of the buffer to be sent
19173 pRspCb: response callback - save in the WDI
19174 CB
19175 pUserData: user data associated with the
19176 callback
19177 wdiExpectedResponse: the code of the response that is
19178 expected to be rx-ed for this request
Jeff Johnsone7245742012-09-05 17:12:55 -070019179
Jeff Johnson295189b2012-06-20 16:38:30 -070019180 @see
19181 @return Result of the function call
19182*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019183WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019184WDI_SendMsg
Jeff Johnsone7245742012-09-05 17:12:55 -070019185(
19186 WDI_ControlBlockType* pWDICtx,
19187 wpt_uint8* pSendBuffer,
19188 wpt_uint32 usSendSize,
19189 void* pRspCb,
Jeff Johnson295189b2012-06-20 16:38:30 -070019190 void* pUserData,
19191 WDI_ResponseEnumType wdiExpectedResponse
19192)
19193{
Jeff Johnsond13512a2012-07-17 11:42:19 -070019194 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019195 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19196
19197 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019198 Save needed info in the CB
Jeff Johnson295189b2012-06-20 16:38:30 -070019199 ------------------------------------------------------------------------*/
19200 pWDICtx->pRspCBUserData = pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019201 pWDICtx->pfncRspCB = pRspCb;
19202 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019203
19204 /*-----------------------------------------------------------------------
19205 Call the CTS to send this message over - free message afterwards
19206 - notify transport failure
19207 Note: CTS is reponsible for freeing the message buffer.
19208 -----------------------------------------------------------------------*/
19209 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
19210 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019211 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070019212 "Failed to send message over the bus - catastrophic failure");
19213
Jeff Johnsond13512a2012-07-17 11:42:19 -070019214 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019215 }
19216
Jeff Johnsond13512a2012-07-17 11:42:19 -070019217 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070019218 if ( NULL != pWDICtx->wdiReqStatusCB )
19219 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019220 /*Inform originator whether request went through or not*/
19221 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
19222 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070019223 pWDICtx->wdiReqStatusCB = NULL;
19224 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070019225 callback(wdiStatus, callbackContext);
19226
19227 /*For WDI requests which have registered a request callback,
19228 inform the WDA caller of the same via setting the return value
19229 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
19230 end up repeating the functonality in the req callback for the
19231 WDI_STATUS_E_FAILURE case*/
19232 if (wdiStatus == WDI_STATUS_E_FAILURE)
19233 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070019234 }
19235
Jeff Johnsond13512a2012-07-17 11:42:19 -070019236 if ( wdiStatus == WDI_STATUS_SUCCESS )
19237 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019238 /*Start timer for the expected response */
19239 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070019240 }
19241 else
19242 {
19243 /*Inform upper stack layers that a transport fatal error occured*/
19244 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19245 }
Jeff Johnson295189b2012-06-20 16:38:30 -070019246
Jeff Johnsond13512a2012-07-17 11:42:19 -070019247 return wdiStatus;
19248
Jeff Johnson295189b2012-06-20 16:38:30 -070019249}/*WDI_SendMsg*/
19250
19251
19252
19253/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019254 @brief Send indication helper function - sends a message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019255 the bus using the control transport and saves some info
19256 in the CB
Jeff Johnsone7245742012-09-05 17:12:55 -070019257
19258 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019259 pSendBuffer: buffer to be sent
19260 usSendSize: size of the buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019261
Jeff Johnson295189b2012-06-20 16:38:30 -070019262 @see
19263 @return Result of the function call
19264*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019265WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019266WDI_SendIndication
Jeff Johnsone7245742012-09-05 17:12:55 -070019267(
19268 WDI_ControlBlockType* pWDICtx,
19269 wpt_uint8* pSendBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070019270 wpt_uint32 usSendSize
19271)
19272{
19273 wpt_uint32 uStatus ;
19274 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19275
19276 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019277 Call the CTS to send this message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019278 Note: CTS is reponsible for freeing the message buffer.
19279 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019280 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070019281 (void*)pSendBuffer, usSendSize );
19282
19283 /*Inform Upper MAC about the outcome of the request*/
19284 if ( NULL != pWDICtx->wdiReqStatusCB )
19285 {
19286 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19287 "Send indication status : %d", uStatus);
19288
19289 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
Jeff Johnsone7245742012-09-05 17:12:55 -070019290 WDI_STATUS_SUCCESS,
19291 pWDICtx->pReqStatusUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070019292 }
19293
19294 /*If sending of the message failed - it is considered catastrophic and
19295 indicates an error with the device*/
19296 if ( 0 != uStatus)
19297 {
19298 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019299 "Failed to send indication over the bus - catastrophic failure");
Jeff Johnson295189b2012-06-20 16:38:30 -070019300
19301 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19302 return WDI_STATUS_E_FAILURE;
19303 }
19304
Jeff Johnsone7245742012-09-05 17:12:55 -070019305 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019306}/*WDI_SendIndication*/
19307
19308
19309/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019310 @brief WDI_DetectedDeviceError - called internally by DAL when
19311 it has detected a failure in the device
19312
19313 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019314 usErrorCode: error code detected by WDI or received
19315 from HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070019316
Jeff Johnson295189b2012-06-20 16:38:30 -070019317 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019318 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019319*/
19320void
19321WDI_DetectedDeviceError
19322(
19323 WDI_ControlBlockType* pWDICtx,
19324 wpt_uint16 usErrorCode
19325)
19326{
19327 WDI_LowLevelIndType wdiInd;
19328 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19329
19330 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19331 "Device Error detected code: %d - transitioning to stopped state",
19332 usErrorCode);
19333
19334 wpalMutexAcquire(&pWDICtx->wptMutex);
19335
19336 WDI_STATableStop(pWDICtx);
19337
19338 WDI_ResetAssocSessions(pWDICtx);
19339
19340 /*Set the expected state transition to stopped - because the device
19341 experienced a failure*/
19342 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
19343
19344 /*Transition to stopped to fail all incomming requests from this point on*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019345 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
Jeff Johnson295189b2012-06-20 16:38:30 -070019346
Jeff Johnsone7245742012-09-05 17:12:55 -070019347 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070019348
19349 /*TO DO: - there should be an attempt to reset the device here*/
19350
19351 wpalMutexRelease(&pWDICtx->wptMutex);
19352
19353 /*------------------------------------------------------------------------
19354 Notify UMAC if a handler is registered
19355 ------------------------------------------------------------------------*/
19356 if (pWDICtx->wdiLowLevelIndCB)
19357 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019358 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
19359 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019360
19361 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
19362 }
19363}/*WDI_DetectedDeviceError*/
19364
19365/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019366 @brief This callback is invoked by the wpt when a timer that
Jeff Johnson295189b2012-06-20 16:38:30 -070019367 we started on send message has expire - this should
19368 never happen - it means device is stuck and cannot
Jeff Johnsone7245742012-09-05 17:12:55 -070019369 reply - trigger catastrophic failure
19370 @param
19371
Jeff Johnson295189b2012-06-20 16:38:30 -070019372 pUserData: the callback data of the user (ptr to WDI CB)
Jeff Johnsone7245742012-09-05 17:12:55 -070019373
19374 @see
19375 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019376*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019377void
Jeff Johnson295189b2012-06-20 16:38:30 -070019378WDI_ResponseTimerCB
19379(
19380 void *pUserData
19381)
19382{
19383 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
19384 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19385
19386 if (NULL == pWDICtx )
19387 {
19388 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19389 "%s: Invalid parameters", __FUNCTION__);
19390 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019391 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019392 }
19393
19394 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
19395 {
19396
19397 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19398 "Timeout occurred while waiting for %s (%d) message from device "
Jeff Johnsone7245742012-09-05 17:12:55 -070019399 " - catastrophic failure",
Jeff Johnson295189b2012-06-20 16:38:30 -070019400 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19401 pWDICtx->wdiExpectedResponse);
19402 /* WDI timeout means Riva is not responding or SMD communication to Riva
19403 * is not happening. The only possible way to recover from this error
19404 * is to initiate SSR from APPS */
19405 wpalRivaSubystemRestart();
19406 }
19407 else
19408 {
19409 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19410 "Timeout occurred but not waiting for any response %d",
19411 pWDICtx->wdiExpectedResponse);
19412 }
19413
19414 return;
19415
19416}/*WDI_ResponseTimerCB*/
19417
19418
19419/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019420 @brief Process response helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019421
Jeff Johnsone7245742012-09-05 17:12:55 -070019422
19423 @param pWDICtx: pointer to the WLAN DAL context
19424 pEventData: pointer to the event information structure
19425
Jeff Johnson295189b2012-06-20 16:38:30 -070019426 @see
19427 @return Result of the function call
19428*/
19429WPT_INLINE WDI_Status
19430WDI_ProcessResponse
19431(
19432 WDI_ControlBlockType* pWDICtx,
19433 WDI_EventInfoType* pEventData
19434)
19435{
19436 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19437
Jeff Johnsone7245742012-09-05 17:12:55 -070019438 /* Skip sanity check as this is called from the FSM functions which
Jeff Johnson295189b2012-06-20 16:38:30 -070019439 already checked these pointers
19440 ! - revisit this assumption */
19441 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
19442 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019443 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019444 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070019445 "Calling response processing function for resp %s (%d) %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070019446 WDI_getRespMsgString(pEventData->wdiResponse),
19447 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
19448 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
19449 }
19450 else
19451 {
19452 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019453 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019454 pEventData->wdiResponse);
19455 return WDI_STATUS_E_NOT_IMPLEMENT;
19456 }
19457}/*WDI_ProcessResponse*/
19458
19459
19460/*=========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019461 QUEUE SUPPORT UTILITY FUNCTIONS
Jeff Johnson295189b2012-06-20 16:38:30 -070019462=========================================================================*/
19463
19464/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019465 @brief Utility function used by the DAL Core to help queue a
19466 request that cannot be processed right away.
19467 @param
19468
Jeff Johnson295189b2012-06-20 16:38:30 -070019469 pWDICtx: - pointer to the WDI control block
19470 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019471 queued
19472
19473 @see
19474 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019475*/
19476WDI_Status
19477WDI_QueuePendingReq
19478(
19479 WDI_ControlBlockType* pWDICtx,
19480 WDI_EventInfoType* pEventData
19481)
19482{
Jeff Johnsone7245742012-09-05 17:12:55 -070019483 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019484 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
Jeff Johnsone7245742012-09-05 17:12:55 -070019485 void* pEventInfo = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019486 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19487
19488 if ( NULL == pEventDataQueue )
19489 {
19490 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019491 "Cannot allocate memory for queueing");
Jeff Johnson295189b2012-06-20 16:38:30 -070019492 WDI_ASSERT(0);
19493 return WDI_STATUS_MEM_FAILURE;
19494 }
19495
19496 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19497 pEventDataQueue->pUserData = pEventData->pUserData;
19498 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19499 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019500 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019501
19502 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
19503 {
19504 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070019505
Jeff Johnson295189b2012-06-20 16:38:30 -070019506 if ( NULL == pEventInfo )
19507 {
19508 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019509 "Cannot allocate memory for queueing event data info");
Jeff Johnson295189b2012-06-20 16:38:30 -070019510 WDI_ASSERT(0);
19511 wpalMemoryFree(pEventDataQueue);
19512 return WDI_STATUS_MEM_FAILURE;
19513 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019514
Jeff Johnson295189b2012-06-20 16:38:30 -070019515 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19516
19517 }
19518 pEventDataQueue->pEventData = pEventInfo;
19519
19520 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019521 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019522
Jeff Johnsone7245742012-09-05 17:12:55 -070019523 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019524
19525 return WDI_STATUS_SUCCESS;
19526}/*WDI_QueuePendingReq*/
19527
19528/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019529 @brief Callback function for serializing queued message
Jeff Johnson295189b2012-06-20 16:38:30 -070019530 processing in the control context
Jeff Johnsone7245742012-09-05 17:12:55 -070019531 @param
19532
19533 pMsg - pointer to the message
19534
19535 @see
19536 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019537*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019538void
Jeff Johnson295189b2012-06-20 16:38:30 -070019539WDI_PALCtrlMsgCB
19540(
19541 wpt_msg *pMsg
19542)
19543{
19544 WDI_EventInfoType* pEventData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019545 WDI_ControlBlockType* pWDICtx = NULL;
19546 WDI_Status wdiStatus;
19547 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019548 void* pUserData;
19549 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19550
19551 if (( NULL == pMsg )||
19552 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
19553 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
19554 {
19555 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019556 "Invalid message received on serialize ctrl context API");
Jeff Johnson295189b2012-06-20 16:38:30 -070019557 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019558 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019559 }
19560
19561 /*Transition back to the state that we had before serialization
19562 - serialization transitions us to BUSY to stop any incomming requests
19563 ! TO DO L: possible race condition here if a request comes in between the
19564 state transition and the post function*/
19565
Jeff Johnsone7245742012-09-05 17:12:55 -070019566 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
Jeff Johnson295189b2012-06-20 16:38:30 -070019567
19568 /*-----------------------------------------------------------------------
19569 Check to see what type of event we are serializing
Jeff Johnsone7245742012-09-05 17:12:55 -070019570 - responses are never expected to come through here
Jeff Johnson295189b2012-06-20 16:38:30 -070019571 -----------------------------------------------------------------------*/
19572 switch ( pEventData->wdiRequest )
19573 {
19574
Jeff Johnsone7245742012-09-05 17:12:55 -070019575 case WDI_STOP_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -070019576 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19577 break;
19578
Jeff Johnson295189b2012-06-20 16:38:30 -070019579 case WDI_NV_DOWNLOAD_REQ:
19580 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19581 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19582 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19583 {
19584 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19585 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19586 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19587 }
19588 else
19589 {
19590 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19591 }
19592
19593 break;
19594
19595 default:
19596 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19597 break;
19598 }/*switch ( pEventData->wdiRequest )*/
19599
19600 if ( WDI_STATUS_SUCCESS != wdiStatus )
19601 {
19602 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19603
19604 if ( NULL != pfnReqStatusCB )
19605 {
19606 /*Fail the request*/
19607 pfnReqStatusCB( wdiStatus, pUserData);
19608 }
19609 }
19610
19611 /* Free data - that was allocated when queueing*/
19612 if( pEventData != NULL )
19613 {
19614 if( pEventData->pEventData != NULL )
19615 {
19616 wpalMemoryFree(pEventData->pEventData);
19617 }
19618 wpalMemoryFree(pEventData);
19619 }
19620
19621 if( pMsg != NULL )
19622 {
19623 wpalMemoryFree(pMsg);
19624 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019625
Jeff Johnson295189b2012-06-20 16:38:30 -070019626}/*WDI_PALCtrlMsgCB*/
19627
19628/**
19629 @brief Utility function used by the DAL Core to help dequeue
Jeff Johnsone7245742012-09-05 17:12:55 -070019630 and schedule for execution a pending request
19631 @param
19632
Jeff Johnson295189b2012-06-20 16:38:30 -070019633 pWDICtx: - pointer to the WDI control block
19634 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019635 queued
19636
19637 @see
19638 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019639*/
19640WDI_Status
19641WDI_DequeuePendingReq
19642(
19643 WDI_ControlBlockType* pWDICtx
19644)
19645{
Jeff Johnsone7245742012-09-05 17:12:55 -070019646 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019647 WDI_EventInfoType* pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019648 wpt_msg* palMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070019649 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19650
Jeff Johnsone7245742012-09-05 17:12:55 -070019651 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019652
19653 if ( NULL == pNode )
19654 {
19655 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019656 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019657 return WDI_STATUS_SUCCESS;
19658 }
19659
19660 /*The node actually points to the 1st element inside the Event Data struct -
19661 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019662 pEventData = (WDI_EventInfoType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019663
19664 /*Serialize processing in the control thread
19665 !TO DO: - check to see if these are all the messages params that need
19666 to be filled in*/
19667 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19668
19669 if ( NULL == palMsg )
19670 {
19671 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019672 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
Jeff Johnson295189b2012-06-20 16:38:30 -070019673 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019674 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019675 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019676 palMsg->pContext = pWDICtx;
Jeff Johnson295189b2012-06-20 16:38:30 -070019677 palMsg->callback = WDI_PALCtrlMsgCB;
19678 palMsg->ptr = pEventData;
19679
19680 /*Save the global state as we need it on the other side*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019681 palMsg->val = pWDICtx->uGlobalState;
19682
Jeff Johnson295189b2012-06-20 16:38:30 -070019683 /*Transition back to BUSY as we need to handle a queued request*/
19684 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -070019685
Jeff Johnson295189b2012-06-20 16:38:30 -070019686 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19687
19688 return WDI_STATUS_PENDING;
19689}/*WDI_DequeuePendingReq*/
19690
19691
19692/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019693 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019694 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019695 away.- The assoc requests will be queued by BSSID
19696 @param
19697
Jeff Johnson295189b2012-06-20 16:38:30 -070019698 pWDICtx: - pointer to the WDI control block
19699 pEventData: pointer to the evnt info that needs to be queued
19700 macBSSID: bssid
Jeff Johnsone7245742012-09-05 17:12:55 -070019701
19702 @see
19703 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019704*/
19705WDI_Status
19706WDI_QueueNewAssocRequest
19707(
19708 WDI_ControlBlockType* pWDICtx,
19709 WDI_EventInfoType* pEventData,
19710 wpt_macAddr macBSSID
19711)
19712{
Jeff Johnsone7245742012-09-05 17:12:55 -070019713 wpt_uint8 i;
19714 WDI_BSSSessionType* pSession = NULL;
19715 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019716 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019717 void* pEventInfo;
19718 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019719 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -070019720
Jeff Johnsone7245742012-09-05 17:12:55 -070019721
19722 /*------------------------------------------------------------------------
19723 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019724 ------------------------------------------------------------------------*/
19725 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19726 {
19727 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19728 {
19729 /*Found an empty session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019730 pSession = &pWDICtx->aBSSSessions[i];
19731 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070019732 }
19733 }
19734
19735 if ( i >= WDI_MAX_BSS_SESSIONS )
19736 {
19737 /*Cannot find any empty sessions*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019738 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019739 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019740
Jeff Johnson295189b2012-06-20 16:38:30 -070019741 /*------------------------------------------------------------------------
19742 Fill in the BSSID for this session and set the usage flag
19743 ------------------------------------------------------------------------*/
19744 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070019745 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019746
19747 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019748 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019749 ------------------------------------------------------------------------*/
19750 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19751 if ( NULL == pEventDataQueue )
19752 {
19753 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19754 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19755 WDI_ASSERT(0);
19756 return WDI_STATUS_MEM_FAILURE;
19757 }
19758
19759 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19760 if ( NULL == pSessionIdElement )
19761 {
19762 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19763 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19764 WDI_ASSERT(0);
19765 wpalMemoryFree(pEventDataQueue);
19766 return WDI_STATUS_MEM_FAILURE;
19767 }
19768
19769 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19770 if ( NULL == pEventInfo )
19771 {
19772 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19773 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19774 WDI_ASSERT(0);
19775 wpalMemoryFree(pSessionIdElement);
19776 wpalMemoryFree(pEventDataQueue);
19777 return WDI_STATUS_MEM_FAILURE;
19778 }
19779
19780 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19781 pEventDataQueue->pUserData = pEventData->pUserData;
19782 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19783 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019784 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019785
19786 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19787 pEventDataQueue->pEventData = pEventInfo;
19788
19789 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019790 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019791
19792 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019793 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019794
Jeff Johnsone7245742012-09-05 17:12:55 -070019795 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019796
19797 /*We need to maintain a separate list that keeps track of the order in which
19798 the new assoc requests are being queued such that we can start processing
19799 them in the order that they had arrived*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019800 pSessionIdElement->ucIndex = i;
19801 pNode = (wpt_list_node*)pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019802
19803 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19804 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
Jeff Johnsone7245742012-09-05 17:12:55 -070019805 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019806
19807 /*Return pending as this is what the status of the request is since it has
19808 been queued*/
19809 return WDI_STATUS_PENDING;
19810}/*WDI_QueueNewAssocRequest*/
19811
19812/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019813 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019814 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019815 away.- The assoc requests will be queued by BSSID
19816 @param
19817
Jeff Johnson295189b2012-06-20 16:38:30 -070019818 pWDICtx: - pointer to the WDI control block
19819 pSession: - session in which to queue
19820 pEventData: pointer to the event info that needs to be
19821 queued
Jeff Johnsone7245742012-09-05 17:12:55 -070019822
19823 @see
19824 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019825*/
19826WDI_Status
19827WDI_QueueAssocRequest
19828(
19829 WDI_ControlBlockType* pWDICtx,
19830 WDI_BSSSessionType* pSession,
19831 WDI_EventInfoType* pEventData
19832)
19833{
Jeff Johnsone7245742012-09-05 17:12:55 -070019834 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019835 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019836 void* pEventInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070019837 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019838
19839 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019840 Sanity check
19841 ------------------------------------------------------------------------*/
19842 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19843 {
19844 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19845 "%s: Invalid parameters", __FUNCTION__);
19846
Jeff Johnsone7245742012-09-05 17:12:55 -070019847 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019848 }
19849
19850 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019851 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019852 ------------------------------------------------------------------------*/
19853 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19854 if ( NULL == pEventDataQueue )
19855 {
19856 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019857 "%s: Cannot allocate memory for queueing", __FUNCTION__);
Jeff Johnson295189b2012-06-20 16:38:30 -070019858 WDI_ASSERT(0);
19859 return WDI_STATUS_MEM_FAILURE;
19860 }
19861
19862 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19863 if ( NULL == pEventInfo )
19864 {
19865 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19866 "%s: Cannot allocate memory for queueing event data info",
19867 __FUNCTION__);
19868 WDI_ASSERT(0);
19869 wpalMemoryFree(pEventDataQueue);
19870 return WDI_STATUS_MEM_FAILURE;
19871 }
19872
19873 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19874 pEventDataQueue->pUserData = pEventData->pUserData;
19875 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19876 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019877 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019878 pEventDataQueue->pEventData = pEventInfo;
19879
19880 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19881
19882 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019883 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019884
19885 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019886 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019887
Jeff Johnsone7245742012-09-05 17:12:55 -070019888 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019889
19890 /*The result of this operation is pending because the request has been
19891 queued and it will be processed at a later moment in time */
19892 return WDI_STATUS_PENDING;
19893}/*WDI_QueueAssocRequest*/
19894
19895/**
19896 @brief Utility function used by the DAL Core to help dequeue
19897 an association request that was pending
19898 The request will be queued up in front of the main
19899 pending queue for imediate processing
Jeff Johnsone7245742012-09-05 17:12:55 -070019900 @param
19901
Jeff Johnson295189b2012-06-20 16:38:30 -070019902 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019903
19904
19905 @see
19906 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019907*/
19908WDI_Status
19909WDI_DequeueAssocRequest
19910(
19911 WDI_ControlBlockType* pWDICtx
19912)
19913{
Jeff Johnsone7245742012-09-05 17:12:55 -070019914 wpt_list_node* pNode = NULL;
19915 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019916 WDI_BSSSessionType* pSession;
19917 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019918
19919 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019920 Sanity check
19921 ------------------------------------------------------------------------*/
19922 if ( NULL == pWDICtx )
19923 {
19924 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19925 "%s: Invalid parameters", __FUNCTION__);
19926
Jeff Johnsone7245742012-09-05 17:12:55 -070019927 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019928 }
19929
19930 /*------------------------------------------------------------------------
19931 An association has been completed => a new association can occur
19932 Check to see if there are any pending associations ->
19933 If so , transfer all the pending requests into the busy queue for
19934 processing
19935 These requests have arrived prior to the requests in the busy queue
19936 (bc they needed to be processed in order to be placed in this queue)
19937 => they will be placed at the front of the busy queue
19938 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019939 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019940
19941 if ( NULL == pNode )
19942 {
19943 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019944 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019945 return WDI_STATUS_SUCCESS;
19946 }
19947
19948 /*The node actually points to the 1st element inside the Session Id struct -
19949 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019950 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019951
19952 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19953 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19954
19955 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19956 {
19957 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
Jeff Johnsone7245742012-09-05 17:12:55 -070019958
Jeff Johnson295189b2012-06-20 16:38:30 -070019959 /*Transfer all the pending requests in this assoc queue to
Jeff Johnsone7245742012-09-05 17:12:55 -070019960 the front of the main waiting queue for subsequent execution*/
19961 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019962 while ( NULL != pNode )
19963 {
19964 /*Place it in front of the main pending list*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019965 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19966 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019967 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019968 pSession->bAssocReqQueued = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019969 }
19970 else
19971 {
19972 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019973 "Invalid session id queued up for assoc");
Jeff Johnson295189b2012-06-20 16:38:30 -070019974 WPAL_ASSERT(0);
19975 wpalMemoryFree(pSessionIdElement);
Jeff Johnsone7245742012-09-05 17:12:55 -070019976 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019977 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019978
Jeff Johnson295189b2012-06-20 16:38:30 -070019979 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19980 wpalMemoryFree(pSessionIdElement);
19981 return WDI_STATUS_SUCCESS;
19982}/*WDI_DequeueAssocRequest*/
19983
19984/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019985 @brief Utility function used by the DAL Core to clear any
Jeff Johnson295189b2012-06-20 16:38:30 -070019986 pending requests - all req cb will be called with
19987 failure and the queue will be emptied.
Jeff Johnsone7245742012-09-05 17:12:55 -070019988 @param
19989
Jeff Johnson295189b2012-06-20 16:38:30 -070019990 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019991
19992 @see
19993 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019994*/
19995WDI_Status
19996WDI_ClearPendingRequests
Jeff Johnsone7245742012-09-05 17:12:55 -070019997(
Jeff Johnson295189b2012-06-20 16:38:30 -070019998 WDI_ControlBlockType* pWDICtx
19999)
20000{
Jeff Johnsone7245742012-09-05 17:12:55 -070020001 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020002 WDI_EventInfoType* pEventDataQueue = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070020003 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070020004 void* pUserData;
20005 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
20006
Jeff Johnsone7245742012-09-05 17:12:55 -070020007 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070020008
20009 /*------------------------------------------------------------------------
20010 Go through all the requests and fail them - this will only be called
20011 when device is being stopped or an error was detected - either case the
Jeff Johnsone7245742012-09-05 17:12:55 -070020012 pending requests can no longer be sent down to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070020013 ------------------------------------------------------------------------*/
20014 while( pNode )
20015 {
20016 /*The node actually points to the 1st element inside the Event Data struct -
20017 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020018 pEventDataQueue = (WDI_EventInfoType*)pNode;
20019
Jeff Johnson295189b2012-06-20 16:38:30 -070020020 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
20021 if ( NULL != pfnReqStatusCB )
20022 {
20023 /*Fail the request*/
20024 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
20025 }
20026 /* Free data - that was allocated when queueing */
20027 if ( pEventDataQueue->pEventData != NULL )
20028 {
20029 wpalMemoryFree(pEventDataQueue->pEventData);
20030 }
20031 wpalMemoryFree(pEventDataQueue);
20032
20033 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
20034 {
20035 break;
20036 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020037 }
20038
Jeff Johnson295189b2012-06-20 16:38:30 -070020039 return WDI_STATUS_SUCCESS;
20040}/*WDI_ClearPendingRequests*/
20041
20042/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020043 @brief Helper routine used to init the BSS Sessions in the WDI control block
20044
20045
20046 @param pWDICtx: pointer to the WLAN DAL context
20047
Jeff Johnson295189b2012-06-20 16:38:30 -070020048 @see
20049*/
20050void
20051WDI_ResetAssocSessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020052(
Jeff Johnson295189b2012-06-20 16:38:30 -070020053 WDI_ControlBlockType* pWDICtx
20054)
20055{
Jeff Johnsone7245742012-09-05 17:12:55 -070020056 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020057 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20058
20059 /*-------------------------------------------------------------------------
20060 No Sanity check
20061 -------------------------------------------------------------------------*/
20062 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20063 {
Jeff Johnsone7245742012-09-05 17:12:55 -070020064 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
Jeff Johnson295189b2012-06-20 16:38:30 -070020065 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
20066 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
20067 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
20068 }
20069}/*WDI_ResetAssocSessions*/
20070
20071/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020072 @brief Helper routine used to find a session based on the BSSID
20073
20074
20075 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070020076 macBSSID: BSSID of the session
Jeff Johnsone7245742012-09-05 17:12:55 -070020077 pSession: pointer to the session (if found)
20078
Jeff Johnson295189b2012-06-20 16:38:30 -070020079 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020080 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020081*/
20082wpt_uint8
20083WDI_FindAssocSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020084(
Jeff Johnson295189b2012-06-20 16:38:30 -070020085 WDI_ControlBlockType* pWDICtx,
20086 wpt_macAddr macBSSID,
20087 WDI_BSSSessionType** ppSession
20088)
20089{
Jeff Johnsone7245742012-09-05 17:12:55 -070020090 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020091 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20092
20093 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020094 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020095 -------------------------------------------------------------------------*/
20096 if ( NULL == ppSession )
20097 {
20098 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20099 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020100 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020101 }
20102
Jeff Johnsone7245742012-09-05 17:12:55 -070020103 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020104
Jeff Johnsone7245742012-09-05 17:12:55 -070020105 /*------------------------------------------------------------------------
20106 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070020107 ------------------------------------------------------------------------*/
20108 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20109 {
Jeff Johnsone7245742012-09-05 17:12:55 -070020110 if ( eWLAN_PAL_TRUE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070020111 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
20112 {
20113 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020114 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020115 return i;
20116 }
20117 }
20118
Jeff Johnsone7245742012-09-05 17:12:55 -070020119 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020120}/*WDI_FindAssocSession*/
20121
20122/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020123 @brief Helper routine used to find a session based on the BSSID
20124
20125
20126 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070020127 ucBSSIdx: BSS Index of the session
20128 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070020129
Jeff Johnson295189b2012-06-20 16:38:30 -070020130 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020131 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020132*/
20133wpt_uint8
20134WDI_FindAssocSessionByBSSIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070020135(
Jeff Johnson295189b2012-06-20 16:38:30 -070020136 WDI_ControlBlockType* pWDICtx,
20137 wpt_uint16 ucBSSIdx,
20138 WDI_BSSSessionType** ppSession
20139)
20140{
Jeff Johnsone7245742012-09-05 17:12:55 -070020141 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020142 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20143
20144 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020145 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020146 -------------------------------------------------------------------------*/
20147 if ( NULL == ppSession )
20148 {
20149 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20150 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020151 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020152 }
20153
Jeff Johnsone7245742012-09-05 17:12:55 -070020154 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020155
Jeff Johnsone7245742012-09-05 17:12:55 -070020156 /*------------------------------------------------------------------------
20157 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070020158 ------------------------------------------------------------------------*/
20159 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20160 {
20161 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
20162 {
20163 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020164 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020165 return i;
20166 }
20167 }
20168
Jeff Johnsone7245742012-09-05 17:12:55 -070020169 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020170}/*WDI_FindAssocSessionByBSSIdx*/
20171
20172/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020173 @brief Helper routine used to find a session based on the BSSID
20174
20175
20176 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070020177 ucBSSIdx: BSS Index of the session
20178 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070020179
Jeff Johnson295189b2012-06-20 16:38:30 -070020180 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020181 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020182*/
20183wpt_uint8
20184WDI_FindAssocSessionByIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070020185(
Jeff Johnson295189b2012-06-20 16:38:30 -070020186 WDI_ControlBlockType* pWDICtx,
20187 wpt_uint16 usIdx,
20188 WDI_BSSSessionType** ppSession
20189)
20190{
20191 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20192
20193 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020194 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020195 -------------------------------------------------------------------------*/
20196 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
20197 {
20198 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20199 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020200 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020201 }
20202
20203 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020204 *ppSession = &pWDICtx->aBSSSessions[usIdx];
Jeff Johnson295189b2012-06-20 16:38:30 -070020205
20206 return usIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020207
Jeff Johnson295189b2012-06-20 16:38:30 -070020208}/*WDI_FindAssocSessionByBSSIdx*/
20209
20210/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020211 @brief Helper routine used to find an empty session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020212 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020213
20214
20215 @param pWDICtx: pointer to the WLAN DAL context
20216 pSession: pointer to the session (if found)
20217
Jeff Johnson295189b2012-06-20 16:38:30 -070020218 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020219 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020220*/
20221wpt_uint8
20222WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -070020223(
Jeff Johnson295189b2012-06-20 16:38:30 -070020224 WDI_ControlBlockType* pWDICtx,
20225 WDI_BSSSessionType** ppSession
20226)
20227{
Jeff Johnsone7245742012-09-05 17:12:55 -070020228 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020229 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20230 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020231 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020232 -------------------------------------------------------------------------*/
20233 if ( NULL == ppSession )
20234 {
20235 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20236 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020237 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020238 }
20239
Jeff Johnsone7245742012-09-05 17:12:55 -070020240 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020241
Jeff Johnsone7245742012-09-05 17:12:55 -070020242 /*------------------------------------------------------------------------
20243 Search for a session that it is not in use
Jeff Johnson295189b2012-06-20 16:38:30 -070020244 ------------------------------------------------------------------------*/
20245 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20246 {
20247 if ( ! pWDICtx->aBSSSessions[i].bInUse )
20248 {
20249 /*Found a session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020250 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020251 return i;
20252 }
20253 }
20254
Jeff Johnsone7245742012-09-05 17:12:55 -070020255 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020256}/*WDI_FindEmptySession*/
20257
20258
20259/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020260 @brief Helper routine used to get the total count of active
Jeff Johnson295189b2012-06-20 16:38:30 -070020261 sessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020262
20263
20264 @param pWDICtx: pointer to the WLAN DAL context
20265
Jeff Johnson295189b2012-06-20 16:38:30 -070020266 @see
20267 @return Number of sessions in use
20268*/
20269wpt_uint8
20270WDI_GetActiveSessionsCount
Jeff Johnsone7245742012-09-05 17:12:55 -070020271(
Jeff Johnson295189b2012-06-20 16:38:30 -070020272 WDI_ControlBlockType* pWDICtx
20273)
20274{
Jeff Johnsone7245742012-09-05 17:12:55 -070020275 wpt_uint8 i, ucCount = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070020276 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020277
20278 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070020279 Count all sessions in use
20280 ------------------------------------------------------------------------*/
20281 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20282 {
20283 if ( pWDICtx->aBSSSessions[i].bInUse )
20284 {
20285 ucCount++;
20286 }
20287 }
20288
Jeff Johnsone7245742012-09-05 17:12:55 -070020289 return ucCount;
Jeff Johnson295189b2012-06-20 16:38:30 -070020290}/*WDI_GetActiveSessionsCount*/
20291
20292/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020293 @brief Helper routine used to delete session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020294 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020295
20296
20297 @param pWDICtx: pointer to the WLAN DAL context
20298 pSession: pointer to the session (if found)
20299
Jeff Johnson295189b2012-06-20 16:38:30 -070020300 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020301 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020302*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020303void
Jeff Johnson295189b2012-06-20 16:38:30 -070020304WDI_DeleteSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020305(
Jeff Johnson295189b2012-06-20 16:38:30 -070020306 WDI_ControlBlockType* pWDICtx,
20307 WDI_BSSSessionType* ppSession
20308)
20309{
20310 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020311 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020312 -------------------------------------------------------------------------*/
20313 if ( NULL == ppSession )
20314 {
20315 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20316 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020317 return ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020318 }
20319
Jeff Johnsone7245742012-09-05 17:12:55 -070020320 /*------------------------------------------------------------------------
20321 Reset the entries int session
Jeff Johnson295189b2012-06-20 16:38:30 -070020322 ------------------------------------------------------------------------*/
20323 wpal_list_destroy(&ppSession->wptPendingQueue);
20324 wpalMemoryZero(ppSession, sizeof(*ppSession));
Jeff Johnsone7245742012-09-05 17:12:55 -070020325 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
20326 ppSession->bInUse = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020327 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
20328 wpal_list_init(&ppSession->wptPendingQueue);
20329
20330}/*WDI_DeleteSession*/
20331
20332/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020333 @brief Utility function to add the broadcast STA to the the STA table.
Jeff Johnson295189b2012-06-20 16:38:30 -070020334 The bcast STA ID is assigned by HAL and must be valid.
Jeff Johnsone7245742012-09-05 17:12:55 -070020335 @param
20336
Jeff Johnson295189b2012-06-20 16:38:30 -070020337 WDI_AddStaParams: - pointer to the WDI Add STA params
20338 usBcastStaIdx: - Broadcast STA index passed by HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070020339
20340 @see
20341 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070020342*/
20343void
20344WDI_AddBcastSTAtoSTATable
20345(
20346 WDI_ControlBlockType* pWDICtx,
20347 WDI_AddStaParams * staParams,
20348 wpt_uint16 usBcastStaIdx
20349)
20350{
20351 WDI_AddStaParams wdiAddSTAParam = {0};
20352 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
20353 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20354
20355 /*---------------------------------------------------------------------
20356 Sanity check
20357 ---------------------------------------------------------------------*/
20358 if ( NULL == staParams )
20359 {
20360 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20361 "%s: Invalid parameters", __FUNCTION__);
20362
Jeff Johnsone7245742012-09-05 17:12:55 -070020363 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020364 }
20365
20366 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
20367 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
20368 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
20369 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
20370 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
20371 wdiAddSTAParam.dpuSig = staParams->dpuSig;
20372 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
20373 WDI_MAC_ADDR_LEN );
20374 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
20375 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
20376 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
20377 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
20378 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
20379 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
20380 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020381
Jeff Johnson295189b2012-06-20 16:38:30 -070020382 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
20383}
20384
20385/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020386 @brief NV blob will be divided into fragments of size 4kb and
20387 Sent to HAL
20388
20389 @param pWDICtx: pointer to the WLAN DAL context
20390 pEventData: pointer to the event information structure
20391
Jeff Johnson295189b2012-06-20 16:38:30 -070020392 @see
20393 @return Result of the function call
20394 */
20395
20396WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -070020397(
Jeff Johnson295189b2012-06-20 16:38:30 -070020398 WDI_ControlBlockType* pWDICtx,
20399 WDI_EventInfoType* pEventData
20400)
20401{
20402
20403 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
20404 wpt_uint8* pSendBuffer = NULL;
20405 wpt_uint16 usDataOffset = 0;
20406 wpt_uint16 usSendSize = 0;
20407 wpt_uint16 usCurrentFragmentSize =0;
20408 wpt_uint8* pSrcBuffer = NULL;
20409 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
20410 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
20411
20412 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
20413 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
20414 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
20415
Jeff Johnsone7245742012-09-05 17:12:55 -070020416 /* Sanity Check is done by the caller */
Jeff Johnson295189b2012-06-20 16:38:30 -070020417 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
20418
20419 /* Update the current Fragment Number */
20420 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
20421
20422 /*Update the HAL REQ structure */
20423 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
20424 halNvImgDownloadParam.nvImageReqParams.fragNumber =
20425 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
20426
20427 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
Jeff Johnsone7245742012-09-05 17:12:55 -070020428 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
Jeff Johnson295189b2012-06-20 16:38:30 -070020429 image will be sent to HAL*/
20430
Jeff Johnsone7245742012-09-05 17:12:55 -070020431 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
Jeff Johnson295189b2012-06-20 16:38:30 -070020432 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
Jeff Johnsone7245742012-09-05 17:12:55 -070020433 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020434 /* Taking care of boundry condition */
Jeff Johnsone7245742012-09-05 17:12:55 -070020435 if( !(usCurrentFragmentSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070020436 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
20437 usCurrentFragmentSize = FRAGMENT_SIZE;
20438
20439 /*Update the HAL REQ structure */
20440 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
20441 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
20442
20443 }
20444 else
Jeff Johnsone7245742012-09-05 17:12:55 -070020445 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020446 usCurrentFragmentSize = FRAGMENT_SIZE;
20447
20448 /*Update the HAL REQ structure */
20449 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
20450 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
20451 }
20452
20453 /*-----------------------------------------------------------------------
20454 Get message buffer
20455 -----------------------------------------------------------------------*/
20456 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
20457 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
20458 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070020459 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070020460 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
20461 {
20462 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20463 "Unable to get send buffer in NV Download req %x %x ",
20464 pEventData, pwdiNvDownloadReqParams);
20465 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070020466 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020467 }
20468
20469 /* Copying the Hal NV download REQ structure */
Jeff Johnsone7245742012-09-05 17:12:55 -070020470 wpalMemoryCopy(pSendBuffer + usDataOffset ,
Jeff Johnson295189b2012-06-20 16:38:30 -070020471 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
20472
20473 /* Appending the NV image fragment */
20474 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
20475 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
20476 usCurrentFragmentSize);
20477
20478 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070020479 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070020480
Jeff Johnsone7245742012-09-05 17:12:55 -070020481 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
20482 wdiNvDownloadRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -070020483 WDI_NV_DOWNLOAD_RESP);
20484
20485}
Jeff Johnsone7245742012-09-05 17:12:55 -070020486/*============================================================================
20487 Helper inline functions for
Jeff Johnson295189b2012-06-20 16:38:30 -070020488 ============================================================================*/
20489/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020490 @brief Helper routine used to find a session based on the BSSID
20491 @param pContext: pointer to the WLAN DAL context
20492 @param pDPContext: pointer to the Datapath context
20493
Jeff Johnson295189b2012-06-20 16:38:30 -070020494 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020495 @return
Jeff Johnson295189b2012-06-20 16:38:30 -070020496*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020497WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020498WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
20499{
20500 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20501
20502 pCB->pDPContext = pDPContext;
20503 return;
20504}
20505
20506/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020507 @brief Helper routine used to find a session based on the BSSID
20508
20509
20510 @param pContext: pointer to the WLAN DAL context
20511
Jeff Johnson295189b2012-06-20 16:38:30 -070020512 @see
20513 @return pointer to Datapath context
20514*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020515WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020516WDI_DS_GetDatapathContext (void *pContext)
20517{
20518 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20519 return pCB->pDPContext;
20520}
20521/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020522 @brief Helper routine used to find a session based on the BSSID
20523
20524
20525 @param pContext: pointer to the WLAN DAL context
20526 @param pDTDriverContext: pointer to the Transport Driver context
20527
Jeff Johnson295189b2012-06-20 16:38:30 -070020528 @see
20529 @return void
20530*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020531WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020532WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
20533{
20534 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20535
20536 pCB->pDTDriverContext = pDTDriverContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020537 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020538}
20539
20540/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020541 @brief Helper routine used to find a session based on the BSSID
20542
20543
20544 @param pWDICtx: pointer to the WLAN DAL context
20545
Jeff Johnson295189b2012-06-20 16:38:30 -070020546 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020547 @return pointer to datapath context
Jeff Johnson295189b2012-06-20 16:38:30 -070020548*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020549WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020550WDT_GetTransportDriverContext (void *pContext)
20551{
20552 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020553 return(pCB->pDTDriverContext);
Jeff Johnson295189b2012-06-20 16:38:30 -070020554}
20555
Jeff Johnsone7245742012-09-05 17:12:55 -070020556/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -070020557 Helper inline converters
20558 ============================================================================*/
20559/*Convert WDI driver type into HAL driver type*/
20560WPT_STATIC WPT_INLINE WDI_Status
20561WDI_HAL_2_WDI_STATUS
20562(
20563 eHalStatus halStatus
20564)
20565{
Jeff Johnsone7245742012-09-05 17:12:55 -070020566 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020567 the chances of getting inlined*/
20568 switch( halStatus )
20569 {
20570 case eHAL_STATUS_SUCCESS:
20571 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20572 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20573 return WDI_STATUS_SUCCESS;
20574 case eHAL_STATUS_FAILURE:
20575 return WDI_STATUS_E_FAILURE;
20576 case eHAL_STATUS_FAILED_ALLOC:
Jeff Johnsone7245742012-09-05 17:12:55 -070020577 return WDI_STATUS_MEM_FAILURE;
20578 /*The rest of the HAL error codes must be kept hidden from the UMAC as
Jeff Johnson295189b2012-06-20 16:38:30 -070020579 they refer to specific internal modules of our device*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020580 default:
20581 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20582 }
Jeff Johnson295189b2012-06-20 16:38:30 -070020583
Jeff Johnsone7245742012-09-05 17:12:55 -070020584 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020585}/*WDI_HAL_2_WDI_STATUS*/
20586
20587/*Convert WDI request type into HAL request type*/
20588WPT_STATIC WPT_INLINE tHalHostMsgType
20589WDI_2_HAL_REQ_TYPE
20590(
20591 WDI_RequestEnumType wdiReqType
20592)
20593{
Jeff Johnsone7245742012-09-05 17:12:55 -070020594 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020595 the chances of getting inlined*/
20596 switch( wdiReqType )
Jeff Johnsone7245742012-09-05 17:12:55 -070020597 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020598 case WDI_START_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020599 return WLAN_HAL_START_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020600 case WDI_STOP_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020601 return WLAN_HAL_STOP_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020602 case WDI_INIT_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020603 return WLAN_HAL_INIT_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020604 case WDI_START_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020605 return WLAN_HAL_START_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020606 case WDI_END_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020607 return WLAN_HAL_END_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020608 case WDI_FINISH_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020609 return WLAN_HAL_FINISH_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020610 case WDI_JOIN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020611 return WLAN_HAL_JOIN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020612 case WDI_CONFIG_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020613 return WLAN_HAL_CONFIG_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020614 case WDI_DEL_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020615 return WLAN_HAL_DELETE_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020616 case WDI_POST_ASSOC_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020617 return WLAN_HAL_POST_ASSOC_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020618 case WDI_DEL_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020619 return WLAN_HAL_DELETE_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020620 case WDI_SET_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020621 return WLAN_HAL_SET_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020622 case WDI_RMV_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020623 return WLAN_HAL_RMV_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020624 case WDI_SET_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020625 return WLAN_HAL_SET_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020626 case WDI_RMV_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020627 return WLAN_HAL_RMV_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020628 case WDI_SET_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020629 return WLAN_HAL_SET_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020630 case WDI_RMV_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020631 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020632 return WLAN_HAL_RMV_STAKEY_REQ;
20633 case WDI_ADD_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020634 return WLAN_HAL_ADD_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020635 case WDI_DEL_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020636 return WLAN_HAL_DEL_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020637 case WDI_UPD_EDCA_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020638 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020639 case WDI_ADD_BA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020640 return WLAN_HAL_ADD_BA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020641 case WDI_DEL_BA_REQ:
20642 return WLAN_HAL_DEL_BA_REQ;
20643#ifdef FEATURE_WLAN_CCX
20644 case WDI_TSM_STATS_REQ:
20645 return WLAN_HAL_TSM_STATS_REQ;
20646#endif
20647 case WDI_CH_SWITCH_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020648 return WLAN_HAL_CH_SWITCH_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020649 case WDI_CONFIG_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020650 return WLAN_HAL_CONFIG_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020651 case WDI_SET_LINK_ST_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020652 return WLAN_HAL_SET_LINK_ST_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020653 case WDI_GET_STATS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020654 return WLAN_HAL_GET_STATS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020655 case WDI_UPDATE_CFG_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020656 return WLAN_HAL_UPDATE_CFG_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020657 case WDI_ADD_BA_SESSION_REQ:
20658 return WLAN_HAL_ADD_BA_SESSION_REQ;
20659 case WDI_TRIGGER_BA_REQ:
20660 return WLAN_HAL_TRIGGER_BA_REQ;
20661 case WDI_UPD_BCON_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020662 return WLAN_HAL_UPDATE_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020663 case WDI_SND_BCON_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020664 return WLAN_HAL_SEND_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020665 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20666 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20667 case WDI_SET_MAX_TX_POWER_REQ:
20668 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20669#ifdef WLAN_FEATURE_P2P
20670 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20671 return WLAN_HAL_SET_P2P_GONOA_REQ;
20672#endif
20673 case WDI_ENTER_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020674 return WLAN_HAL_ENTER_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020675 case WDI_EXIT_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020676 return WLAN_HAL_EXIT_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020677 case WDI_ENTER_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020678 return WLAN_HAL_ENTER_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020679 case WDI_EXIT_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020680 return WLAN_HAL_EXIT_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020681 case WDI_ENTER_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020682 return WLAN_HAL_ENTER_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020683 case WDI_EXIT_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020684 return WLAN_HAL_EXIT_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020685 case WDI_SET_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020686 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020687 case WDI_UPDATE_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020688 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020689 case WDI_CONFIGURE_RXP_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020690 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020691 case WDI_SET_BEACON_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020692 return WLAN_HAL_ADD_BCN_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020693 case WDI_REM_BEACON_FILTER_REQ:
20694 return WLAN_HAL_REM_BCN_FILTER_REQ;
20695 case WDI_SET_RSSI_THRESHOLDS_REQ:
20696 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20697 case WDI_HOST_OFFLOAD_REQ:
20698 return WLAN_HAL_HOST_OFFLOAD_REQ;
20699 case WDI_WOWL_ADD_BC_PTRN_REQ:
20700 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20701 case WDI_WOWL_DEL_BC_PTRN_REQ:
20702 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20703 case WDI_WOWL_ENTER_REQ:
20704 return WLAN_HAL_ENTER_WOWL_REQ;
20705 case WDI_WOWL_EXIT_REQ:
20706 return WLAN_HAL_EXIT_WOWL_REQ;
20707 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20708 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20709 case WDI_NV_DOWNLOAD_REQ:
20710 return WLAN_HAL_DOWNLOAD_NV_REQ;
20711 case WDI_FLUSH_AC_REQ:
20712 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20713 case WDI_BTAMP_EVENT_REQ:
20714 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20715#ifdef WLAN_FEATURE_VOWIFI_11R
20716 case WDI_AGGR_ADD_TS_REQ:
20717 return WLAN_HAL_AGGR_ADD_TS_REQ;
20718#endif /* WLAN_FEATURE_VOWIFI_11R */
20719#ifdef ANI_MANF_DIAG
20720 case WDI_FTM_CMD_REQ:
20721 return WLAN_HAL_PROCESS_PTT_REQ;
20722#endif /* ANI_MANF_DIAG */
20723 case WDI_ADD_STA_SELF_REQ:
20724 return WLAN_HAL_ADD_STA_SELF_REQ;
20725 case WDI_DEL_STA_SELF_REQ:
20726 return WLAN_HAL_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070020727#ifdef FEATURE_OEM_DATA_SUPPORT
20728 case WDI_START_OEM_DATA_REQ:
20729 return WLAN_HAL_START_OEM_DATA_REQ;
20730#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020731 case WDI_HOST_RESUME_REQ:
20732 return WLAN_HAL_HOST_RESUME_REQ;
20733 case WDI_HOST_SUSPEND_IND:
20734 return WLAN_HAL_HOST_SUSPEND_IND;
20735 case WDI_KEEP_ALIVE_REQ:
20736 return WLAN_HAL_KEEP_ALIVE_REQ;
20737
20738#ifdef FEATURE_WLAN_SCAN_PNO
20739 case WDI_SET_PREF_NETWORK_REQ:
20740 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20741 case WDI_SET_RSSI_FILTER_REQ:
20742 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20743 case WDI_UPDATE_SCAN_PARAMS_REQ:
20744 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20745#endif // FEATURE_WLAN_SCAN_PNO
20746 case WDI_SET_TX_PER_TRACKING_REQ:
20747 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20748#ifdef WLAN_FEATURE_PACKET_FILTERING
20749 case WDI_8023_MULTICAST_LIST_REQ:
20750 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20751 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020752 return WLAN_HAL_SET_PACKET_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020753 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20754 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20755 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20756 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20757#endif // WLAN_FEATURE_PACKET_FILTERING
20758 case WDI_HAL_DUMP_CMD_REQ:
20759 return WLAN_HAL_DUMP_COMMAND_REQ;
20760#ifdef WLAN_FEATURE_GTK_OFFLOAD
20761 case WDI_GTK_OFFLOAD_REQ:
20762 return WLAN_HAL_GTK_OFFLOAD_REQ;
20763 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20764 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20765#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20766
20767 case WDI_INIT_SCAN_CON_REQ:
20768 return WLAN_HAL_INIT_SCAN_CON_REQ;
20769 case WDI_SET_POWER_PARAMS_REQ:
20770 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20771 case WDI_SET_TM_LEVEL_REQ:
20772 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20773 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20774 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020775#ifdef WLAN_FEATURE_11AC
20776 case WDI_UPDATE_VHT_OP_MODE_REQ:
20777 return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ;
20778#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020779 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020780 return WLAN_HAL_MSG_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020781 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020782
Jeff Johnson295189b2012-06-20 16:38:30 -070020783}/*WDI_2_HAL_REQ_TYPE*/
20784
20785/*Convert WDI response type into HAL response type*/
20786WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20787HAL_2_WDI_RSP_TYPE
20788(
20789 tHalHostMsgType halMsg
20790)
20791{
Jeff Johnsone7245742012-09-05 17:12:55 -070020792 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020793 the chances of getting inlined*/
20794 switch( halMsg )
20795 {
20796 case WLAN_HAL_START_RSP:
20797 return WDI_START_RESP;
20798 case WLAN_HAL_STOP_RSP:
20799 return WDI_STOP_RESP;
20800 case WLAN_HAL_INIT_SCAN_RSP:
20801 return WDI_INIT_SCAN_RESP;
20802 case WLAN_HAL_START_SCAN_RSP:
20803 return WDI_START_SCAN_RESP;
20804 case WLAN_HAL_END_SCAN_RSP:
20805 return WDI_END_SCAN_RESP;
20806 case WLAN_HAL_FINISH_SCAN_RSP:
20807 return WDI_FINISH_SCAN_RESP;
20808 case WLAN_HAL_CONFIG_STA_RSP:
20809 return WDI_CONFIG_STA_RESP;
20810 case WLAN_HAL_DELETE_STA_RSP:
20811 return WDI_DEL_STA_RESP;
20812 case WLAN_HAL_CONFIG_BSS_RSP:
20813 return WDI_CONFIG_BSS_RESP;
20814 case WLAN_HAL_DELETE_BSS_RSP:
20815 return WDI_DEL_BSS_RESP;
20816 case WLAN_HAL_JOIN_RSP:
20817 return WDI_JOIN_RESP;
20818 case WLAN_HAL_POST_ASSOC_RSP:
20819 return WDI_POST_ASSOC_RESP;
20820 case WLAN_HAL_SET_BSSKEY_RSP:
20821 return WDI_SET_BSS_KEY_RESP;
20822 case WLAN_HAL_SET_STAKEY_RSP:
20823 return WDI_SET_STA_KEY_RESP;
20824 case WLAN_HAL_RMV_BSSKEY_RSP:
20825 return WDI_RMV_BSS_KEY_RESP;
20826 case WLAN_HAL_RMV_STAKEY_RSP:
20827 return WDI_RMV_STA_KEY_RESP;
20828 case WLAN_HAL_SET_BCASTKEY_RSP:
20829 return WDI_SET_STA_BCAST_KEY_RESP;
20830 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20831 // return WDI_RMV_STA_BCAST_KEY_RESP;
20832 case WLAN_HAL_ADD_TS_RSP:
20833 return WDI_ADD_TS_RESP;
20834 case WLAN_HAL_DEL_TS_RSP:
20835 return WDI_DEL_TS_RESP;
20836 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20837 return WDI_UPD_EDCA_PRMS_RESP;
20838 case WLAN_HAL_ADD_BA_RSP:
20839 return WDI_ADD_BA_RESP;
20840 case WLAN_HAL_DEL_BA_RSP:
20841 return WDI_DEL_BA_RESP;
20842#ifdef FEATURE_WLAN_CCX
20843 case WLAN_HAL_TSM_STATS_RSP:
20844 return WDI_TSM_STATS_RESP;
20845#endif
20846 case WLAN_HAL_CH_SWITCH_RSP:
20847 return WDI_CH_SWITCH_RESP;
20848 case WLAN_HAL_SET_LINK_ST_RSP:
20849 return WDI_SET_LINK_ST_RESP;
20850 case WLAN_HAL_GET_STATS_RSP:
20851 return WDI_GET_STATS_RESP;
20852 case WLAN_HAL_UPDATE_CFG_RSP:
20853 return WDI_UPDATE_CFG_RESP;
20854 case WLAN_HAL_ADD_BA_SESSION_RSP:
20855 return WDI_ADD_BA_SESSION_RESP;
20856 case WLAN_HAL_TRIGGER_BA_RSP:
20857 return WDI_TRIGGER_BA_RESP;
20858 case WLAN_HAL_UPDATE_BEACON_RSP:
20859 return WDI_UPD_BCON_PRMS_RESP;
20860 case WLAN_HAL_SEND_BEACON_RSP:
20861 return WDI_SND_BCON_RESP;
20862 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20863 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20864 /*Indications*/
20865 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20866 return WDI_HAL_RSSI_NOTIFICATION_IND;
20867 case WLAN_HAL_MISSED_BEACON_IND:
20868 return WDI_HAL_MISSED_BEACON_IND;
20869 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20870 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20871 case WLAN_HAL_MIC_FAILURE_IND:
20872 return WDI_HAL_MIC_FAILURE_IND;
20873 case WLAN_HAL_FATAL_ERROR_IND:
20874 return WDI_HAL_FATAL_ERROR_IND;
20875 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20876 return WDI_HAL_DEL_STA_IND;
20877 case WLAN_HAL_COEX_IND:
20878 return WDI_HAL_COEX_IND;
20879 case WLAN_HAL_OTA_TX_COMPL_IND:
20880 return WDI_HAL_TX_COMPLETE_IND;
20881#ifdef WLAN_FEATURE_P2P
20882 case WLAN_HAL_P2P_NOA_ATTR_IND:
20883 return WDI_HAL_P2P_NOA_ATTR_IND;
20884#endif
20885 case WLAN_HAL_TX_PER_HIT_IND:
20886 return WDI_HAL_TX_PER_HIT_IND;
20887 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20888 return WDI_SET_MAX_TX_POWER_RESP;
20889#ifdef WLAN_FEATURE_P2P
20890 case WLAN_HAL_SET_P2P_GONOA_RSP:
20891 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20892#endif
20893 case WLAN_HAL_ENTER_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020894 return WDI_ENTER_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020895 case WLAN_HAL_EXIT_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020896 return WDI_EXIT_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020897 case WLAN_HAL_ENTER_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020898 return WDI_ENTER_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020899 case WLAN_HAL_EXIT_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020900 return WDI_EXIT_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020901 case WLAN_HAL_ENTER_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020902 return WDI_ENTER_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020903 case WLAN_HAL_EXIT_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020904 return WDI_EXIT_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020905 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020906 return WDI_SET_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020907 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020908 return WDI_UPDATE_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020909 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020910 return WDI_CONFIGURE_RXP_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020911 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20912 return WDI_SET_BEACON_FILTER_RESP;
20913 case WLAN_HAL_REM_BCN_FILTER_RSP:
20914 return WDI_REM_BEACON_FILTER_RESP;
20915 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20916 return WDI_SET_RSSI_THRESHOLDS_RESP;
20917 case WLAN_HAL_HOST_OFFLOAD_RSP:
20918 return WDI_HOST_OFFLOAD_RESP;
20919 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20920 return WDI_WOWL_ADD_BC_PTRN_RESP;
20921 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20922 return WDI_WOWL_DEL_BC_PTRN_RESP;
20923 case WLAN_HAL_ENTER_WOWL_RSP:
20924 return WDI_WOWL_ENTER_RESP;
20925 case WLAN_HAL_EXIT_WOWL_RSP:
20926 return WDI_WOWL_EXIT_RESP;
20927 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20928 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20929 case WLAN_HAL_DOWNLOAD_NV_RSP:
20930 return WDI_NV_DOWNLOAD_RESP;
20931 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20932 return WDI_FLUSH_AC_RESP;
20933 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20934 return WDI_BTAMP_EVENT_RESP;
20935#ifdef ANI_MANF_DIAG
20936 case WLAN_HAL_PROCESS_PTT_RSP:
20937 return WDI_FTM_CMD_RESP;
20938#endif /* ANI_MANF_DIAG */
20939 case WLAN_HAL_ADD_STA_SELF_RSP:
20940 return WDI_ADD_STA_SELF_RESP;
20941case WLAN_HAL_DEL_STA_SELF_RSP:
20942 return WDI_DEL_STA_SELF_RESP;
Jeff Johnsone7245742012-09-05 17:12:55 -070020943#ifdef FEATURE_OEM_DATA_SUPPORT
20944 case WLAN_HAL_START_OEM_DATA_RSP:
20945 return WDI_START_OEM_DATA_RESP;
20946#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020947 case WLAN_HAL_HOST_RESUME_RSP:
20948 return WDI_HOST_RESUME_RESP;
20949 case WLAN_HAL_KEEP_ALIVE_RSP:
20950 return WDI_KEEP_ALIVE_RESP;
20951#ifdef FEATURE_WLAN_SCAN_PNO
20952 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20953 return WDI_SET_PREF_NETWORK_RESP;
20954 case WLAN_HAL_SET_RSSI_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020955 return WDI_SET_RSSI_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020956 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20957 return WDI_UPDATE_SCAN_PARAMS_RESP;
20958 case WLAN_HAL_PREF_NETW_FOUND_IND:
20959 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20960#endif // FEATURE_WLAN_SCAN_PNO
20961 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20962 return WDI_SET_TX_PER_TRACKING_RESP;
20963#ifdef WLAN_FEATURE_PACKET_FILTERING
20964 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20965 return WDI_8023_MULTICAST_LIST_RESP;
20966 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20967 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20968 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20969 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20970 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20971 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20972#endif // WLAN_FEATURE_PACKET_FILTERING
20973
20974 case WLAN_HAL_DUMP_COMMAND_RSP:
20975 return WDI_HAL_DUMP_CMD_RESP;
20976 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20977 return WDI_SET_POWER_PARAMS_RESP;
20978#ifdef WLAN_FEATURE_VOWIFI_11R
20979 case WLAN_HAL_AGGR_ADD_TS_RSP:
20980 return WDI_AGGR_ADD_TS_RESP;
20981#endif
20982
20983#ifdef WLAN_FEATURE_GTK_OFFLOAD
20984 case WLAN_HAL_GTK_OFFLOAD_RSP:
20985 return WDI_GTK_OFFLOAD_RESP;
20986 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
20987 return WDI_GTK_OFFLOAD_GETINFO_RESP;
20988#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20989#ifdef WLAN_WAKEUP_EVENTS
20990 case WLAN_HAL_WAKE_REASON_IND:
20991 return WDI_HAL_WAKE_REASON_IND;
20992#endif // WLAN_WAKEUP_EVENTS
20993
20994 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
20995 return WDI_SET_TM_LEVEL_RESP;
20996 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
20997 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020998#ifdef WLAN_FEATURE_11AC
20999 case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP:
21000 return WDI_UPDATE_VHT_OP_MODE_RESP;
21001#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021002 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070021003 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021004 }
21005
21006}/*HAL_2_WDI_RSP_TYPE*/
21007
21008
21009/*Convert WDI driver type into HAL driver type*/
21010WPT_STATIC WPT_INLINE tDriverType
21011WDI_2_HAL_DRV_TYPE
21012(
21013 WDI_DriverType wdiDriverType
21014)
21015{
Jeff Johnsone7245742012-09-05 17:12:55 -070021016 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021017 the chances of getting inlined*/
21018 switch( wdiDriverType )
21019 {
21020 case WDI_DRIVER_TYPE_PRODUCTION:
21021 return eDRIVER_TYPE_PRODUCTION;
21022 case WDI_DRIVER_TYPE_MFG:
21023 return eDRIVER_TYPE_MFG;
21024 case WDI_DRIVER_TYPE_DVT:
21025 return eDRIVER_TYPE_DVT;
21026 }
21027
Jeff Johnsone7245742012-09-05 17:12:55 -070021028 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021029}/*WDI_2_HAL_DRV_TYPE*/
21030
21031
21032/*Convert WDI stop reason into HAL stop reason*/
21033WPT_STATIC WPT_INLINE tHalStopType
21034WDI_2_HAL_STOP_REASON
21035(
21036 WDI_StopType wdiDriverType
21037)
21038{
Jeff Johnsone7245742012-09-05 17:12:55 -070021039 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021040 the chances of getting inlined*/
21041 switch( wdiDriverType )
21042 {
21043 case WDI_STOP_TYPE_SYS_RESET:
21044 return HAL_STOP_TYPE_SYS_RESET;
21045 case WDI_DRIVER_TYPE_MFG:
21046 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
21047 case WDI_STOP_TYPE_RF_KILL:
21048 return HAL_STOP_TYPE_RF_KILL;
21049 }
21050
Jeff Johnsone7245742012-09-05 17:12:55 -070021051 return HAL_STOP_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021052}/*WDI_2_HAL_STOP_REASON*/
21053
21054
21055/*Convert WDI scan mode type into HAL scan mode type*/
21056WPT_STATIC WPT_INLINE eHalSysMode
21057WDI_2_HAL_SCAN_MODE
21058(
21059 WDI_ScanMode wdiScanMode
21060)
21061{
Jeff Johnsone7245742012-09-05 17:12:55 -070021062 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021063 the chances of getting inlined*/
21064 switch( wdiScanMode )
21065 {
21066 case WDI_SCAN_MODE_NORMAL:
21067 return eHAL_SYS_MODE_NORMAL;
21068 case WDI_SCAN_MODE_LEARN:
21069 return eHAL_SYS_MODE_LEARN;
21070 case WDI_SCAN_MODE_SCAN:
21071 return eHAL_SYS_MODE_SCAN;
21072 case WDI_SCAN_MODE_PROMISC:
21073 return eHAL_SYS_MODE_PROMISC;
21074 case WDI_SCAN_MODE_SUSPEND_LINK:
21075 return eHAL_SYS_MODE_SUSPEND_LINK;
21076 }
21077
Jeff Johnsone7245742012-09-05 17:12:55 -070021078 return eHAL_SYS_MODE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021079}/*WDI_2_HAL_SCAN_MODE*/
21080
21081/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021082WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -070021083WDI_2_HAL_SEC_CH_OFFSET
21084(
21085 WDI_HTSecondaryChannelOffset wdiSecChOffset
21086)
21087{
Jeff Johnsone7245742012-09-05 17:12:55 -070021088 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021089 the chances of getting inlined*/
21090 switch( wdiSecChOffset )
21091 {
21092 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
Jeff Johnsone7245742012-09-05 17:12:55 -070021093 return PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021094 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
Jeff Johnsone7245742012-09-05 17:12:55 -070021095 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
Jeff Johnson295189b2012-06-20 16:38:30 -070021096 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
Jeff Johnsone7245742012-09-05 17:12:55 -070021097 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
21098#ifdef WLAN_FEATURE_11AC
21099 case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
21100 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
21101 case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
21102 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
21103 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
21104 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
21105 case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW:
21106 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21107 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
21108 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21109 case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
21110 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
21111 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
21112 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
21113#endif
21114 default:
21115 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021116 }
21117
Jeff Johnsone7245742012-09-05 17:12:55 -070021118 return PHY_CHANNEL_BONDING_STATE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021119}/*WDI_2_HAL_SEC_CH_OFFSET*/
21120
21121/*Convert WDI BSS type into HAL BSS type*/
21122WPT_STATIC WPT_INLINE tSirBssType
21123WDI_2_HAL_BSS_TYPE
21124(
21125 WDI_BssType wdiBSSType
21126)
21127{
Jeff Johnsone7245742012-09-05 17:12:55 -070021128 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021129 the chances of getting inlined*/
21130 switch( wdiBSSType )
21131 {
21132 case WDI_INFRASTRUCTURE_MODE:
21133 return eSIR_INFRASTRUCTURE_MODE;
21134 case WDI_INFRA_AP_MODE:
21135 return eSIR_INFRA_AP_MODE;
21136 case WDI_IBSS_MODE:
21137 return eSIR_IBSS_MODE;
21138 case WDI_BTAMP_STA_MODE:
21139 return eSIR_BTAMP_STA_MODE;
21140 case WDI_BTAMP_AP_MODE:
Jeff Johnsone7245742012-09-05 17:12:55 -070021141 return eSIR_BTAMP_AP_MODE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021142 case WDI_BSS_AUTO_MODE:
21143 return eSIR_AUTO_MODE;
21144 }
21145
Jeff Johnsone7245742012-09-05 17:12:55 -070021146 return eSIR_DONOT_USE_BSS_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021147}/*WDI_2_HAL_BSS_TYPE*/
21148
21149/*Convert WDI NW type into HAL NW type*/
21150WPT_STATIC WPT_INLINE tSirNwType
21151WDI_2_HAL_NW_TYPE
21152(
21153 WDI_NwType wdiNWType
21154)
21155{
Jeff Johnsone7245742012-09-05 17:12:55 -070021156 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021157 the chances of getting inlined*/
21158 switch( wdiNWType )
21159 {
21160 case WDI_11A_NW_TYPE:
21161 return eSIR_11A_NW_TYPE;
21162 case WDI_11B_NW_TYPE:
21163 return eSIR_11B_NW_TYPE;
21164 case WDI_11G_NW_TYPE:
21165 return eSIR_11G_NW_TYPE;
21166 case WDI_11N_NW_TYPE:
21167 return eSIR_11N_NW_TYPE;
21168 }
21169
Jeff Johnsone7245742012-09-05 17:12:55 -070021170 return eSIR_DONOT_USE_NW_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021171}/*WDI_2_HAL_NW_TYPE*/
21172
21173/*Convert WDI chanel bonding type into HAL cb type*/
21174WPT_STATIC WPT_INLINE ePhyChanBondState
21175WDI_2_HAL_CB_STATE
21176(
21177 WDI_PhyChanBondState wdiCbState
21178)
21179{
Jeff Johnsone7245742012-09-05 17:12:55 -070021180 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021181 the chances of getting inlined*/
21182 switch ( wdiCbState )
21183 {
21184 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
21185 return PHY_SINGLE_CHANNEL_CENTERED;
21186 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
21187 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
21188 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
21189 return PHY_DOUBLE_CHANNEL_CENTERED;
21190 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
21191 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
Jeff Johnsone7245742012-09-05 17:12:55 -070021192#ifdef WLAN_FEATURE_11AC
21193 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
21194 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
21195 case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
21196 return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
21197 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
21198 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
21199 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
21200 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21201 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
21202 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
21203 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
21204 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
21205 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
21206 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
21207#endif
21208 case WDI_MAX_CB_STATE:
21209 default:
21210 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021211 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021212
Jeff Johnson295189b2012-06-20 16:38:30 -070021213 return PHY_CHANNEL_BONDING_STATE_MAX;
21214}/*WDI_2_HAL_CB_STATE*/
21215
21216/*Convert WDI chanel bonding type into HAL cb type*/
21217WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
21218WDI_2_HAL_HT_OPER_MODE
21219(
21220 WDI_HTOperatingMode wdiHTOperMode
21221)
21222{
Jeff Johnsone7245742012-09-05 17:12:55 -070021223 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021224 the chances of getting inlined*/
21225 switch ( wdiHTOperMode )
21226 {
21227 case WDI_HT_OP_MODE_PURE:
21228 return eSIR_HT_OP_MODE_PURE;
21229 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
21230 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
21231 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
21232 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
21233 case WDI_HT_OP_MODE_MIXED:
21234 return eSIR_HT_OP_MODE_MIXED;
21235 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021236
Jeff Johnson295189b2012-06-20 16:38:30 -070021237 return eSIR_HT_OP_MODE_MAX;
21238}/*WDI_2_HAL_HT_OPER_MODE*/
21239
21240/*Convert WDI mimo PS type into HAL mimo PS type*/
21241WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
21242WDI_2_HAL_MIMO_PS
21243(
21244 WDI_HTMIMOPowerSaveState wdiHTOperMode
21245)
21246{
Jeff Johnsone7245742012-09-05 17:12:55 -070021247 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021248 the chances of getting inlined*/
21249 switch ( wdiHTOperMode )
21250 {
21251 case WDI_HT_MIMO_PS_STATIC:
21252 return eSIR_HT_MIMO_PS_STATIC;
21253 case WDI_HT_MIMO_PS_DYNAMIC:
21254 return eSIR_HT_MIMO_PS_DYNAMIC;
21255 case WDI_HT_MIMO_PS_NA:
21256 return eSIR_HT_MIMO_PS_NA;
21257 case WDI_HT_MIMO_PS_NO_LIMIT:
21258 return eSIR_HT_MIMO_PS_NO_LIMIT;
21259 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021260
Jeff Johnson295189b2012-06-20 16:38:30 -070021261 return eSIR_HT_MIMO_PS_MAX;
21262}/*WDI_2_HAL_MIMO_PS*/
21263
21264/*Convert WDI ENC type into HAL ENC type*/
21265WPT_STATIC WPT_INLINE tAniEdType
21266WDI_2_HAL_ENC_TYPE
21267(
21268 WDI_EncryptType wdiEncType
21269)
21270{
Jeff Johnsone7245742012-09-05 17:12:55 -070021271 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021272 the chances of getting inlined*/
21273 switch ( wdiEncType )
21274 {
21275 case WDI_ENCR_NONE:
21276 return eSIR_ED_NONE;
21277
21278 case WDI_ENCR_WEP40:
21279 return eSIR_ED_WEP40;
21280
21281 case WDI_ENCR_WEP104:
21282 return eSIR_ED_WEP104;
21283
21284 case WDI_ENCR_TKIP:
21285 return eSIR_ED_TKIP;
21286
21287 case WDI_ENCR_CCMP:
21288 return eSIR_ED_CCMP;
21289
21290 case WDI_ENCR_AES_128_CMAC:
21291 return eSIR_ED_AES_128_CMAC;
21292#if defined(FEATURE_WLAN_WAPI)
21293 case WDI_ENCR_WPI:
21294 return eSIR_ED_WPI;
21295#endif
21296 default:
21297 return eSIR_ED_NOT_IMPLEMENTED;
21298 }
21299
21300}/*WDI_2_HAL_ENC_TYPE*/
21301
21302/*Convert WDI WEP type into HAL WEP type*/
21303WPT_STATIC WPT_INLINE tAniWepType
21304WDI_2_HAL_WEP_TYPE
21305(
21306 WDI_WepType wdiWEPType
21307)
21308{
Jeff Johnsone7245742012-09-05 17:12:55 -070021309 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021310 the chances of getting inlined*/
21311 switch ( wdiWEPType )
21312 {
21313 case WDI_WEP_STATIC:
21314 return eSIR_WEP_STATIC;
21315
21316 case WDI_WEP_DYNAMIC:
21317 return eSIR_WEP_DYNAMIC;
21318 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021319
Jeff Johnson295189b2012-06-20 16:38:30 -070021320 return eSIR_WEP_MAX;
21321}/*WDI_2_HAL_WEP_TYPE*/
21322
21323WPT_STATIC WPT_INLINE tSirLinkState
21324WDI_2_HAL_LINK_STATE
21325(
21326 WDI_LinkStateType wdiLinkState
21327)
21328{
Jeff Johnsone7245742012-09-05 17:12:55 -070021329 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021330 the chances of getting inlined*/
21331 switch ( wdiLinkState )
21332 {
21333 case WDI_LINK_IDLE_STATE:
21334 return eSIR_LINK_IDLE_STATE;
21335
21336 case WDI_LINK_PREASSOC_STATE:
21337 return eSIR_LINK_PREASSOC_STATE;
21338
21339 case WDI_LINK_POSTASSOC_STATE:
21340 return eSIR_LINK_POSTASSOC_STATE;
21341
21342 case WDI_LINK_AP_STATE:
21343 return eSIR_LINK_AP_STATE;
21344
21345 case WDI_LINK_IBSS_STATE:
21346 return eSIR_LINK_IBSS_STATE;
21347
21348 case WDI_LINK_BTAMP_PREASSOC_STATE:
21349 return eSIR_LINK_BTAMP_PREASSOC_STATE;
21350
21351 case WDI_LINK_BTAMP_POSTASSOC_STATE:
21352 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
21353
21354 case WDI_LINK_BTAMP_AP_STATE:
21355 return eSIR_LINK_BTAMP_AP_STATE;
21356
21357 case WDI_LINK_BTAMP_STA_STATE:
21358 return eSIR_LINK_BTAMP_STA_STATE;
21359
21360 case WDI_LINK_LEARN_STATE:
21361 return eSIR_LINK_LEARN_STATE;
21362
21363 case WDI_LINK_SCAN_STATE:
21364 return eSIR_LINK_SCAN_STATE;
21365
21366 case WDI_LINK_FINISH_SCAN_STATE:
21367 return eSIR_LINK_FINISH_SCAN_STATE;
21368
21369 case WDI_LINK_INIT_CAL_STATE:
21370 return eSIR_LINK_INIT_CAL_STATE;
21371
21372 case WDI_LINK_FINISH_CAL_STATE:
21373 return eSIR_LINK_FINISH_CAL_STATE;
21374
21375#ifdef WLAN_FEATURE_P2P
21376 case WDI_LINK_LISTEN_STATE:
21377 return eSIR_LINK_LISTEN_STATE;
21378#endif
21379
21380 default:
21381 return eSIR_LINK_MAX;
Jeff Johnsone7245742012-09-05 17:12:55 -070021382 }
Jeff Johnson295189b2012-06-20 16:38:30 -070021383}
21384
Jeff Johnsone7245742012-09-05 17:12:55 -070021385/*Translate a STA Context from WDI into HAL*/
21386WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -070021387void
21388WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -070021389(
Jeff Johnson295189b2012-06-20 16:38:30 -070021390 tConfigStaParams* phalConfigSta,
21391 WDI_ConfigStaReqInfoType* pwdiConfigSta
21392)
21393{
21394 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070021395#ifdef WLAN_FEATURE_11AC
21396 /* Get the Version 1 Handler */
21397 tConfigStaParams_V1* phalConfigSta_V1 = NULL;
21398 if (WDI_getFwWlanFeatCaps(DOT11AC))
21399 {
21400 phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta;
21401 }
21402#endif
21403 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021404 the chances of getting inlined*/
21405
Jeff Johnsone7245742012-09-05 17:12:55 -070021406 wpalMemoryCopy(phalConfigSta->bssId,
21407 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
21408
21409 wpalMemoryCopy(phalConfigSta->staMac,
21410 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070021411
21412 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
21413 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
21414 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
21415 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
21416 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
21417 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
21418 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
21419 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
21420 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
21421 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
21422 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
21423 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
21424 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
21425 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
21426 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
21427 phalConfigSta->action = pwdiConfigSta->wdiAction;
21428 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
21429 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
21430 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
21431 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
21432 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
21433 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
21434 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
Jeff Johnsone7245742012-09-05 17:12:55 -070021435
Jeff Johnson295189b2012-06-20 16:38:30 -070021436 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
21437
Jeff Johnsone7245742012-09-05 17:12:55 -070021438 phalConfigSta->supportedRates.opRateMode =
Jeff Johnson295189b2012-06-20 16:38:30 -070021439 pwdiConfigSta->wdiSupportedRates.opRateMode;
21440 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
21441 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021442 phalConfigSta->supportedRates.llbRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021443 pwdiConfigSta->wdiSupportedRates.llbRates[i];
21444 }
21445 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
21446 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021447 phalConfigSta->supportedRates.llaRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021448 pwdiConfigSta->wdiSupportedRates.llaRates[i];
21449 }
21450 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
21451 {
21452 phalConfigSta->supportedRates.aniLegacyRates[i] =
21453 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
21454 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021455 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070021456 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
21457 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
21458 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021459 phalConfigSta->supportedRates.supportedMCSSet[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021460 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
21461 }
21462 phalConfigSta->supportedRates.rxHighestDataRate =
21463 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
21464
Jeff Johnsone7245742012-09-05 17:12:55 -070021465#ifdef WLAN_FEATURE_11AC
21466 if(phalConfigSta_V1 != NULL)
21467 {
21468 phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap;
21469 phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate;
21470 phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap;
21471 phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate;
21472 }
21473#endif
21474
Jeff Johnson295189b2012-06-20 16:38:30 -070021475#ifdef WLAN_FEATURE_P2P
21476 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
21477#endif
21478
Jeff Johnsone7245742012-09-05 17:12:55 -070021479#ifdef WLAN_FEATURE_11AC
21480 if(phalConfigSta_V1 != NULL)
21481 {
21482 phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta;
21483 phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet;
21484 }
21485#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021486}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
Jeff Johnsone7245742012-09-05 17:12:55 -070021487
21488/*Translate a Rate set info from WDI into HAL*/
21489WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070021490WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -070021491(
Jeff Johnson295189b2012-06-20 16:38:30 -070021492 tSirMacRateSet* pHalRateSet,
21493 WDI_RateSet* pwdiRateSet
21494)
21495{
Jeff Johnsone7245742012-09-05 17:12:55 -070021496 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070021497 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21498
21499 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
21500 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
21501
21502 for ( i = 0; i < pHalRateSet->numRates; i++ )
21503 {
21504 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
21505 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021506
Jeff Johnson295189b2012-06-20 16:38:30 -070021507}/*WDI_CopyWDIRateSetToHALRateSet*/
21508
21509
21510/*Translate an EDCA Parameter Record from WDI into HAL*/
21511WPT_STATIC WPT_INLINE void
21512WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -070021513(
Jeff Johnson295189b2012-06-20 16:38:30 -070021514 tSirMacEdcaParamRecord* phalEdcaParam,
21515 WDI_EdcaParamRecord* pWDIEdcaParam
21516)
21517{
Jeff Johnsone7245742012-09-05 17:12:55 -070021518 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021519 the chances of getting inlined*/
21520
21521 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
21522 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
21523 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
21524 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
21525
21526 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
21527 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
21528 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
21529}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
21530
21531
21532/*Copy a management frame header from WDI fmt into HAL fmt*/
21533WPT_STATIC WPT_INLINE void
21534WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
21535(
21536 tSirMacMgmtHdr* pmacMgmtHdr,
21537 WDI_MacMgmtHdr* pwdiMacMgmtHdr
21538)
21539{
21540 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
21541 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
21542 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
21543 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
21544 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
21545 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
21546 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
21547 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
21548 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
21549 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
21550 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
21551
21552 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
21553 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
21554
Jeff Johnsone7245742012-09-05 17:12:55 -070021555 wpalMemoryCopy(pmacMgmtHdr->da,
Jeff Johnson295189b2012-06-20 16:38:30 -070021556 pwdiMacMgmtHdr->da, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021557 wpalMemoryCopy(pmacMgmtHdr->sa,
Jeff Johnson295189b2012-06-20 16:38:30 -070021558 pwdiMacMgmtHdr->sa, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021559 wpalMemoryCopy(pmacMgmtHdr->bssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070021560 pwdiMacMgmtHdr->bssId, 6);
21561
21562 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
21563 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
21564 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
21565
21566}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
21567
21568
21569/*Copy config bss parameters from WDI fmt into HAL fmt*/
21570WPT_STATIC WPT_INLINE void
21571WDI_CopyWDIConfigBSSToHALConfigBSS
21572(
21573 tConfigBssParams* phalConfigBSS,
21574 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
21575)
21576{
21577
21578 wpt_uint8 keyIndex = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070021579#ifdef WLAN_FEATURE_11AC
21580 /* Get the Version 1 Handler */
21581 tConfigBssParams_V1* phalConfigBSS_V1 = NULL;
21582 if (WDI_getFwWlanFeatCaps(DOT11AC))
21583 phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS;
21584#endif
21585
Jeff Johnson295189b2012-06-20 16:38:30 -070021586 wpalMemoryCopy( phalConfigBSS->bssId,
21587 pwdiConfigBSS->macBSSID,
21588 WDI_MAC_ADDR_LEN);
21589
21590#ifdef HAL_SELF_STA_PER_BSS
21591 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
21592 pwdiConfigBSS->macSelfAddr,
21593 WDI_MAC_ADDR_LEN);
21594#endif
21595
21596 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
21597
21598 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
21599 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
21600
Jeff Johnsone7245742012-09-05 17:12:55 -070021601 phalConfigBSS->shortSlotTimeSupported =
Jeff Johnson295189b2012-06-20 16:38:30 -070021602 pwdiConfigBSS->ucShortSlotTimeSupported;
21603 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
21604 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
21605 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
21606 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
21607 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070021608 phalConfigBSS->fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070021609 pwdiConfigBSS->ucTXOPProtectionFullSupport;
21610 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
21611 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
21612 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
21613 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
21614 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
21615 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
21616 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
21617 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
21618 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
21619 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
21620
Jeff Johnsone7245742012-09-05 17:12:55 -070021621 phalConfigBSS->htOperMode =
21622 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
Jeff Johnson295189b2012-06-20 16:38:30 -070021623
21624 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
21625 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
21626 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
21627 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
21628
21629#ifdef WLAN_FEATURE_VOWIFI
21630 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
21631#endif
21632
21633 /*! Used 32 as magic number because that is how the ssid is declared inside the
21634 hal header - hal needs a macro for it */
Jeff Johnsone7245742012-09-05 17:12:55 -070021635 phalConfigBSS->ssId.length =
Jeff Johnson295189b2012-06-20 16:38:30 -070021636 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
21637 pwdiConfigBSS->wdiSSID.ucLength : 32;
21638 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070021639 pwdiConfigBSS->wdiSSID.sSSID,
21640 phalConfigBSS->ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070021641
21642 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
21643 &pwdiConfigBSS->wdiSTAContext);
Jeff Johnsone7245742012-09-05 17:12:55 -070021644
Jeff Johnson295189b2012-06-20 16:38:30 -070021645 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
21646 &pwdiConfigBSS->wdiRateSet);
21647
21648 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21649
21650 if(phalConfigBSS->edcaParamsValid)
21651 {
21652 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21653 &pwdiConfigBSS->wdiBEEDCAParams);
21654 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21655 &pwdiConfigBSS->wdiBKEDCAParams);
21656 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21657 &pwdiConfigBSS->wdiVIEDCAParams);
21658 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21659 &pwdiConfigBSS->wdiVOEDCAParams);
21660 }
21661
Jeff Johnsone7245742012-09-05 17:12:55 -070021662 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
Jeff Johnson295189b2012-06-20 16:38:30 -070021663
21664 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21665
21666#ifdef WLAN_FEATURE_VOWIFI_11R
21667
Jeff Johnsone7245742012-09-05 17:12:55 -070021668 phalConfigBSS->extSetStaKeyParamValid =
Jeff Johnson295189b2012-06-20 16:38:30 -070021669 pwdiConfigBSS->bExtSetStaKeyParamValid;
Jeff Johnsone7245742012-09-05 17:12:55 -070021670
Jeff Johnson295189b2012-06-20 16:38:30 -070021671 if( phalConfigBSS->extSetStaKeyParamValid )
21672 {
21673 /*-----------------------------------------------------------------------
21674 Copy the STA Key parameters into the HAL message
21675 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021676 phalConfigBSS->extSetStaKeyParam.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021677 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21678
Jeff Johnsone7245742012-09-05 17:12:55 -070021679 phalConfigBSS->extSetStaKeyParam.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021680 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21681
21682 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21683
21684 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21685
21686 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21687
21688#ifdef WLAN_SOFTAP_FEATURE
21689 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21690 keyIndex++)
21691 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021692 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021693 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21694 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21695 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21696 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21697 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21698 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021699 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021700 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021701 phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021702 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021703 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021704 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21705 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021706 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021707 WDI_MAX_KEY_LENGTH);
21708 }
21709#else
Jeff Johnsone7245742012-09-05 17:12:55 -070021710 phalConfigBSS->extSetStaKeyParam.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021711 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21712 phalConfigBSS->extSetStaKeyParam.key.unicast =
21713 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21714 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21715 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21716 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021717 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021718 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021719 phalConfigBSS->extSetStaKeyParam.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021720 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021721 phalConfigBSS->extSetStaKeyParam.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021722 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21723 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021724 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021725 WDI_MAX_KEY_LENGTH);
21726#endif
21727 }
21728 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21729 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021730 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070021731 sizeof(phalConfigBSS->extSetStaKeyParam) );
21732 }
21733
21734#endif /*WLAN_FEATURE_VOWIFI_11R*/
21735
Jeff Johnsone7245742012-09-05 17:12:55 -070021736#ifdef WLAN_FEATURE_11AC
21737 if(phalConfigBSS_V1 != NULL)
21738 {
21739 phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta;
21740 phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet;
21741 }
21742#endif
21743
Jeff Johnson295189b2012-06-20 16:38:30 -070021744}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21745
21746
Jeff Johnsone7245742012-09-05 17:12:55 -070021747/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -070021748 pointed to by user data */
21749WPT_STATIC WPT_INLINE void
21750WDI_ExtractRequestCBFromEvent
21751(
21752 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -070021753 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -070021754 void** ppUserData
21755)
21756{
21757 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21758 switch ( pEvent->wdiRequest )
21759 {
21760 case WDI_START_REQ:
21761 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21762 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21763 break;
21764 case WDI_STOP_REQ:
21765 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21766 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21767 break;
21768 case WDI_INIT_SCAN_REQ:
21769 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21770 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21771 break;
21772 case WDI_START_SCAN_REQ:
21773 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21774 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21775 break;
21776 case WDI_END_SCAN_REQ:
21777 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21778 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21779 break;
21780 case WDI_FINISH_SCAN_REQ:
21781 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21782 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21783 break;
21784 case WDI_JOIN_REQ:
21785 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21786 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21787 break;
21788 case WDI_CONFIG_BSS_REQ:
21789 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21790 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21791 break;
21792 case WDI_DEL_BSS_REQ:
21793 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21794 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21795 break;
21796 case WDI_POST_ASSOC_REQ:
21797 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21798 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21799 break;
21800 case WDI_DEL_STA_REQ:
21801 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21802 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21803 break;
21804 case WDI_DEL_STA_SELF_REQ:
21805 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21806 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21807 break;
21808
21809 case WDI_SET_BSS_KEY_REQ:
21810 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21811 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21812 break;
21813 case WDI_RMV_BSS_KEY_REQ:
21814 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21815 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21816 break;
21817 case WDI_SET_STA_KEY_REQ:
21818 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21819 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21820 break;
21821 case WDI_RMV_STA_KEY_REQ:
21822 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21823 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21824 break;
21825 case WDI_ADD_TS_REQ:
21826 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21827 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21828 break;
21829 case WDI_DEL_TS_REQ:
21830 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21831 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21832 break;
21833 case WDI_UPD_EDCA_PRMS_REQ:
21834 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21835 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21836 break;
21837 case WDI_ADD_BA_SESSION_REQ:
21838 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21839 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21840 break;
21841 case WDI_DEL_BA_REQ:
21842 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21843 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21844 break;
21845#ifdef FEATURE_WLAN_CCX
21846 case WDI_TSM_STATS_REQ:
21847 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21848 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21849 break;
21850#endif
21851 case WDI_CH_SWITCH_REQ:
21852 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21853 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21854 break;
21855 case WDI_CONFIG_STA_REQ:
21856 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21857 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21858 break;
21859 case WDI_SET_LINK_ST_REQ:
21860 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21861 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21862 break;
21863 case WDI_GET_STATS_REQ:
21864 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21865 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21866 break;
21867 case WDI_UPDATE_CFG_REQ:
21868 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21869 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21870 break;
21871 case WDI_ADD_BA_REQ:
21872 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21873 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21874 break;
21875 case WDI_TRIGGER_BA_REQ:
21876 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21877 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21878 break;
21879 case WDI_UPD_BCON_PRMS_REQ:
21880 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21881 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21882 break;
21883 case WDI_SND_BCON_REQ:
21884 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21885 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21886 break;
21887 case WDI_ENTER_BMPS_REQ:
21888 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21889 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21890 break;
21891 case WDI_EXIT_BMPS_REQ:
21892 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21893 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21894 break;
21895 case WDI_ENTER_UAPSD_REQ:
21896 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21897 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21898 break;
21899 case WDI_UPDATE_UAPSD_PARAM_REQ:
21900 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21901 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21902 break;
21903 case WDI_CONFIGURE_RXP_FILTER_REQ:
21904 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21905 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21906 break;
21907 case WDI_SET_BEACON_FILTER_REQ:
21908 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21909 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21910 break;
21911 case WDI_REM_BEACON_FILTER_REQ:
21912 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21913 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070021914 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021915 case WDI_SET_RSSI_THRESHOLDS_REQ:
21916 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21917 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21918 break;
21919 case WDI_HOST_OFFLOAD_REQ:
21920 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21921 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21922 break;
21923 case WDI_WOWL_ADD_BC_PTRN_REQ:
21924 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21925 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21926 break;
21927 case WDI_WOWL_DEL_BC_PTRN_REQ:
21928 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21929 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21930 break;
21931 case WDI_WOWL_ENTER_REQ:
21932 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21933 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21934 break;
21935 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21936 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21937 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21938 break;
21939 case WDI_FLUSH_AC_REQ:
21940 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21941 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21942 break;
21943 case WDI_BTAMP_EVENT_REQ:
21944 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21945 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21946 break;
21947 case WDI_KEEP_ALIVE_REQ:
21948 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21949 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21950 break;
21951 case WDI_SET_TX_PER_TRACKING_REQ:
21952 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21953 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21954 default:
21955 *ppfnReqCB = NULL;
21956 *ppUserData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070021957 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021958 }
21959}/*WDI_ExtractRequestCBFromEvent*/
21960
21961
21962/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021963 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
Jeff Johnson295189b2012-06-20 16:38:30 -070021964 frame xtl is enabled for a particular STA.
21965
21966 WDI_PostAssocReq must have been called.
21967
Jeff Johnsone7245742012-09-05 17:12:55 -070021968 @param uSTAIdx: STA index
21969
Jeff Johnson295189b2012-06-20 16:38:30 -070021970 @see WDI_PostAssocReq
21971 @return Result of the function call
21972*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021973wpt_boolean
Jeff Johnson295189b2012-06-20 16:38:30 -070021974WDI_IsHwFrameTxTranslationCapable
21975(
21976 wpt_uint8 uSTAIdx
21977)
21978{
Jeff Johnsone7245742012-09-05 17:12:55 -070021979 /*!! FIX ME - this must eventually be per station - for now just feedback
Jeff Johnson295189b2012-06-20 16:38:30 -070021980 uma value*/
21981 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070021982 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070021983 ------------------------------------------------------------------------*/
21984 if ( eWLAN_PAL_FALSE == gWDIInitialized )
21985 {
21986 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
21987 "WDI API call before module is initialized - Fail request");
21988
Jeff Johnsone7245742012-09-05 17:12:55 -070021989 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021990 }
21991
Jeff Johnsone7245742012-09-05 17:12:55 -070021992
Jeff Johnson295189b2012-06-20 16:38:30 -070021993 return gWDICb.bFrameTransEnabled;
21994}/*WDI_IsHwFrameTxTranslationCapable*/
21995
21996#ifdef FEATURE_WLAN_SCAN_PNO
21997/**
21998 @brief WDI_SetPreferredNetworkList
21999
Jeff Johnsone7245742012-09-05 17:12:55 -070022000 @param pwdiPNOScanReqParams: the Set PNO as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070022001 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070022002
Jeff Johnson295189b2012-06-20 16:38:30 -070022003 wdiPNOScanCb: callback for passing back the response
22004 of the Set PNO operation received from the
22005 device
Jeff Johnsone7245742012-09-05 17:12:55 -070022006
Jeff Johnson295189b2012-06-20 16:38:30 -070022007 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070022008 callback
22009
Jeff Johnson295189b2012-06-20 16:38:30 -070022010 @return Result of the function call
22011*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022012WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022013WDI_SetPreferredNetworkReq
22014(
22015 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22016 WDI_PNOScanCb wdiPNOScanCb,
22017 void* pUserData
22018)
22019{
22020 WDI_EventInfoType wdiEventData = {{0}};
22021 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22022
22023 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022024 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022025 ------------------------------------------------------------------------*/
22026 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22027 {
22028 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22029 "WDI API call before module is initialized - Fail request");
22030
Jeff Johnsone7245742012-09-05 17:12:55 -070022031 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022032 }
22033
22034 /*------------------------------------------------------------------------
22035 Fill in Event data and post to the Main FSM
22036 ------------------------------------------------------------------------*/
22037 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022038 wdiEventData.pEventData = pwdiPNOScanReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022039 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070022040 wdiEventData.pCBfnc = wdiPNOScanCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070022041 wdiEventData.pUserData = pUserData;
22042
22043 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22044}
22045
22046
22047/**
22048 @brief WDI_SetRssiFilterReq
22049
Jeff Johnsone7245742012-09-05 17:12:55 -070022050 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
Jeff Johnson295189b2012-06-20 16:38:30 -070022051 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070022052
Jeff Johnson295189b2012-06-20 16:38:30 -070022053 wdiRssiFilterCb: callback for passing back the response
22054 of the Set RSSI Filter operation received from the
22055 device
Jeff Johnsone7245742012-09-05 17:12:55 -070022056
Jeff Johnson295189b2012-06-20 16:38:30 -070022057 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070022058 callback
22059
Jeff Johnson295189b2012-06-20 16:38:30 -070022060 @return Result of the function call
22061*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022062WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022063WDI_SetRssiFilterReq
22064(
22065 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
22066 WDI_RssiFilterCb wdiRssiFilterCb,
22067 void* pUserData
22068)
22069{
22070 WDI_EventInfoType wdiEventData = {{0}};
22071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22072
22073 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022074 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022075 ------------------------------------------------------------------------*/
22076 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22077 {
22078 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22079 "WDI API call before module is initialized - Fail request");
22080
Jeff Johnsone7245742012-09-05 17:12:55 -070022081 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022082 }
22083
22084 /*------------------------------------------------------------------------
22085 Fill in Event data and post to the Main FSM
22086 ------------------------------------------------------------------------*/
22087 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022088 wdiEventData.pEventData = pwdiRssiFilterReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022089 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070022090 wdiEventData.pCBfnc = wdiRssiFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070022091 wdiEventData.pUserData = pUserData;
22092
22093 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22094}/*WDI_SetRssiFilterReq*/
22095
22096/**
22097 @brief WDI_UpdateScanParamsReq
22098
Jeff Johnsone7245742012-09-05 17:12:55 -070022099 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070022100 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070022101
Jeff Johnson295189b2012-06-20 16:38:30 -070022102 wdiUpdateScanParamsCb: callback for passing back the response
22103 of the Set PNO operation received from the
22104 device
Jeff Johnsone7245742012-09-05 17:12:55 -070022105
Jeff Johnson295189b2012-06-20 16:38:30 -070022106 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070022107 callback
22108
Jeff Johnson295189b2012-06-20 16:38:30 -070022109 @return Result of the function call
22110*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022111WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022112WDI_UpdateScanParamsReq
22113(
22114 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
22115 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
22116 void* pUserData
22117)
22118{
22119 WDI_EventInfoType wdiEventData = {{0}};
22120 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22121
22122 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022123 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022124 ------------------------------------------------------------------------*/
22125 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22126 {
22127 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22128 "WDI API call before module is initialized - Fail request");
22129
Jeff Johnsone7245742012-09-05 17:12:55 -070022130 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022131 }
22132
22133 /*------------------------------------------------------------------------
22134 Fill in Event data and post to the Main FSM
22135 ------------------------------------------------------------------------*/
22136 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022137 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022138 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
Jeff Johnsone7245742012-09-05 17:12:55 -070022139 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070022140 wdiEventData.pUserData = pUserData;
22141
22142 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22143}
22144
22145/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022146 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022147 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022148
22149 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022150 pwdiPNOScanReqParams: pointer to the info received
22151 from upper layers
22152 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022153 and its size
22154
Jeff Johnson295189b2012-06-20 16:38:30 -070022155 @return Result of the function call
22156*/
22157
22158WDI_Status
22159WDI_PackPreferredNetworkList
22160(
22161 WDI_ControlBlockType* pWDICtx,
22162 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22163 wpt_uint8** ppSendBuffer,
22164 wpt_uint16* pSize
22165)
22166{
Jeff Johnsone7245742012-09-05 17:12:55 -070022167 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022168 wpt_uint16 usDataOffset = 0;
22169 wpt_uint16 usSendSize = 0;
22170 tPrefNetwListParams pPrefNetwListParams = {0};
22171 wpt_uint8 i;
22172 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
22173
22174 /*-----------------------------------------------------------------------
22175 Get message buffer
22176 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022177 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022178 sizeof(pPrefNetwListParams),
22179 &pSendBuffer, &usDataOffset, &usSendSize))||
22180 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
22181 {
22182 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22183 "Unable to get send buffer in Set PNO req %x ",
22184 pwdiPNOScanReqParams);
22185 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022186 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022187 }
22188
22189 /*-------------------------------------------------------------------------
22190 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22191 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022192 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022193 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070022194 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022195 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22196
Jeff Johnsone7245742012-09-05 17:12:55 -070022197 pPrefNetwListParams.ucNetworksCount =
22198 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022199 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022200 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022201 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22202
22203 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022204 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022205 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22206 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22207 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22208
22209 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22210 {
22211 /*SSID of the BSS*/
22212 pPrefNetwListParams.aNetworks[i].ssId.length
22213 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22214
22215 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22216 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22217 pPrefNetwListParams.aNetworks[i].ssId.length);
22218
22219 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022220 pPrefNetwListParams.aNetworks[i].authentication =
22221 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022222
22223 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022224 pPrefNetwListParams.aNetworks[i].encryption =
22225 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022226
Jeff Johnsone7245742012-09-05 17:12:55 -070022227 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022228 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022229 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022230 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22231
22232 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22233 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22234 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22235
22236 /*Indicates the RSSI threshold for the network to be considered*/
22237 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22238 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22239
22240 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022241 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022242 pPrefNetwListParams.aNetworks[i].ssId.length,
22243 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22244 }
22245
Jeff Johnsone7245742012-09-05 17:12:55 -070022246 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22247 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022248 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22249 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22250 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22251
22252 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022253 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022254 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22255 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22256 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22257
22258 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22259 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022260 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022261 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022262 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022263 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22264 }
22265
22266 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022267 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022268 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22269 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22270 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022271 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022272
Jeff Johnsone7245742012-09-05 17:12:55 -070022273 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22274 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22275 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022276
Jeff Johnsone7245742012-09-05 17:12:55 -070022277 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022278 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22279 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22280 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022281 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022282
Jeff Johnsone7245742012-09-05 17:12:55 -070022283 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22284 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22285 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022286
22287 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022288 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22289 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022290
22291 /*Set the output values*/
22292 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022293 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022294
22295 return WDI_STATUS_SUCCESS;
22296}/*WDI_PackPreferredNetworkList*/
22297
22298/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022299 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022300 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022301
22302 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022303 pwdiPNOScanReqParams: pointer to the info received
22304 from upper layers
22305 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022306 and its size
22307
Jeff Johnson295189b2012-06-20 16:38:30 -070022308 @return Result of the function call
22309*/
22310
22311WDI_Status
22312WDI_PackPreferredNetworkListNew
22313(
22314 WDI_ControlBlockType* pWDICtx,
22315 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22316 wpt_uint8** ppSendBuffer,
22317 wpt_uint16* pSize
22318)
22319{
Jeff Johnsone7245742012-09-05 17:12:55 -070022320 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022321 wpt_uint16 usDataOffset = 0;
22322 wpt_uint16 usSendSize = 0;
22323 tPrefNetwListParamsNew pPrefNetwListParams;
22324 wpt_uint8 i;
22325 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
22326
22327 /*-----------------------------------------------------------------------
22328 Get message buffer
22329 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022330 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022331 sizeof(pPrefNetwListParams),
22332 &pSendBuffer, &usDataOffset, &usSendSize))||
22333 ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) )))
22334 {
22335 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22336 "Unable to get send buffer in Set PNO req %x ",
22337 pwdiPNOScanReqParams);
22338 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022339 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022340 }
22341
22342 /*-------------------------------------------------------------------------
22343 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22344 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022345 pPrefNetwListParams.enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022346 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070022347 pPrefNetwListParams.modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022348 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22349
Jeff Johnsone7245742012-09-05 17:12:55 -070022350 pPrefNetwListParams.ucNetworksCount =
22351 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022352 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022353 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022354 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22355
22356 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022357 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022358 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22359 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22360 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22361
22362 for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ )
22363 {
22364 /*SSID of the BSS*/
22365 pPrefNetwListParams.aNetworks[i].ssId.length
22366 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22367
22368 wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId,
22369 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
22370 pPrefNetwListParams.aNetworks[i].ssId.length);
22371
22372 /*Authentication type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022373 pPrefNetwListParams.aNetworks[i].authentication =
22374 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022375
22376 /*Encryption type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022377 pPrefNetwListParams.aNetworks[i].encryption =
22378 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022379
22380 /*SSID bcast type for the network*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022381 pPrefNetwListParams.aNetworks[i].bcastNetworkType =
22382 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022383
Jeff Johnsone7245742012-09-05 17:12:55 -070022384 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022385 0 - if all channels */
Jeff Johnsone7245742012-09-05 17:12:55 -070022386 pPrefNetwListParams.aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022387 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22388
22389 wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels,
22390 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
22391 pPrefNetwListParams.aNetworks[i].ucChannelCount);
22392
22393 /*Indicates the RSSI threshold for the network to be considered*/
22394 pPrefNetwListParams.aNetworks[i].rssiThreshold =
22395 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22396
22397 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022398 "WDI SET PNO: SSID %d %s",
Jeff Johnson295189b2012-06-20 16:38:30 -070022399 pPrefNetwListParams.aNetworks[i].ssId.length,
22400 pPrefNetwListParams.aNetworks[i].ssId.ssId);
22401 }
22402
Jeff Johnsone7245742012-09-05 17:12:55 -070022403 pPrefNetwListParams.scanTimers.ucScanTimersCount =
22404 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022405 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22406 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22407 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22408
22409 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022410 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022411 pPrefNetwListParams.scanTimers.ucScanTimersCount,
22412 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22413 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22414
22415 for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ )
22416 {
Jeff Johnsone7245742012-09-05 17:12:55 -070022417 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022418 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Jeff Johnsone7245742012-09-05 17:12:55 -070022419 pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022420 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22421 }
22422
22423 /*Copy the probe template*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022424 pPrefNetwListParams.us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022425 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22426 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22427 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022428 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022429
Jeff Johnsone7245742012-09-05 17:12:55 -070022430 wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate,
22431 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
22432 pPrefNetwListParams.us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022433
Jeff Johnsone7245742012-09-05 17:12:55 -070022434 pPrefNetwListParams.us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022435 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22436 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22437 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022438 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022439
Jeff Johnsone7245742012-09-05 17:12:55 -070022440 wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate,
22441 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
22442 pPrefNetwListParams.us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022443
22444 /*Pack the buffer*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022445 wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams,
22446 sizeof(pPrefNetwListParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022447
22448 /*Set the output values*/
22449 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022450 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022451
22452 return WDI_STATUS_SUCCESS;
22453}/*WDI_PackPreferredNetworkListNew*/
22454
22455/**
22456 @brief Process Set Preferred Network List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022457
22458 @param pWDICtx: pointer to the WLAN DAL context
22459 pEventData: pointer to the event information structure
22460
Jeff Johnson295189b2012-06-20 16:38:30 -070022461 @return Result of the function call
22462*/
22463WDI_Status
22464WDI_ProcessSetPreferredNetworkReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022465(
Jeff Johnson295189b2012-06-20 16:38:30 -070022466 WDI_ControlBlockType* pWDICtx,
22467 WDI_EventInfoType* pEventData
22468)
22469{
22470 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
22471 WDI_PNOScanCb wdiPNOScanCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022472 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022473 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070022474 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022475
22476 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022477 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022478 -------------------------------------------------------------------------*/
22479 if (( NULL == pEventData ) ||
22480 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
22481 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
22482 {
22483 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22484 "%s: Invalid parameters", __FUNCTION__);
22485 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022486 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022487 }
22488
22489 /*-------------------------------------------------------------------------
22490 Pack the PNO request structure based on version
22491 -------------------------------------------------------------------------*/
22492 if ( pWDICtx->wdiPNOVersion > 0 )
22493 {
22494 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022495 "%s: PNO new version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022496 pWDICtx->wdiPNOVersion);
22497
22498 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
22499 &pSendBuffer, &usSendSize);
22500 }
22501 else
22502 {
22503 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022504 "%s: PNO old version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022505 pWDICtx->wdiPNOVersion);
22506
22507 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
22508 &pSendBuffer, &usSendSize);
22509 }
22510
22511 if (( WDI_STATUS_SUCCESS != wdiStatus )||
22512 ( NULL == pSendBuffer )||( 0 == usSendSize ))
22513 {
22514 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22515 "%s: failed to pack request parameters", __FUNCTION__);
22516 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022517 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022518 }
22519
22520 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022521 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022522
22523 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022524 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022525 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022526 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22527 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022528}
22529
22530/**
22531 @brief Process Set RSSI Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022532
22533 @param pWDICtx: pointer to the WLAN DAL context
22534 pEventData: pointer to the event information structure
22535
Jeff Johnson295189b2012-06-20 16:38:30 -070022536 @see
22537 @return Result of the function call
22538*/
22539WDI_Status
22540WDI_ProcessSetRssiFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022541(
Jeff Johnson295189b2012-06-20 16:38:30 -070022542 WDI_ControlBlockType* pWDICtx,
22543 WDI_EventInfoType* pEventData
22544)
22545{
22546 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
22547 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022548 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022549 wpt_uint16 usDataOffset = 0;
22550 wpt_uint16 usSendSize = 0;
22551 wpt_uint8 ucRssiThreshold;
22552
22553 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022554 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022555 -------------------------------------------------------------------------*/
22556 if (( NULL == pEventData ) ||
22557 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
22558 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
22559 {
22560 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22561 "%s: Invalid parameters", __FUNCTION__);
22562 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022563 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022564 }
22565
22566 /*-----------------------------------------------------------------------
22567 Get message buffer
22568 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022569 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022570 sizeof(ucRssiThreshold),
22571 &pSendBuffer, &usDataOffset, &usSendSize))||
22572 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
22573 {
22574 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22575 "Unable to get send buffer in Set PNO req %x %x %x",
22576 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
22577 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022578 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022579 }
22580
22581 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
22582
Jeff Johnsone7245742012-09-05 17:12:55 -070022583 wpalMemoryCopy( pSendBuffer+usDataOffset,
22584 &ucRssiThreshold,
22585 sizeof(ucRssiThreshold));
Jeff Johnson295189b2012-06-20 16:38:30 -070022586
22587 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022588 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022589
22590 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022591 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022592 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022593 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22594 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022595}
22596
22597
22598/**
22599 @brief Process Update Scan Params function
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_ProcessUpdateScanParamsReq
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_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
22615 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022616 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022617 wpt_uint16 usDataOffset = 0;
22618 wpt_uint16 usSendSize = 0;
22619 tUpdateScanParams updateScanParams = {0};
22620
22621
22622 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022623 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022624 -------------------------------------------------------------------------*/
22625 if (( NULL == pEventData ) ||
22626 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
22627 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
22628 {
22629 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22630 "%s: Invalid parameters", __FUNCTION__);
22631 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022632 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022633 }
22634
22635 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22636 "Begin WDI Update Scan Parameters");
22637 /*-----------------------------------------------------------------------
22638 Get message buffer
22639 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022640 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022641 sizeof(updateScanParams),
22642 &pSendBuffer, &usDataOffset, &usSendSize))||
22643 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
22644 {
22645 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22646 "Unable to get send buffer in Update Scan Params req %x %x %x",
22647 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
22648 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022649 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022650 }
22651
22652 //
22653 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
22654 //
22655
22656 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22657 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
Jeff Johnsone7245742012-09-05 17:12:55 -070022658 updateScanParams.ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022659 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22660 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22661 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22662 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22663
Jeff Johnsone7245742012-09-05 17:12:55 -070022664 wpalMemoryCopy( updateScanParams.aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022665 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22666 updateScanParams.ucChannelCount);
22667
22668 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22669 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22670 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22671 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22672 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22673
Jeff Johnsone7245742012-09-05 17:12:55 -070022674 wpalMemoryCopy( pSendBuffer+usDataOffset,
22675 &updateScanParams,
22676 sizeof(updateScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022677
22678 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022679 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022680
22681 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22682 "End Update Scan Parameters");
22683 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022684 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022685 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022686 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22687 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022688}
22689
22690/**
22691 @brief Process Preferred Network Found Indication function
Jeff Johnsone7245742012-09-05 17:12:55 -070022692
22693 @param pWDICtx: pointer to the WLAN DAL context
22694 pEventData: pointer to the event information structure
22695
Jeff Johnson295189b2012-06-20 16:38:30 -070022696 @see
22697 @return Result of the function call
22698*/
22699WDI_Status
22700WDI_ProcessPrefNetworkFoundInd
Jeff Johnsone7245742012-09-05 17:12:55 -070022701(
Jeff Johnson295189b2012-06-20 16:38:30 -070022702 WDI_ControlBlockType* pWDICtx,
22703 WDI_EventInfoType* pEventData
22704)
22705{
22706 WDI_LowLevelIndType wdiInd;
22707 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22708
22709
22710 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022711 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022712 -------------------------------------------------------------------------*/
22713 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22714 ( NULL == pEventData->pEventData ))
22715 {
22716 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22717 "%s: Invalid parameters", __FUNCTION__);
22718 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070022719 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022720 }
22721
22722 /*-------------------------------------------------------------------------
22723 Extract indication and send it to UMAC
22724 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022725 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22726 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022727 sizeof(tPrefNetwFoundParams));
22728
22729 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022730 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070022731
22732 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22733
Jeff Johnsone7245742012-09-05 17:12:55 -070022734 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070022735 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
Jeff Johnsone7245742012-09-05 17:12:55 -070022736 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
Jeff Johnson295189b2012-06-20 16:38:30 -070022737
Jeff Johnsone7245742012-09-05 17:12:55 -070022738 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22739 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022740 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22741
22742 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22743 prefNetwFoundInd.prefNetwFoundParams.rssi;
22744
22745 // DEBUG
22746 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22747 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22748 wdiInd.wdiIndicationType,
22749 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22750 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22751
22752 /*Notify UMAC*/
22753 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070022754
22755 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022756}
22757
22758/**
22759 @brief Process PNO Rsp function (called when a
22760 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022761
22762 @param pWDICtx: pointer to the WLAN DAL context
22763 pEventData: pointer to the event information structure
22764
Jeff Johnson295189b2012-06-20 16:38:30 -070022765 @see
22766 @return Result of the function call
22767*/
22768WDI_Status
22769WDI_ProcessSetPreferredNetworkRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022770(
Jeff Johnson295189b2012-06-20 16:38:30 -070022771 WDI_ControlBlockType* pWDICtx,
22772 WDI_EventInfoType* pEventData
22773)
22774{
22775 WDI_Status wdiStatus;
22776 eHalStatus halStatus;
22777 WDI_PNOScanCb wdiPNOScanCb = NULL;
22778 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22779
22780 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022781 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022782 -------------------------------------------------------------------------*/
22783 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22784 ( NULL == pEventData->pEventData ))
22785 {
22786 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22787 "%s: Invalid parameters", __FUNCTION__);
22788 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022789 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022790 }
22791
22792
Jeff Johnsone7245742012-09-05 17:12:55 -070022793 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022794
22795 /*-------------------------------------------------------------------------
22796 Extract response and send it to UMAC
22797 -------------------------------------------------------------------------*/
22798 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022799 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022800
22801 /*Notify UMAC*/
22802 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22803
Jeff Johnsone7245742012-09-05 17:12:55 -070022804 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022805}/*WDI_ProcessSetPreferredNetworkRsp*/
22806
22807/**
22808 @brief Process RSSI Filter Rsp function (called when a
22809 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022810
22811 @param pWDICtx: pointer to the WLAN DAL context
22812 pEventData: pointer to the event information structure
22813
Jeff Johnson295189b2012-06-20 16:38:30 -070022814 @see
22815 @return Result of the function call
22816*/
22817WDI_Status
22818WDI_ProcessSetRssiFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022819(
Jeff Johnson295189b2012-06-20 16:38:30 -070022820 WDI_ControlBlockType* pWDICtx,
22821 WDI_EventInfoType* pEventData
22822)
22823{
22824 WDI_Status wdiStatus;
22825 eHalStatus halStatus;
22826 WDI_RssiFilterCb wdiRssiFilterCb;
22827 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22828
22829 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022830 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022831 -------------------------------------------------------------------------*/
22832 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22833 ( NULL == pEventData->pEventData ))
22834 {
22835 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22836 "%s: Invalid parameters", __FUNCTION__);
22837 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022838 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022839 }
22840
Jeff Johnsone7245742012-09-05 17:12:55 -070022841 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022842
22843 /*-------------------------------------------------------------------------
22844 Extract response and send it to UMAC
22845 -------------------------------------------------------------------------*/
22846 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022847 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022848
22849 /*Notify UMAC*/
22850 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22851
Jeff Johnsone7245742012-09-05 17:12:55 -070022852 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022853}/*WDI_ProcessSetRssiFilterRsp*/
22854
22855/**
22856 @brief Process Update Scan Params Rsp function (called when a
22857 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022858
22859 @param pWDICtx: pointer to the WLAN DAL context
22860 pEventData: pointer to the event information structure
22861
Jeff Johnson295189b2012-06-20 16:38:30 -070022862 @see
22863 @return Result of the function call
22864*/
22865WDI_Status
22866WDI_ProcessUpdateScanParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022867(
Jeff Johnson295189b2012-06-20 16:38:30 -070022868 WDI_ControlBlockType* pWDICtx,
22869 WDI_EventInfoType* pEventData
22870)
22871{
22872 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070022873 tUpdateScanParamsResp halUpdScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022874 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022875 wpt_uint32 uStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022876 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22877
22878 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022879 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022880 -------------------------------------------------------------------------*/
22881 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22882 ( NULL == pEventData->pEventData ))
22883 {
22884 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22885 "%s: Invalid parameters", __FUNCTION__);
22886 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022887 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022888 }
22889
22890 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22891 "Process UPD scan params ptr : %x", __FUNCTION__);
22892
Jeff Johnsone7245742012-09-05 17:12:55 -070022893 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022894
22895 /*-------------------------------------------------------------------------
22896 Extract response and send it to UMAC
22897 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022898 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22899 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022900 sizeof(halUpdScanParams.status));
22901
22902 uStatus = halUpdScanParams.status;
22903
22904 /*Extract PNO version - 1st bit of the status */
Jeff Johnsone7245742012-09-05 17:12:55 -070022905 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
Jeff Johnson295189b2012-06-20 16:38:30 -070022906
22907 /*Remove version bit*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022908 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
Jeff Johnson295189b2012-06-20 16:38:30 -070022909
Jeff Johnsone7245742012-09-05 17:12:55 -070022910 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022911
22912 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022913 "UPD Scan Parameters rsp with status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022914 halUpdScanParams.status);
22915
22916 /*Notify UMAC*/
22917 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22918
Jeff Johnsone7245742012-09-05 17:12:55 -070022919 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022920}
22921#endif // FEATURE_WLAN_SCAN_PNO
22922
22923#ifdef WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -070022924WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022925WDI_8023MulticastListReq
22926(
22927 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22928 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22929 void* pUserData
22930)
22931{
22932 WDI_EventInfoType wdiEventData;
22933 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22934
22935 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22936 "%s", __FUNCTION__);
22937
22938 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022939 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022940 ------------------------------------------------------------------------*/
22941 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22942 {
22943 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22944 "WDI API call before module is initialized - Fail request");
22945
Jeff Johnsone7245742012-09-05 17:12:55 -070022946 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022947 }
22948
22949 /*------------------------------------------------------------------------
22950 Fill in Event data and post to the Main FSM
22951 ------------------------------------------------------------------------*/
22952 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022953 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022954 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022955 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022956 wdiEventData.pUserData = pUserData;
22957
22958 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22959}
22960
Jeff Johnsone7245742012-09-05 17:12:55 -070022961WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022962WDI_ReceiveFilterSetFilterReq
22963(
22964 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22965 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22966 void* pUserData
22967)
22968{
22969 WDI_EventInfoType wdiEventData;
22970 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22971
22972 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22973 "%s",__FUNCTION__);
22974
22975 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022976 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022977 ------------------------------------------------------------------------*/
22978 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22979 {
22980 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22981 "WDI API call before module is initialized - Fail request");
22982
Jeff Johnsone7245742012-09-05 17:12:55 -070022983 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022984 }
22985
22986 /*------------------------------------------------------------------------
22987 Fill in Event data and post to the Main FSM
22988 ------------------------------------------------------------------------*/
22989 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022990 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
22991 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
22992 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
Jeff Johnson295189b2012-06-20 16:38:30 -070022993 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
Jeff Johnsone7245742012-09-05 17:12:55 -070022994 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022995 wdiEventData.pUserData = pUserData;
22996
22997
22998 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22999}
23000
Jeff Johnsone7245742012-09-05 17:12:55 -070023001WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023002WDI_FilterMatchCountReq
23003(
23004 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
23005 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
23006 void* pUserData
23007)
23008{
23009 WDI_EventInfoType wdiEventData;
23010 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23011
23012 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23013 "%s",__FUNCTION__);
23014
23015 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023016 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023017 ------------------------------------------------------------------------*/
23018 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23019 {
23020 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23021 "WDI API call before module is initialized - Fail request");
23022
Jeff Johnsone7245742012-09-05 17:12:55 -070023023 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023024 }
23025
23026 /*------------------------------------------------------------------------
23027 Fill in Event data and post to the Main FSM
23028 ------------------------------------------------------------------------*/
23029 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023030 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023031 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070023032 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070023033 wdiEventData.pUserData = pUserData;
23034
23035
23036 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23037}
23038
Jeff Johnsone7245742012-09-05 17:12:55 -070023039WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023040WDI_ReceiveFilterClearFilterReq
23041(
23042 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
23043 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
23044 void* pUserData
23045)
23046{
23047 WDI_EventInfoType wdiEventData;
23048 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23049
23050 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23051 "%s",__FUNCTION__);
23052
23053 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023054 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023055 ------------------------------------------------------------------------*/
23056 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23057 {
23058 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23059 "WDI API call before module is initialized - Fail request");
23060
Jeff Johnsone7245742012-09-05 17:12:55 -070023061 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023062 }
23063
23064 /*------------------------------------------------------------------------
23065 Fill in Event data and post to the Main FSM
23066 ------------------------------------------------------------------------*/
23067 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023068 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023069 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070023070 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070023071 wdiEventData.pUserData = pUserData;
23072
23073
23074 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23075}
23076
23077/**
23078 @brief Process 8023 Multicast List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023079
23080 @param pWDICtx: pointer to the WLAN DAL context
23081 pEventData: pointer to the event information structure
23082
Jeff Johnson295189b2012-06-20 16:38:30 -070023083 @see
23084 @return Result of the function call
23085*/
23086WDI_Status
23087WDI_Process8023MulticastListReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023088(
Jeff Johnson295189b2012-06-20 16:38:30 -070023089 WDI_ControlBlockType* pWDICtx,
23090 WDI_EventInfoType* pEventData
23091)
23092{
23093 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
23094 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023095 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023096 wpt_uint16 usDataOffset = 0;
23097 wpt_uint16 usSendSize = 0;
23098 tHalRcvFltMcAddrListType rcvFltMcAddrListType;
23099 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070023100 wpt_uint8 ucCurrentBSSSesIdx = 0;
23101 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023102
23103 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23104 "%s",__FUNCTION__);
23105
23106 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023107 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023108 -------------------------------------------------------------------------*/
23109 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023110 ( NULL == (pwdiFltPktSetMcListReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023111 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023112 ( NULL == (wdi8023MulticastListCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023113 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
23114 {
23115 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23116 "%s: Invalid parameters", __FUNCTION__);
23117 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023118 return WDI_STATUS_E_FAILURE;
23119 }
23120
23121 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23122 pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId,
23123 &pBSSSes);
23124 if ( NULL == pBSSSes )
23125 {
23126 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23127 " %s : Association for this BSSID does not exist",__FUNCTION__);
23128 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023129 }
23130
23131 /*-----------------------------------------------------------------------
23132 Get message buffer
23133 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023134 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23135 WDI_8023_MULTICAST_LIST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023136 sizeof(tHalRcvFltMcAddrListType),
23137 &pSendBuffer, &usDataOffset, &usSendSize))||
23138 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
23139 {
23140 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23141 "Unable to get send buffer in "
23142 "WDI_Process8023MulticastListReq() %x %x %x",
23143 pEventData, pwdiFltPktSetMcListReqParamsType,
23144 wdi8023MulticastListCb);
23145 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023146 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023147 }
23148
Jeff Johnsone7245742012-09-05 17:12:55 -070023149 rcvFltMcAddrListType.cMulticastAddr =
23150 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
Jeff Johnson295189b2012-06-20 16:38:30 -070023151 for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ )
23152 {
23153 wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i],
23154 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
23155 sizeof(tSirMacAddr));
23156 }
23157
Jeff Johnsone7245742012-09-05 17:12:55 -070023158 rcvFltMcAddrListType.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070023159 wpalMemoryCopy( pSendBuffer+usDataOffset,
23160 &rcvFltMcAddrListType,
23161 sizeof(rcvFltMcAddrListType));
23162
23163 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023164 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023165
23166
23167 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023168 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023169 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023170 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023171 wdi8023MulticastListCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023172 WDI_8023_MULTICAST_LIST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023173}
23174
23175/**
23176 @brief Process Receive Filter Set Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023177
23178 @param pWDICtx: pointer to the WLAN DAL context
23179 pEventData: pointer to the event information structure
23180
Jeff Johnson295189b2012-06-20 16:38:30 -070023181 @see
23182 @return Result of the function call
23183*/
23184WDI_Status
23185WDI_ProcessReceiveFilterSetFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023186(
Jeff Johnson295189b2012-06-20 16:38:30 -070023187 WDI_ControlBlockType* pWDICtx,
23188 WDI_EventInfoType* pEventData
23189)
23190{
23191 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
23192 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023193 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023194 wpt_uint16 usDataOffset = 0;
23195 wpt_uint16 usSendSize = 0;
23196 wpt_uint32 usRcvPktFilterCfgSize;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023197 tHalRcvPktFilterCfgType *pRcvPktFilterCfg = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023198 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070023199 wpt_uint8 ucCurrentBSSSesIdx = 0;
23200 WDI_BSSSessionType* pBSSSes = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023201 tHalSessionizedRcvPktFilterCfgType *pSessRcvPktFilterCfg = NULL;
23202 wpt_uint32 usSessRcvPktFilterCfgSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070023203
23204 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23205 "%s",__FUNCTION__);
23206
23207 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023208 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023209 -------------------------------------------------------------------------*/
23210 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023211 ( NULL == (pwdiSetRcvPktFilterReqInfo =
Jeff Johnson295189b2012-06-20 16:38:30 -070023212 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023213 ( NULL == (wdiReceiveFilterSetFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023214 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
23215 {
23216 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23217 "%s: Invalid parameters", __FUNCTION__);
23218 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023219 return WDI_STATUS_E_FAILURE;
23220 }
23221
23222 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23223 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId,
23224 &pBSSSes);
23225 if ( NULL == pBSSSes )
23226 {
23227 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23228 " %s : Association for this BSSID does not exist",__FUNCTION__);
23229 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023230 }
23231
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023232 if( WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) )
23233 {
Jeff Johnson295189b2012-06-20 16:38:30 -070023234
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023235 usSessRcvPktFilterCfgSize = sizeof(tHalSessionizedRcvPktFilterCfgType) +
23236 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23237 * sizeof(tHalSessionizedRcvPktFilterCfgType));
23238
23239 pSessRcvPktFilterCfg = (tHalSessionizedRcvPktFilterCfgType *)wpalMemoryAllocate(
23240 usSessRcvPktFilterCfgSize);
23241
23242 if(NULL == pSessRcvPktFilterCfg)
23243 {
23244 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23245 "%s: Failed to allocate memory for "
23246 "tHalRcvPktFilterCfgType: %x %x %x ",
23247 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23248 WDI_ASSERT(0);
23249 return WDI_STATUS_E_FAILURE;
23250 }
23251
23252 wpalMemoryZero(pSessRcvPktFilterCfg, usSessRcvPktFilterCfgSize);
23253
23254 /*-----------------------------------------------------------------------
23255 Get message buffer
23256 -----------------------------------------------------------------------*/
23257
23258 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
23259 usSessRcvPktFilterCfgSize,
23260 &pSendBuffer, &usDataOffset, &usSendSize))||
23261 ( usSendSize < (usDataOffset + usSessRcvPktFilterCfgSize)))
23262 {
23263 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23264 "Unable to get send buffer in "
23265 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23266 pEventData, pwdiSetRcvPktFilterReqInfo,
23267 wdiReceiveFilterSetFilterCb);
23268 WDI_ASSERT(0);
23269 wpalMemoryFree(pSessRcvPktFilterCfg);
23270 return WDI_STATUS_E_FAILURE;
23271 }
23272
23273 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23274 "UsData Off %d UsSend %d cfg %d",usDataOffset,
23275 usSendSize,pSessRcvPktFilterCfg);
23276
23277 pSessRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
23278 pSessRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
23279 pSessRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
23280 pSessRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
23281
23282 pSessRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx;
23283
23284 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23285 "Out: FID %d FT %d",pSessRcvPktFilterCfg->filterId,
23286 pSessRcvPktFilterCfg->filterType);
23287 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23288 "NParams %d CT %d",pSessRcvPktFilterCfg->numParams,
23289 pSessRcvPktFilterCfg->coleasceTime);
23290
23291 for ( i = 0; i < pSessRcvPktFilterCfg->numParams; i++ )
23292 {
23293 pSessRcvPktFilterCfg->paramsData[i].protocolLayer =
23294 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
23295 pSessRcvPktFilterCfg->paramsData[i].cmpFlag =
23296 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
23297 pSessRcvPktFilterCfg->paramsData[i].dataOffset =
23298 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
23299 pSessRcvPktFilterCfg->paramsData[i].dataLength =
23300 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
23301
23302 wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].compareData,
23303 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23304 8);
23305 wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].dataMask,
23306 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23307 8);
23308
23309 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23310 "Out:Proto %d Comp Flag %d \n",
23311 pSessRcvPktFilterCfg->paramsData[i].protocolLayer,
23312 pSessRcvPktFilterCfg->paramsData[i].cmpFlag);
23313
23314 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23315 "Data Offset %d Data Len %d\n",
23316 pSessRcvPktFilterCfg->paramsData[i].dataOffset,
23317 pSessRcvPktFilterCfg->paramsData[i].dataLength);
23318
23319 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23320 "CData: %d:%d:%d:%d:%d:%d\n",
23321 pSessRcvPktFilterCfg->paramsData[i].compareData[0],
23322 pSessRcvPktFilterCfg->paramsData[i].compareData[1],
23323 pSessRcvPktFilterCfg->paramsData[i].compareData[2],
23324 pSessRcvPktFilterCfg->paramsData[i].compareData[3],
23325 pSessRcvPktFilterCfg->paramsData[i].compareData[4],
23326 pSessRcvPktFilterCfg->paramsData[i].compareData[5]);
23327
23328 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23329 "MData: %d:%d:%d:%d:%d:%d\n",
23330 pSessRcvPktFilterCfg->paramsData[i].dataMask[0],
23331 pSessRcvPktFilterCfg->paramsData[i].dataMask[1],
23332 pSessRcvPktFilterCfg->paramsData[i].dataMask[2],
23333 pSessRcvPktFilterCfg->paramsData[i].dataMask[3],
23334 pSessRcvPktFilterCfg->paramsData[i].dataMask[4],
23335 pSessRcvPktFilterCfg->paramsData[i].dataMask[5]);
23336 }
23337
23338 wpalMemoryCopy( pSendBuffer+usDataOffset,
23339 pSessRcvPktFilterCfg,
23340 usSessRcvPktFilterCfgSize);
23341
23342
23343 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
23344 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
23345
23346 wpalMemoryFree(pSessRcvPktFilterCfg);
23347
23348 }
23349 /*If SLM_SESSIONIZATION is not supported then do this */
23350 else
23351 {
23352 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
23353 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23354 * sizeof(tHalRcvPktFilterParams));
23355
23356 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
Jeff Johnson295189b2012-06-20 16:38:30 -070023357 usRcvPktFilterCfgSize);
23358
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023359 if(NULL == pRcvPktFilterCfg)
23360 {
23361 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23362 "%s: Failed to allocate memory for "
23363 "tHalRcvPktFilterCfgType: %x %x %x ",
23364 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23365 WDI_ASSERT(0);
23366 return WDI_STATUS_E_FAILURE;
23367 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023368
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023369 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023370
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023371 /*-----------------------------------------------------------------------
23372 Get message buffer
23373 -----------------------------------------------------------------------*/
23374 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023375 usRcvPktFilterCfgSize,
23376 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023377 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
23378 {
23379 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnson295189b2012-06-20 16:38:30 -070023380 "Unable to get send buffer in "
23381 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23382 pEventData, pwdiSetRcvPktFilterReqInfo,
23383 wdiReceiveFilterSetFilterCb);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023384 WDI_ASSERT(0);
23385 wpalMemoryFree(pRcvPktFilterCfg);
23386 return WDI_STATUS_E_FAILURE;
23387 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023388
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023389 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023390 "UsData Off %d UsSend %d cfg %d",usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023391 usSendSize,usRcvPktFilterCfgSize);
23392
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023393 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
23394 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
23395 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
23396 pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
Jeff Johnson295189b2012-06-20 16:38:30 -070023397
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023398 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023399 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
Jeff Johnson295189b2012-06-20 16:38:30 -070023400 pRcvPktFilterCfg->filterType);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023401 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnson295189b2012-06-20 16:38:30 -070023402 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070023403 pRcvPktFilterCfg->coalesceTime);
Jeff Johnson295189b2012-06-20 16:38:30 -070023404
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023405 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
23406 {
23407 pRcvPktFilterCfg->paramsData[i].protocolLayer =
23408 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
23409 pRcvPktFilterCfg->paramsData[i].cmpFlag =
23410 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
23411 pRcvPktFilterCfg->paramsData[i].dataOffset =
23412 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
23413 pRcvPktFilterCfg->paramsData[i].dataLength =
23414 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
Jeff Johnson295189b2012-06-20 16:38:30 -070023415
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023416 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
Jeff Johnson295189b2012-06-20 16:38:30 -070023417 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23418 8);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023419 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
Jeff Johnson295189b2012-06-20 16:38:30 -070023420 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23421 8);
23422
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023423 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnson295189b2012-06-20 16:38:30 -070023424 "Out:Proto %d Comp Flag %d \n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023425 pRcvPktFilterCfg->paramsData[i].protocolLayer,
Jeff Johnson295189b2012-06-20 16:38:30 -070023426 pRcvPktFilterCfg->paramsData[i].cmpFlag);
23427
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023428 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23429 "Data Offset %d Data Len %d\n",
23430 pRcvPktFilterCfg->paramsData[i].dataOffset,
23431 pRcvPktFilterCfg->paramsData[i].dataLength);
Jeff Johnson295189b2012-06-20 16:38:30 -070023432
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023433 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23434 "CData: %d:%d:%d:%d:%d:%d\n",
23435 pRcvPktFilterCfg->paramsData[i].compareData[0],
23436 pRcvPktFilterCfg->paramsData[i].compareData[1],
23437 pRcvPktFilterCfg->paramsData[i].compareData[2],
23438 pRcvPktFilterCfg->paramsData[i].compareData[3],
23439 pRcvPktFilterCfg->paramsData[i].compareData[4],
23440 pRcvPktFilterCfg->paramsData[i].compareData[5]);
Jeff Johnson295189b2012-06-20 16:38:30 -070023441
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023442 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23443 "MData: %d:%d:%d:%d:%d:%d\n",
23444 pRcvPktFilterCfg->paramsData[i].dataMask[0],
23445 pRcvPktFilterCfg->paramsData[i].dataMask[1],
23446 pRcvPktFilterCfg->paramsData[i].dataMask[2],
23447 pRcvPktFilterCfg->paramsData[i].dataMask[3],
23448 pRcvPktFilterCfg->paramsData[i].dataMask[4],
23449 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
23450 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023451
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023452 wpalMemoryCopy( pSendBuffer+usDataOffset,
Jeff Johnsone7245742012-09-05 17:12:55 -070023453 pRcvPktFilterCfg,
23454 usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023455
23456
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023457 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
23458 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023459
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023460 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23461 "%s",__FUNCTION__);
23462 wpalMemoryFree(pRcvPktFilterCfg);
23463 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023464 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023465 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023466 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023467 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023468 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023469 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023470}
23471
23472/**
23473 @brief Process Packet Filter Match Count Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023474
23475 @param pWDICtx: pointer to the WLAN DAL context
23476 pEventData: pointer to the event information structure
23477
Jeff Johnson295189b2012-06-20 16:38:30 -070023478 @see
23479 @return Result of the function call
23480*/
23481WDI_Status
23482WDI_ProcessFilterMatchCountReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023483(
Jeff Johnson295189b2012-06-20 16:38:30 -070023484 WDI_ControlBlockType* pWDICtx,
23485 WDI_EventInfoType* pEventData
23486)
23487{
23488 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
23489 NULL;
23490 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
23491 NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023492 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023493 wpt_uint16 usDataOffset = 0;
23494 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023495 tHalRcvFltPktMatchCntReqParams rcvFltPktMatchCntReqParam = {0};
23496 wpt_uint8 ucCurrentBSSSesIdx = 0;
23497 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023498
23499 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23500 "%s",__FUNCTION__);
23501
23502 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023503 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023504 -------------------------------------------------------------------------*/
23505 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023506 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023507 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023508 ( NULL == (wdiFilterMatchCountCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023509 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
23510 {
23511 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23512 "%s: Invalid parameters", __FUNCTION__);
23513 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023514 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023515 }
23516
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023517 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23518 pwdiRcvFltPktMatchCntReqParamsType->bssId,
23519 &pBSSSes);
23520 if ( NULL == pBSSSes )
23521 {
23522 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23523 " %s : Association for this BSSID does not exist",__FUNCTION__);
23524 return WDI_STATUS_E_FAILURE;
23525 }
23526
Jeff Johnson295189b2012-06-20 16:38:30 -070023527 /*-----------------------------------------------------------------------
23528 Get message buffer
23529 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023530 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23531 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023532 sizeof(tHalRcvFltPktMatchCntReqParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070023533 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023534 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktMatchCntReqParams))))
Jeff Johnson295189b2012-06-20 16:38:30 -070023535 {
23536 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23537 "Unable to get send buffer in "
23538 "WDI_ProcessFilterMatchCountReq() %x %x %x",
23539 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
23540 wdiFilterMatchCountCb);
23541 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023542 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023543 }
23544
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023545 rcvFltPktMatchCntReqParam.bssIdx = pBSSSes->ucBSSIdx;
23546 wpalMemoryCopy( pSendBuffer+usDataOffset,
23547 &rcvFltPktMatchCntReqParam,
23548 sizeof(rcvFltPktMatchCntReqParam));
23549
Jeff Johnson295189b2012-06-20 16:38:30 -070023550 //
23551 // Don't need to fill send buffer other than header
23552 //
23553 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023554 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023555
23556
23557 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023558 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023559 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023560 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23561 wdiFilterMatchCountCb,
23562 pEventData->pUserData,
23563 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023564}
23565
23566/**
23567 @brief Process Receive Filter Clear Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023568
23569 @param pWDICtx: pointer to the WLAN DAL context
23570 pEventData: pointer to the event information structure
23571
Jeff Johnson295189b2012-06-20 16:38:30 -070023572 @see
23573 @return Result of the function call
23574*/
23575WDI_Status
23576WDI_ProcessReceiveFilterClearFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023577(
Jeff Johnson295189b2012-06-20 16:38:30 -070023578 WDI_ControlBlockType* pWDICtx,
23579 WDI_EventInfoType* pEventData
23580)
Jeff Johnsone7245742012-09-05 17:12:55 -070023581{
Jeff Johnson295189b2012-06-20 16:38:30 -070023582 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
23583 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023584 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023585 wpt_uint16 usDataOffset = 0;
23586 wpt_uint16 usSendSize = 0;
23587 tHalRcvFltPktClearParam rcvFltPktClearParam;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023588 wpt_uint8 ucCurrentSessionId = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070023589 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023590
23591 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23592 "%s",__FUNCTION__);
23593
23594 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023595 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023596 -------------------------------------------------------------------------*/
23597 if (( NULL == pEventData ) ||
23598 ( NULL == (pwdiRcvFltPktClearReqParamsType =
23599 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023600 ( NULL == (wdiRcvFltPktClearFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023601 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
23602 {
23603 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23604 "%s: Invalid parameters", __FUNCTION__);
23605 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023606 return WDI_STATUS_E_FAILURE;
23607 }
23608
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023609 ucCurrentSessionId = WDI_FindAssocSession( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023610 pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId,
23611 &pBSSSes);
23612 if ( NULL == pBSSSes )
23613 {
23614 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23615 " %s : Association for this BSSID does not exist",__FUNCTION__);
23616 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023617 }
23618
23619 /*-----------------------------------------------------------------------
23620 Get message buffer
23621 -----------------------------------------------------------------------*/
23622 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023623 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023624 sizeof(tHalRcvFltPktClearParam),
23625 &pSendBuffer, &usDataOffset, &usSendSize))||
23626 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
23627 {
23628 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23629 "Unable to get send buffer in "
23630 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
23631 pEventData, pwdiRcvFltPktClearReqParamsType,
23632 wdiRcvFltPktClearFilterCb);
23633 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023634 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023635 }
23636
23637
23638 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023639 filterClearParam.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070023640 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023641 filterClearParam.filterId;
Jeff Johnson295189b2012-06-20 16:38:30 -070023642
Jeff Johnsone7245742012-09-05 17:12:55 -070023643 rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx;
23644 wpalMemoryCopy( pSendBuffer+usDataOffset,
23645 &rcvFltPktClearParam,
23646 sizeof(rcvFltPktClearParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070023647
23648 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023649 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023650
23651
23652 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023653 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023654 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023655 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023656 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023657 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023658}
23659
23660/**
23661 @brief Process 8023 Multicast List Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023662
23663 @param pWDICtx: pointer to the WLAN DAL context
23664 pEventData: pointer to the event information structure
23665
Jeff Johnson295189b2012-06-20 16:38:30 -070023666 @see
23667 @return Result of the function call
23668*/
23669WDI_Status
23670WDI_Process8023MulticastListRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023671(
Jeff Johnson295189b2012-06-20 16:38:30 -070023672 WDI_ControlBlockType* pWDICtx,
23673 WDI_EventInfoType* pEventData
23674)
23675{
Jeff Johnson295189b2012-06-20 16:38:30 -070023676 eHalStatus halStatus;
23677 WDI_8023MulticastListCb wdi8023MulticastListCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023678 tHalRcvFltPktSetMcListRspType halRcvFltPktSetMcListRsp;
23679 WDI_RcvFltPktSetMcListRspParamsType wdiRcvFltPktSetMcListRspInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023680 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23681
23682 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23683 "%s",__FUNCTION__);
23684
23685 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023686 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023687 -------------------------------------------------------------------------*/
23688 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23689 ( NULL == pEventData->pEventData ))
23690 {
23691 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23692 "%s: Invalid parameters", __FUNCTION__);
23693 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023694 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023695 }
23696
Jeff Johnsone7245742012-09-05 17:12:55 -070023697 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023698
23699 /*-------------------------------------------------------------------------
23700 Extract response and send it to UMAC
23701 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023702 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23703 {
23704 wpalMemoryCopy( &halRcvFltPktSetMcListRsp,
23705 pEventData->pEventData,
23706 sizeof(halRcvFltPktSetMcListRsp));
23707
23708 wdiRcvFltPktSetMcListRspInfo.wdiStatus =
23709 WDI_HAL_2_WDI_STATUS(halRcvFltPktSetMcListRsp.status);
23710 wdiRcvFltPktSetMcListRspInfo.bssIdx =
23711 halRcvFltPktSetMcListRsp.bssIdx;
23712 }
23713 else
23714 {
23715 halStatus = *((eHalStatus*)pEventData->pEventData);
23716 wdiRcvFltPktSetMcListRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23717 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023718
23719 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023720 wdi8023MulticastListCb(&wdiRcvFltPktSetMcListRspInfo, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023721
Jeff Johnsone7245742012-09-05 17:12:55 -070023722 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023723}
23724
23725/**
23726 @brief Process Set Rsp function (called when a
23727 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023728
23729 @param pWDICtx: pointer to the WLAN DAL context
23730 pEventData: pointer to the event information structure
23731
Jeff Johnson295189b2012-06-20 16:38:30 -070023732 @see
23733 @return Result of the function call
23734*/
23735WDI_Status
23736WDI_ProcessReceiveFilterSetFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023737(
Jeff Johnson295189b2012-06-20 16:38:30 -070023738 WDI_ControlBlockType* pWDICtx,
23739 WDI_EventInfoType* pEventData
23740)
23741{
Jeff Johnson295189b2012-06-20 16:38:30 -070023742 eHalStatus halStatus;
23743 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023744 tHalSetPktFilterRspParams halSetPktFilterRspParams;
23745 WDI_SetRcvPktFilterRspParamsType wdiSetRcvPktFilterRspInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023746 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23747
23748 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23749 "%s",__FUNCTION__);
23750
23751 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023752 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023753 -------------------------------------------------------------------------*/
23754 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23755 ( NULL == pEventData->pEventData ))
23756 {
23757 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23758 "%s: Invalid parameters", __FUNCTION__);
23759 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023760 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023761 }
23762
23763 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023764 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023765
23766 /*-------------------------------------------------------------------------
23767 Extract response and send it to UMAC
23768 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023769 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23770 {
23771 wpalMemoryCopy( &halSetPktFilterRspParams,
23772 pEventData->pEventData,
23773 sizeof(halSetPktFilterRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070023774
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023775 wdiSetRcvPktFilterRspInfo.bssIdx = halSetPktFilterRspParams.bssIdx;
23776 wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halSetPktFilterRspParams.status);
23777 }
23778 else
23779 {
23780 halStatus = *((eHalStatus*)pEventData->pEventData);
23781 wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23782 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023783 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023784 wdiReceiveFilterSetFilterCb(&wdiSetRcvPktFilterRspInfo, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023785
Jeff Johnsone7245742012-09-05 17:12:55 -070023786 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023787}
23788
23789/**
23790 @brief Process Packet Filter Match Count Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023791
23792 @param pWDICtx: pointer to the WLAN DAL context
23793 pEventData: pointer to the event information structure
23794
Jeff Johnson295189b2012-06-20 16:38:30 -070023795 @see
23796 @return Result of the function call
23797*/
23798WDI_Status
23799WDI_ProcessFilterMatchCountRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023800(
Jeff Johnson295189b2012-06-20 16:38:30 -070023801 WDI_ControlBlockType* pWDICtx,
23802 WDI_EventInfoType* pEventData
23803)
23804{
Jeff Johnson295189b2012-06-20 16:38:30 -070023805 eHalStatus halStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070023806 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023807 tHalRcvFltPktMatchRspParams halRcvFltrPktMatachRsp;
23808 WDI_RcvFltPktMatchCntRspParamsType wdiRcvFltPktMatchRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070023809
23810 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23811
23812 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23813 "%s",__FUNCTION__);
23814
23815 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023816 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023817 -------------------------------------------------------------------------*/
23818 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23819 ( NULL == pEventData->pEventData ))
23820 {
23821 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23822 "%s: Invalid parameters", __FUNCTION__);
23823 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023824 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023825 }
23826
Jeff Johnsone7245742012-09-05 17:12:55 -070023827 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023828
23829 /*-------------------------------------------------------------------------
23830 Extract response and send it to UMAC
23831 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023832 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23833 {
23834 wpalMemoryCopy( &halRcvFltrPktMatachRsp,
23835 pEventData->pEventData,
23836 sizeof(halRcvFltrPktMatachRsp));
23837
23838 wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halRcvFltrPktMatachRsp.status);
23839 wdiRcvFltPktMatchRspParams.bssIdx = halRcvFltrPktMatachRsp.bssIdx;
23840 }
23841 else
23842 {
23843 halStatus = *((eHalStatus*)pEventData->pEventData);
23844 wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23845 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023846
23847 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023848 wdiFilterMatchCountCb(&wdiRcvFltPktMatchRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023849
Jeff Johnsone7245742012-09-05 17:12:55 -070023850 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023851}
23852
23853/**
23854 @brief Process Receive Filter Clear Filter Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023855
23856 @param pWDICtx: pointer to the WLAN DAL context
23857 pEventData: pointer to the event information structure
23858
Jeff Johnson295189b2012-06-20 16:38:30 -070023859 @see
23860 @return Result of the function call
23861*/
23862WDI_Status
23863WDI_ProcessReceiveFilterClearFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023864(
Jeff Johnson295189b2012-06-20 16:38:30 -070023865 WDI_ControlBlockType* pWDICtx,
23866 WDI_EventInfoType* pEventData
23867)
23868{
Jeff Johnson295189b2012-06-20 16:38:30 -070023869 eHalStatus halStatus;
23870 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023871 tHalRcvFltPktClearParam halRcvFltPktClearRspMsg;
23872 WDI_RcvFltPktClearRspParamsType wdiRcvFltPktClearRspParamsType;
Jeff Johnson295189b2012-06-20 16:38:30 -070023873 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23874
23875 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23876 "%s",__FUNCTION__);
23877
23878 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023879 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023880 -------------------------------------------------------------------------*/
23881 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23882 ( NULL == pEventData->pEventData ))
23883 {
23884 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23885 "%s: Invalid parameters", __FUNCTION__);
23886 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023887 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023888 }
23889
23890 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023891 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023892
23893 /*-------------------------------------------------------------------------
23894 Extract response and send it to UMAC
23895 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023896 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23897 {
23898 wpalMemoryCopy( &halRcvFltPktClearRspMsg,
23899 pEventData->pEventData,
23900 sizeof(halRcvFltPktClearRspMsg));
23901
23902 wdiRcvFltPktClearRspParamsType.wdiStatus =
23903 WDI_HAL_2_WDI_STATUS(halRcvFltPktClearRspMsg.status);
23904 wdiRcvFltPktClearRspParamsType.bssIdx =
23905 halRcvFltPktClearRspMsg.bssIdx;
23906 }
23907 else
23908 {
23909 halStatus = *((eHalStatus*)pEventData->pEventData);
23910 wdiRcvFltPktClearRspParamsType.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23911 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023912
23913 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023914 wdiReceiveFilterClearFilterCb(&wdiRcvFltPktClearRspParamsType, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023915
Jeff Johnsone7245742012-09-05 17:12:55 -070023916 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023917}
23918#endif // WLAN_FEATURE_PACKET_FILTERING
23919
23920/**
23921 @brief Process Shutdown Rsp function
23922 There is no shutdown response comming from HAL
23923 - function just kept for simmetry
Jeff Johnsone7245742012-09-05 17:12:55 -070023924
Jeff Johnson295189b2012-06-20 16:38:30 -070023925 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnsone7245742012-09-05 17:12:55 -070023926 pEventData: pointer to the event information structure
Jeff Johnson295189b2012-06-20 16:38:30 -070023927
23928 @see
23929 @return Result of the function call
23930*/
23931WDI_Status
23932WDI_ProcessShutdownRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023933(
Jeff Johnson295189b2012-06-20 16:38:30 -070023934 WDI_ControlBlockType* pWDICtx,
23935 WDI_EventInfoType* pEventData
23936)
23937{
23938 /*There is no shutdown response comming from HAL - function just kept for
23939 simmetry */
23940 WDI_ASSERT(0);
23941 return WDI_STATUS_SUCCESS;
23942}/*WDI_ProcessShutdownRsp*/
23943
23944/**
23945 @brief WDI_SetPowerParamsReq
23946
Jeff Johnsone7245742012-09-05 17:12:55 -070023947 @param pwdiPowerParamsReqParams: the Set Power Params as
Jeff Johnson295189b2012-06-20 16:38:30 -070023948 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070023949
Jeff Johnson295189b2012-06-20 16:38:30 -070023950 wdiPowerParamsCb: callback for passing back the response
23951 of the Set Power Params operation received from the
23952 device
Jeff Johnsone7245742012-09-05 17:12:55 -070023953
Jeff Johnson295189b2012-06-20 16:38:30 -070023954 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070023955 callback
23956
Jeff Johnson295189b2012-06-20 16:38:30 -070023957 @return Result of the function call
23958*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023959WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023960WDI_SetPowerParamsReq
23961(
23962 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23963 WDI_SetPowerParamsCb wdiPowerParamsCb,
23964 void* pUserData
23965)
23966{
23967 WDI_EventInfoType wdiEventData;
23968 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23969
23970 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023971 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023972 ------------------------------------------------------------------------*/
23973 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23974 {
23975 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23976 "WDI API call before module is initialized - Fail request");
23977
Jeff Johnsone7245742012-09-05 17:12:55 -070023978 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023979 }
23980
23981 /*------------------------------------------------------------------------
23982 Fill in Event data and post to the Main FSM
23983 ------------------------------------------------------------------------*/
23984 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023985 wdiEventData.pEventData = pwdiPowerParamsReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070023986 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070023987 wdiEventData.pCBfnc = wdiPowerParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070023988 wdiEventData.pUserData = pUserData;
23989
23990 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23991}/*WDI_SetPowerParamsReq*/
23992
23993/**
23994 @brief Process Set Power Params Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023995
23996 @param pWDICtx: pointer to the WLAN DAL context
23997 pEventData: pointer to the event information structure
23998
Jeff Johnson295189b2012-06-20 16:38:30 -070023999 @see
24000 @return Result of the function call
24001*/
24002WDI_Status
24003WDI_ProcessSetPowerParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070024004(
Jeff Johnson295189b2012-06-20 16:38:30 -070024005 WDI_ControlBlockType* pWDICtx,
24006 WDI_EventInfoType* pEventData
24007)
24008{
24009 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
24010 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070024011 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070024012 wpt_uint16 usDataOffset = 0;
24013 wpt_uint16 usSendSize = 0;
24014 tSetPowerParamsType powerParams;
24015
24016 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070024017 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070024018 -------------------------------------------------------------------------*/
24019 if (( NULL == pEventData ) ||
24020 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
24021 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
24022 {
24023 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24024 "%s: Invalid parameters", __FUNCTION__);
24025 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070024026 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070024027 }
24028
24029 /*-----------------------------------------------------------------------
24030 Get message buffer
24031 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070024032 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070024033 sizeof(powerParams),
24034 &pSendBuffer, &usDataOffset, &usSendSize))||
24035 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
24036 {
24037 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24038 "Unable to get send buffer in Set PNO req %x %x %x",
24039 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
24040 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070024041 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070024042 }
24043
24044 /* Ignore DTIM */
Jeff Johnsone7245742012-09-05 17:12:55 -070024045 powerParams.uIgnoreDTIM =
Jeff Johnson295189b2012-06-20 16:38:30 -070024046 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
24047
24048 /*DTIM Period*/
Jeff Johnsone7245742012-09-05 17:12:55 -070024049 powerParams.uDTIMPeriod =
Jeff Johnson295189b2012-06-20 16:38:30 -070024050 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
24051
24052 /* Listen Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070024053 powerParams.uListenInterval=
Jeff Johnson295189b2012-06-20 16:38:30 -070024054 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
24055
24056 /* Broadcast Multicas Filter */
Jeff Johnsone7245742012-09-05 17:12:55 -070024057 powerParams.uBcastMcastFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070024058 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
24059
24060 /* Beacon Early Termination */
Jeff Johnsone7245742012-09-05 17:12:55 -070024061 powerParams.uEnableBET =
Jeff Johnson295189b2012-06-20 16:38:30 -070024062 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
24063
24064 /* Beacon Early Termination Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070024065 powerParams.uBETInterval =
24066 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
Jeff Johnson295189b2012-06-20 16:38:30 -070024067
Jeff Johnsone7245742012-09-05 17:12:55 -070024068
24069 wpalMemoryCopy( pSendBuffer+usDataOffset,
24070 &powerParams,
24071 sizeof(powerParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070024072
24073 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070024074 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070024075
24076 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070024077 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070024078 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070024079 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24080 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070024081}
24082
24083/**
24084 @brief Process Power Params Rsp function (called when a
24085 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070024086
24087 @param pWDICtx: pointer to the WLAN DAL context
24088 pEventData: pointer to the event information structure
24089
Jeff Johnson295189b2012-06-20 16:38:30 -070024090 @see
24091 @return Result of the function call
24092*/
24093WDI_Status
24094WDI_ProcessSetPowerParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070024095(
Jeff Johnson295189b2012-06-20 16:38:30 -070024096 WDI_ControlBlockType* pWDICtx,
24097 WDI_EventInfoType* pEventData
24098)
24099{
24100 WDI_Status wdiStatus;
24101 eHalStatus halStatus;
24102 WDI_SetPowerParamsCb wdiPowerParamsCb;
24103 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24104
24105 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070024106 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070024107 -------------------------------------------------------------------------*/
24108 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24109 ( NULL == pEventData->pEventData ))
24110 {
24111 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24112 "%s: Invalid parameters", __FUNCTION__);
24113 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070024114 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070024115 }
24116
Jeff Johnsone7245742012-09-05 17:12:55 -070024117 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070024118
24119 /*-------------------------------------------------------------------------
24120 Extract response and send it to UMAC
24121 -------------------------------------------------------------------------*/
24122 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070024123 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070024124
24125 /*Notify UMAC*/
24126 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24127
Jeff Johnsone7245742012-09-05 17:12:55 -070024128 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070024129}/*WDI_ProcessSetPowerParamsRsp*/
24130
24131#ifdef WLAN_FEATURE_GTK_OFFLOAD
24132/**
24133 @brief WDI_GTKOffloadReq will be called when the upper MAC
24134 wants to set GTK Rekey Counter while in power save. Upon
24135 the call of this API the WLAN DAL will pack and send a
24136 HAL GTK offload request message to the lower RIVA
24137 sub-system if DAL is in state STARTED.
24138
24139 In state BUSY this request will be queued. Request won't
24140 be allowed in any other state.
24141
24142 WDI_PostAssocReq must have been called.
24143
24144 @param pwdiGtkOffloadParams: the GTK offload as specified
24145 by the Device Interface
24146
24147 wdiGtkOffloadCb: callback for passing back the response
24148 of the GTK offload operation received from the device
24149
24150 pUserData: user data will be passed back with the
24151 callback
24152
24153 @see WDI_PostAssocReq
24154 @return Result of the function call
24155*/
24156WDI_Status
24157WDI_GTKOffloadReq
24158(
24159 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
24160 WDI_GtkOffloadCb wdiGtkOffloadCb,
24161 void* pUserData
24162)
24163{
24164 WDI_EventInfoType wdiEventData = {0};
24165 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24166
24167 /*------------------------------------------------------------------------
24168 Sanity Check
24169 ------------------------------------------------------------------------*/
24170 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24171 {
24172 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24173 "WDI API call before module is initialized - Fail request");
24174
24175 return WDI_STATUS_E_NOT_ALLOWED;
24176 }
24177
24178 /*------------------------------------------------------------------------
24179 Fill in Event data and post to the Main FSM
24180 ------------------------------------------------------------------------*/
24181 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
24182 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
24183 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
24184 wdiEventData.pCBfnc = wdiGtkOffloadCb;
24185 wdiEventData.pUserData = pUserData;
24186
24187 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24188}
24189
24190
24191/**
24192 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
24193 MAC wants to get GTK Rekey Counter while in power save.
24194 Upon the call of this API the WLAN DAL will pack and
24195 send a HAL GTK offload request message to the lower RIVA
24196 sub-system if DAL is in state STARTED.
24197
24198 In state BUSY this request will be queued. Request won't
24199 be allowed in any other state.
24200
24201 WDI_PostAssocReq must have been called.
24202
24203 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
24204 Information Message as specified by the
24205 Device Interface
24206
24207 wdiGtkOffloadGetInfoCb: callback for passing back the
24208 response of the GTK offload operation received from the
24209 device
24210
24211 pUserData: user data will be passed back with the
24212 callback
24213
24214 @see WDI_PostAssocReq
24215 @return Result of the function call
24216*/
24217WDI_Status
24218WDI_GTKOffloadGetInfoReq
24219(
24220 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
24221 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
24222 void* pUserData
24223)
24224{
24225 WDI_EventInfoType wdiEventData = {0};
24226 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24227
24228 /*------------------------------------------------------------------------
24229 Sanity Check
24230 ------------------------------------------------------------------------*/
24231 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24232 {
24233 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24234 "WDI API call before module is initialized - Fail request");
24235
24236 return WDI_STATUS_E_NOT_ALLOWED;
24237 }
24238
24239 /*------------------------------------------------------------------------
24240 Fill in Event data and post to the Main FSM
24241 ------------------------------------------------------------------------*/
24242 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
24243 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
24244 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
24245 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
24246 wdiEventData.pUserData = pUserData;
24247
24248 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24249}
24250
24251
24252/**
24253 @brief Process set GTK Offload Request function
24254
24255 @param pWDICtx: pointer to the WLAN DAL context
24256 pEventData: pointer to the event information structure
24257
24258 @see
24259 @return Result of the function call
24260*/
24261WDI_Status
24262WDI_ProcessGTKOffloadReq
24263(
24264 WDI_ControlBlockType* pWDICtx,
24265 WDI_EventInfoType* pEventData
24266)
24267{
24268 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
24269 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
24270 wpt_uint8* pSendBuffer = NULL;
24271 wpt_uint16 usDataOffset = 0;
24272 wpt_uint16 usSendSize = 0;
24273 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024274 wpt_uint8 ucCurrentSessionId = 0;
24275 WDI_BSSSessionType* pBSSSes = NULL;
24276
Jeff Johnson295189b2012-06-20 16:38:30 -070024277 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24278
24279 /*-------------------------------------------------------------------------
24280 Sanity check
24281 -------------------------------------------------------------------------*/
24282 if (( NULL == pEventData ) ||
24283 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
24284 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
24285 {
24286 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24287 "%s: Invalid parameters", __FUNCTION__);
24288 WDI_ASSERT(0);
24289 return WDI_STATUS_E_FAILURE;
24290 }
24291
24292 /*-----------------------------------------------------------------------
24293 Get message buffer
24294 -----------------------------------------------------------------------*/
24295 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
24296 sizeof(gtkOffloadReqParams),
24297 &pSendBuffer, &usDataOffset, &usSendSize))||
24298 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
24299 {
24300 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24301 "Unable to get send buffer in GTK offload req %x %x %x",
24302 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
24303 WDI_ASSERT(0);
24304 return WDI_STATUS_E_FAILURE;
24305 }
24306
24307 //
24308 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
24309 //
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024310 ucCurrentSessionId = WDI_FindAssocSession( pWDICtx,
24311 pwdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId,
24312 &pBSSSes);
24313 if ( NULL == pBSSSes )
24314 {
24315 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24316 " %s : Association for this BSSID does not exist", __FUNCTION__);
24317 return WDI_STATUS_E_FAILURE;
24318 }
24319
24320 gtkOffloadReqParams.bssIdx = pBSSSes->ucBSSIdx;
24321
Jeff Johnson295189b2012-06-20 16:38:30 -070024322 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
24323 // Copy KCK
24324 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
24325 // Copy KEK
24326 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
24327 // Copy KeyReplayCounter
24328 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
24329
24330 wpalMemoryCopy( pSendBuffer+usDataOffset,
24331 &gtkOffloadReqParams,
24332 sizeof(gtkOffloadReqParams));
24333
24334 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
24335 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
24336
24337 /*-------------------------------------------------------------------------
24338 Send Get STA Request to HAL
24339 -------------------------------------------------------------------------*/
24340 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24341 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
24342}
24343
24344
24345/**
24346 @brief Process GTK Offload Get Information Request function
24347
24348 @param pWDICtx: pointer to the WLAN DAL context
24349 pEventData: pointer to the event information structure
24350
24351 @see
24352 @return Result of the function call
24353*/
24354WDI_Status
24355WDI_ProcessGTKOffloadGetInfoReq
24356(
24357 WDI_ControlBlockType* pWDICtx,
24358 WDI_EventInfoType* pEventData
24359)
24360{
24361 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
24362 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
24363 wpt_uint8* pSendBuffer = NULL;
24364 wpt_uint16 usDataOffset = 0;
24365 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024366 tHalGtkOffloadGetInfoReqParams halGtkOffloadGetInfoReqParams;
24367 wpt_uint8 ucCurrentSessionId = 0;
24368 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070024369
24370 /*-------------------------------------------------------------------------
24371 Sanity check
24372 -------------------------------------------------------------------------*/
24373 if (( NULL == pEventData ) ||
24374 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
24375 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
24376 {
24377 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24378 "%s: Invalid parameters", __FUNCTION__);
24379 WDI_ASSERT(0);
24380 return WDI_STATUS_E_FAILURE;
24381 }
24382
24383 /*-----------------------------------------------------------------------
24384 Get message buffer
24385 -----------------------------------------------------------------------*/
24386 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024387 sizeof(halGtkOffloadGetInfoReqParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070024388 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024389 ( usSendSize < ( usDataOffset + sizeof(halGtkOffloadGetInfoReqParams)))
Jeff Johnson295189b2012-06-20 16:38:30 -070024390 {
24391 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24392 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
24393 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
24394 WDI_ASSERT(0);
24395 return WDI_STATUS_E_FAILURE;
24396 }
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024397 ucCurrentSessionId = WDI_FindAssocSession( pWDICtx,
24398 pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId,
24399 &pBSSSes);
24400 if ( NULL == pBSSSes )
24401 {
24402 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24403 " %s : Association for this BSSID does not exist",__FUNCTION__);
24404 return WDI_STATUS_E_FAILURE;
24405 }
24406 halGtkOffloadGetInfoReqParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070024407
24408 //
24409 // Don't need to fill send buffer other than header
24410 //
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024411 wpalMemoryCopy( pSendBuffer+usDataOffset,
24412 &halGtkOffloadGetInfoReqParams,
24413 sizeof(halGtkOffloadGetInfoReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070024414
24415 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
24416 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
24417
24418 /*-------------------------------------------------------------------------
24419 Send Get STA Request to HAL
24420 -------------------------------------------------------------------------*/
24421 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24422 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
24423}
24424
24425/**
24426 @brief Process host offload Rsp function (called when a
24427 response is being received over the bus from HAL)
24428
24429 @param pWDICtx: pointer to the WLAN DAL context
24430 pEventData: pointer to the event information structure
24431
24432 @see
24433 @return Result of the function call
24434*/
24435WDI_Status
24436WDI_ProcessGtkOffloadRsp
24437(
24438 WDI_ControlBlockType* pWDICtx,
24439 WDI_EventInfoType* pEventData
24440)
24441{
Jeff Johnson295189b2012-06-20 16:38:30 -070024442 eHalStatus halStatus;
24443 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024444 tHalGtkOffloadRspParams halGtkOffloadRspParams;
24445 WDI_GtkOffloadRspParams wdiGtkOffloadRsparams;
Jeff Johnson295189b2012-06-20 16:38:30 -070024446 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24447
24448 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
24449
24450 /*-------------------------------------------------------------------------
24451 Sanity check
24452 -------------------------------------------------------------------------*/
24453 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24454 ( NULL == pEventData->pEventData))
24455 {
24456 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24457 "%s: Invalid parameters", __FUNCTION__);
24458 WDI_ASSERT(0);
24459 return WDI_STATUS_E_FAILURE;
24460 }
24461
24462 /*-------------------------------------------------------------------------
24463 Extract response and send it to UMAC
24464 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024465 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
24466 {
24467 wpalMemoryCopy( &halGtkOffloadRspParams,
24468 pEventData->pEventData,
24469 sizeof(halGtkOffloadRspParams));
24470
24471 wdiGtkOffloadRsparams.ulStatus =
24472 WDI_HAL_2_WDI_STATUS(halGtkOffloadRspParams.status);
24473 wdiGtkOffloadRsparams.bssIdx =
24474 halGtkOffloadRspParams.bssIdx;
24475 }
24476 else
24477 {
24478 halStatus = *((eHalStatus*)pEventData->pEventData);
24479 wdiGtkOffloadRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24480 }
Jeff Johnson295189b2012-06-20 16:38:30 -070024481
24482 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024483 wdiGtkOffloadCb( &wdiGtkOffloadRsparams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070024484
24485 return WDI_STATUS_SUCCESS;
24486}
24487
24488/**
24489 @brief Process GTK Offload Get Information Response function
24490
24491 @param pWDICtx: pointer to the WLAN DAL context
24492 pEventData: pointer to the event information structure
24493
24494 @see
24495 @return Result of the function call
24496*/
24497WDI_Status
24498WDI_ProcessGTKOffloadGetInfoRsp
24499(
24500 WDI_ControlBlockType* pWDICtx,
24501 WDI_EventInfoType* pEventData
24502)
24503{
Jeff Johnson295189b2012-06-20 16:38:30 -070024504 eHalStatus halStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070024505 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024506 tHalGtkOffloadGetInfoRspParams halGtkOffloadGetInfoRspParams;
24507 WDI_GtkOffloadGetInfoRspParams wdiGtkOffloadGetInfoRsparams;
Jeff Johnson295189b2012-06-20 16:38:30 -070024508
24509 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24510
24511 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
24512
24513 /*-------------------------------------------------------------------------
24514 Sanity check
24515 -------------------------------------------------------------------------*/
24516 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24517 ( NULL == pEventData->pEventData ))
24518 {
24519 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24520 "%s: Invalid parameters", __FUNCTION__);
24521 WDI_ASSERT(0);
24522 return WDI_STATUS_E_FAILURE;
24523 }
24524
24525 /*-------------------------------------------------------------------------
24526 Extract response and send it to UMAC
24527 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024528 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
24529 {
24530 wpalMemoryCopy( &halGtkOffloadGetInfoRspParams,
24531 pEventData->pEventData,
24532 sizeof(halGtkOffloadGetInfoRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070024533
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024534 wdiGtkOffloadGetInfoRsparams.ulStatus =
24535 WDI_HAL_2_WDI_STATUS(halGtkOffloadGetInfoRspParams.status);
24536 wdiGtkOffloadGetInfoRsparams.ullKeyReplayCounter =
24537 halGtkOffloadGetInfoRspParams.ullKeyReplayCounter;
24538 wdiGtkOffloadGetInfoRsparams.ulTotalRekeyCount =
24539 halGtkOffloadGetInfoRspParams.ulTotalRekeyCount;
24540 wdiGtkOffloadGetInfoRsparams.ulGTKRekeyCount =
24541 halGtkOffloadGetInfoRspParams.ulGTKRekeyCount;
24542 wdiGtkOffloadGetInfoRsparams.ulIGTKRekeyCount =
24543 halGtkOffloadGetInfoRspParams.ulIGTKRekeyCount;
24544 wdiGtkOffloadGetInfoRsparams.bssIdx =
24545 halGtkOffloadGetInfoRspParams.bssIdx;
24546 }
24547 else
24548 {
24549 halStatus = *((eHalStatus*)pEventData->pEventData);
24550 wdiGtkOffloadGetInfoRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24551 }
Jeff Johnson295189b2012-06-20 16:38:30 -070024552 /*Notify UMAC*/
24553 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24554 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024555 wdiGtkOffloadGetInfoCb(&wdiGtkOffloadGetInfoRsparams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070024556
24557 return WDI_STATUS_SUCCESS;
24558}
24559#endif // WLAN_FEATURE_GTK_OFFLOAD
24560
24561#ifdef WLAN_WAKEUP_EVENTS
24562WDI_Status
24563WDI_ProcessWakeReasonInd
24564(
24565 WDI_ControlBlockType* pWDICtx,
24566 WDI_EventInfoType* pEventData
24567)
24568{
24569 WDI_LowLevelIndType *pWdiInd;
24570 tpWakeReasonParams pWakeReasonParams;
24571 wpt_uint32 allocSize = 0;
24572
24573 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24574 "+%s", __FUNCTION__);
24575
24576 /*-------------------------------------------------------------------------
24577 Sanity check
24578 -------------------------------------------------------------------------*/
24579 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24580 ( NULL == pEventData->pEventData ))
24581 {
24582 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24583 "%s: Invalid parameters", __FUNCTION__);
24584 WDI_ASSERT( 0 );
24585 return WDI_STATUS_E_FAILURE;
24586 }
24587
24588 /*-------------------------------------------------------------------------
24589 Extract indication and send it to UMAC
24590 -------------------------------------------------------------------------*/
24591 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
24592
24593 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
24594
24595 //Allocate memory for WDI_WakeReasonIndType structure
24596 pWdiInd = wpalMemoryAllocate(allocSize) ;
24597
24598 if(NULL == pWdiInd)
24599 {
24600 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24601 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
24602 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
24603 WDI_ASSERT(0);
24604 return WDI_STATUS_E_FAILURE;
24605 }
24606
24607 wpalMemoryZero(pWdiInd, allocSize);
24608
24609 /* Fill in the indication parameters*/
24610 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
24611 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
24612 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
24613 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
24614 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
24615 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
24616 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
24617 &(pWakeReasonParams->aDataStart[0]),
24618 pWakeReasonParams->ulStoredDataLen);
24619
24620 /*Notify UMAC*/
24621 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
24622
24623 //Free memory allocated for WDI_WakeReasonIndType structure
24624 wpalMemoryFree(pWdiInd);
24625
24626 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24627 "-%s", __FUNCTION__);
24628
24629 return WDI_STATUS_SUCCESS;
24630}
24631#endif // WLAN_WAKEUP_EVENTS
24632
24633void WDI_GetWcnssCompiledApiVersion
24634(
24635 WDI_WlanVersionType *pWcnssApiVersion
24636)
24637{
24638 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
24639 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
24640 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
24641 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
24642}
24643
24644/**
24645 @brief Process Set TM Level Rsp function (called when a
24646 response is being received over the bus from HAL)
24647
24648 @param pWDICtx: pointer to the WLAN DAL context
24649 pEventData: pointer to the event information structure
24650
24651 @see
24652 @return Result of the function call
24653*/
24654WDI_Status
24655WDI_ProcessSetTmLevelRsp
24656(
24657 WDI_ControlBlockType* pWDICtx,
24658 WDI_EventInfoType* pEventData
24659)
24660{
24661 WDI_Status wdiStatus;
24662 eHalStatus halStatus;
24663 WDI_SetTmLevelCb wdiSetTmLevelCb;
24664 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24665
24666 /*-------------------------------------------------------------------------
24667 Sanity check
24668 -------------------------------------------------------------------------*/
24669 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24670 ( NULL == pEventData->pEventData ))
24671 {
24672 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24673 "%s: Invalid parameters", __FUNCTION__);
24674 WDI_ASSERT(0);
24675 return WDI_STATUS_E_FAILURE;
24676 }
24677
24678 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
24679
24680 /*-------------------------------------------------------------------------
24681 Extract response and send it to UMAC
24682 -------------------------------------------------------------------------*/
24683 halStatus = *((eHalStatus*)pEventData->pEventData);
24684 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24685
24686 /*Notify UMAC*/
24687 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
24688
24689 return WDI_STATUS_SUCCESS;
24690}/*WDI_ProcessSetTmLevelRsp*/
24691
24692/**
24693 @brief Process Set Thermal Mitigation level Changed request
24694
24695 @param pWDICtx: pointer to the WLAN DAL context
24696 pEventData: pointer to the event information structure
24697
24698 @see
24699 @return Result of the function call
24700*/
24701WDI_Status
24702WDI_ProcessSetTmLevelReq
24703(
24704 WDI_ControlBlockType* pWDICtx,
24705 WDI_EventInfoType* pEventData
24706)
24707{
24708 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
24709 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
24710 wpt_uint8* pSendBuffer = NULL;
24711 wpt_uint16 usDataOffset = 0;
24712 wpt_uint16 usSendSize = 0;
24713 tSetThermalMitgationType halTmMsg;
24714
24715 /*-------------------------------------------------------------------------
24716 Sanity check
24717 -------------------------------------------------------------------------*/
24718 if (( NULL == pEventData ) ||
24719 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
24720 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
24721 {
24722 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24723 "%s: Invalid parameters", __FUNCTION__);
24724 WDI_ASSERT(0);
24725 return WDI_STATUS_E_FAILURE;
24726 }
24727
24728 /*-----------------------------------------------------------------------
24729 Get message buffer
24730 -----------------------------------------------------------------------*/
24731 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
24732 sizeof(halTmMsg),
24733 &pSendBuffer, &usDataOffset, &usSendSize))||
24734 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
24735 {
24736 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24737 "Unable to get send buffer in Set PNO req %x %x %x",
24738 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
24739 WDI_ASSERT(0);
24740 return WDI_STATUS_E_FAILURE;
24741 }
24742
24743 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
24744 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
24745
24746 wpalMemoryCopy( pSendBuffer+usDataOffset,
24747 &halTmMsg,
24748 sizeof(halTmMsg));
24749
24750 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
24751 pWDICtx->pfncRspCB = NULL;
24752 /*-------------------------------------------------------------------------
24753 Send Get STA Request to HAL
24754 -------------------------------------------------------------------------*/
24755 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24756 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
24757}
24758
24759/* Fill the value from the global features enabled array to the global capabilities
24760 * bitmap struct
24761 */
24762static void
24763FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
24764{
24765 wpt_int8 i;
24766 for (i=0; i<len; i++)
24767 {
24768 setFeatCaps(fCaps, enabledFeat[i]);
24769 }
24770}
24771
24772/**
24773 @brief WDI_featureCapsExchangeReq
24774 Post feature capability bitmap exchange event.
24775 Host will send its own capability to FW in this req and
24776 expect FW to send its capability back as a bitmap in Response
24777
24778 @param
24779
24780 wdiFeatureCapsExchangeCb: callback called on getting the response.
24781 It is kept to mantain similarity between WDI reqs and if needed, can
24782 be used in future. Currently, It is set to NULL
24783
24784 pUserData: user data will be passed back with the
24785 callback
24786
24787 @see
24788 @return Result of the function call
24789*/
24790WDI_Status
24791WDI_featureCapsExchangeReq
24792(
24793 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
24794 void* pUserData
24795)
24796{
24797 WDI_EventInfoType wdiEventData;
24798 wpt_int32 fCapsStructSize;
24799
24800 /*------------------------------------------------------------------------
24801 Sanity Check
24802 ------------------------------------------------------------------------*/
24803 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24804 {
24805 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24806 "WDI API call before module is initialized - Fail request");
24807
24808 return WDI_STATUS_E_NOT_ALLOWED;
24809 }
24810
24811 /* Allocate memory separately for global variable carrying FW caps */
24812 fCapsStructSize = sizeof(tWlanFeatCaps);
24813 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24814 if ( NULL == gpHostWlanFeatCaps )
24815 {
24816 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24817 "Cannot allocate memory for host capability info\n");
24818 WDI_ASSERT(0);
24819 return WDI_STATUS_MEM_FAILURE;
24820 }
24821
24822 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
24823
24824 /*------------------------------------------------------------------------
24825 Fill in Event data and post to the Main FSM
24826 ------------------------------------------------------------------------*/
24827 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
24828 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
Jeff Johnsone7245742012-09-05 17:12:55 -070024829 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24830 "Host caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024831 gpHostWlanFeatCaps->featCaps[0],
24832 gpHostWlanFeatCaps->featCaps[1],
24833 gpHostWlanFeatCaps->featCaps[2],
24834 gpHostWlanFeatCaps->featCaps[3]
24835 );
24836
24837 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
24838 wdiEventData.pEventData = gpHostWlanFeatCaps;
24839 wdiEventData.uEventDataSize = fCapsStructSize;
24840 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
24841 wdiEventData.pUserData = pUserData;
24842
24843 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24844}
24845
24846/**
24847 @brief Process Host-FW Capability Exchange Request function
24848
24849 @param pWDICtx: pointer to the WLAN DAL context
24850 pEventData: pointer to the event information structure
24851
24852 @see
24853 @return Result of the function call
24854*/
24855WDI_Status
24856WDI_ProcessFeatureCapsExchangeReq
24857(
24858 WDI_ControlBlockType* pWDICtx,
24859 WDI_EventInfoType* pEventData
24860)
24861{
24862 wpt_uint8* pSendBuffer = NULL;
24863 wpt_uint16 usDataOffset = 0;
24864 wpt_uint16 usSendSize = 0;
24865 wpt_uint16 usLen = 0;
24866
24867 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24868
24869 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24870 "%s", __FUNCTION__);
24871
24872 /*-------------------------------------------------------------------------
24873 Sanity check
24874 -------------------------------------------------------------------------*/
24875 /* Call back function is NULL since not required for cap exchange req */
24876 if (( NULL == pEventData ) ||
24877 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
24878 {
24879 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24880 "%s: Invalid parameters", __FUNCTION__);
24881 WDI_ASSERT(0);
24882 return WDI_STATUS_E_FAILURE;
24883 }
24884
24885 /*-----------------------------------------------------------------------
24886 Get message buffer
24887 -----------------------------------------------------------------------*/
24888 usLen = sizeof(tWlanFeatCaps);
24889
24890 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
24891 WDI_FEATURE_CAPS_EXCHANGE_REQ,
24892 usLen,
24893 &pSendBuffer, &usDataOffset, &usSendSize))||
24894 ( usSendSize < (usDataOffset + usLen )))
24895 {
24896 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24897 "Unable to get send buffer in feat caps exchange req %x %x",
24898 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
24899 WDI_ASSERT(0);
24900 return WDI_STATUS_E_FAILURE;
24901 }
24902
24903 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070024904 "Host Caps - %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024905 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
24906 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
24907 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
24908 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
24909 );
24910
24911 /* Copy host caps after the offset in the send buffer */
24912 wpalMemoryCopy( pSendBuffer+usDataOffset,
24913 (tWlanFeatCaps *)pEventData->pEventData,
24914 usLen);
24915
24916 /*-------------------------------------------------------------------------
24917 Send Start Request to HAL
24918 -------------------------------------------------------------------------*/
24919 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24920 (WDI_StartRspCb)pEventData->pCBfnc,
24921 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
24922
24923}/*WDI_ProcessFeatureCapsExchangeReq*/
24924
24925/**
24926 @brief Process Host-FW Capability Exchange Response function
24927
24928 @param pWDICtx: pointer to the WLAN DAL context
24929 pEventData: pointer to the event information structure
24930
24931 @see
24932 @return Result of the function call
24933*/
24934WDI_Status
24935WDI_ProcessFeatureCapsExchangeRsp
24936(
24937 WDI_ControlBlockType* pWDICtx,
24938 WDI_EventInfoType* pEventData
24939)
24940{
24941 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
24942 wpt_int32 fCapsStructSize;
24943 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24944
24945 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24946 "%s", __FUNCTION__);
24947
24948 /*-------------------------------------------------------------------------
24949 Sanity check
24950 -------------------------------------------------------------------------*/
24951 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24952 ( NULL == pEventData->pEventData ))
24953 {
24954 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24955 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24956 "%s: Invalid parameters", __FUNCTION__);
24957 WDI_ASSERT(0);
24958 return WDI_STATUS_E_FAILURE;
24959 }
24960
24961 /* Allocate memory separately for global variable carrying FW caps */
24962 fCapsStructSize = sizeof(tWlanFeatCaps);
24963 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24964 if ( NULL == gpFwWlanFeatCaps )
24965 {
24966 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24967 "Cannot allocate memory for host capability info\n");
24968 WDI_ASSERT(0);
24969 return WDI_STATUS_MEM_FAILURE;
24970 }
24971
24972 /*-------------------------------------------------------------------------
24973 Unpack HAL Response Message - the header was already extracted by the
24974 main Response Handling procedure
24975 -------------------------------------------------------------------------*/
24976 /*-------------------------------------------------------------------------
24977 Extract response and send it to UMAC
24978 -------------------------------------------------------------------------*/
24979
24980 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
24981 fCapsStructSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070024982 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24983 "FW caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024984 gpFwWlanFeatCaps->featCaps[0],
24985 gpFwWlanFeatCaps->featCaps[1],
24986 gpFwWlanFeatCaps->featCaps[2],
24987 gpFwWlanFeatCaps->featCaps[3]
24988 );
Jeff Johnsone7245742012-09-05 17:12:55 -070024989
Jeff Johnson295189b2012-06-20 16:38:30 -070024990 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
24991
24992 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
24993 if (wdiFeatureCapsExchangeCb != NULL)
24994 wdiFeatureCapsExchangeCb(NULL, NULL);
24995
24996 return WDI_STATUS_SUCCESS;
24997}
24998
Mohit Khanna4a70d262012-09-11 16:30:12 -070024999#ifdef WLAN_FEATURE_11AC
25000WDI_Status
25001WDI_ProcessUpdateVHTOpModeRsp
25002(
25003 WDI_ControlBlockType* pWDICtx,
25004 WDI_EventInfoType* pEventData
25005)
25006{
25007 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
25008 WDI_Status wdiStatus;
25009 eHalStatus halStatus;
25010
25011 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
25012
25013 /*-------------------------------------------------------------------------
25014 Sanity check
25015 -------------------------------------------------------------------------*/
25016 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
25017 ( NULL == pEventData->pEventData))
25018 {
25019 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25020 "%s: Invalid parameters", __FUNCTION__);
25021 WDI_ASSERT(0);
25022 return WDI_STATUS_E_FAILURE;
25023 }
25024 wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc;
25025
25026 /*-------------------------------------------------------------------------
25027 Extract response and send it to UMAC
25028 -------------------------------------------------------------------------*/
25029 halStatus = *((eHalStatus*)pEventData->pEventData);
25030 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
25031
25032 /*Notify UMAC*/
25033 wdiVHTOpModeCb( wdiStatus, pEventData->pUserData);
25034
25035 return WDI_STATUS_SUCCESS;
25036}
25037#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070025038/**
25039 @brief WDI_getHostWlanFeatCaps
25040 WDI API that returns whether the feature passed to it as enum value in
25041 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
25042 variable storing host capability bitmap to find this. This can be used by
25043 other moduels to decide certain things like call different APIs based on
25044 whether a particular feature is supported.
25045
25046 @param
25047
25048 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
25049
25050 @see
25051 @return
25052 0 - if the feature is NOT supported in host
25053 any non-zero value - if the feature is SUPPORTED in host.
25054*/
25055wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
25056{
25057 wpt_uint8 featSupported = 0;
25058 if (gpHostWlanFeatCaps != NULL)
25059 {
25060 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
25061 }
25062 else
25063 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025064 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070025065 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070025066 }
25067 return featSupported;
25068}
25069
25070/**
25071 @brief WDI_getFwWlanFeatCaps
25072 WDI API that returns whether the feature passed to it as enum value in
25073 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
25074 variable storing host capability bitmap to find this. This can be used by
25075 other moduels to decide certain things like call different APIs based on
25076 whether a particular feature is supported.
25077
25078 @param
25079
25080 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
25081 in wlan_hal_msg.h.
25082
25083 @see
25084 @return
25085 0 - if the feature is NOT supported in FW
25086 any non-zero value - if the feature is SUPPORTED in FW.
25087*/
25088wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
25089{
25090 wpt_uint8 featSupported = 0;
25091 if (gpFwWlanFeatCaps != NULL)
25092 {
25093 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
25094 }
25095 else
25096 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025097 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070025098 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070025099 }
25100 return featSupported;
25101}
Mohit Khanna4a70d262012-09-11 16:30:12 -070025102
25103#ifdef WLAN_FEATURE_11AC
25104WDI_Status
25105WDI_ProcessUpdateVHTOpModeReq
25106(
25107 WDI_ControlBlockType* pWDICtx,
25108 WDI_EventInfoType* pEventData
25109)
25110{
25111 WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL;
25112 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
25113 wpt_uint8* pSendBuffer = NULL;
25114 wpt_uint16 usDataOffset = 0;
25115 wpt_uint16 usSendSize = 0;
25116
25117 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
25118
25119 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
25120 "%s", __FUNCTION__);
25121
25122 /*-------------------------------------------------------------------------
25123 Sanity check
25124 -------------------------------------------------------------------------*/
25125 if (( NULL == pEventData ) ||
25126 ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) ||
25127 ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc)))
25128 {
25129 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25130 "%s: Invalid parameters", __FUNCTION__);
25131 WDI_ASSERT(0);
25132 return WDI_STATUS_E_FAILURE;
25133 }
25134
25135 /*-----------------------------------------------------------------------
25136 Get message buffer
25137 -----------------------------------------------------------------------*/
25138 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ,
25139 sizeof(WDI_UpdateVHTOpMode),
25140 &pSendBuffer, &usDataOffset, &usSendSize))||
25141 ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) )))
25142 {
25143 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25144 "Unable to get send buffer in update vht opMode req");
25145 WDI_ASSERT(0);
25146 return WDI_STATUS_E_FAILURE;
25147 }
25148
25149 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25150 "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId);
25151
25152 wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams,
25153 sizeof(WDI_UpdateVHTOpMode));
25154
25155 /*-------------------------------------------------------------------------
25156 Send Start Request to HAL
25157 -------------------------------------------------------------------------*/
25158 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
25159 wdiVHTOpModeCb,
25160 pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP);
25161
25162}
25163
25164WDI_Status
25165WDI_UpdateVHTOpModeReq
25166(
25167 WDI_UpdateVHTOpMode *pData,
25168 WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb,
25169 void* pUserData
25170)
25171{
25172 WDI_EventInfoType wdiEventData;
25173
25174 /*------------------------------------------------------------------------
25175 Sanity Check
25176 ------------------------------------------------------------------------*/
25177 if ( eWLAN_PAL_FALSE == gWDIInitialized )
25178 {
25179 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
25180 "WDI API call before module is initialized - Fail request");
25181
25182 return WDI_STATUS_E_NOT_ALLOWED;
25183 }
25184
25185 /*------------------------------------------------------------------------
25186 Fill in Event data and post to the Main FSM
25187 ------------------------------------------------------------------------*/
25188 wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ;
25189 wdiEventData.pEventData = pData;
25190 wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode);
25191 wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb;
25192 wdiEventData.pUserData = pUserData;
25193
25194 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25195 "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId);
25196
25197 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
25198
25199}
25200#endif
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025201
25202/**
25203 @brief WDI_TransportChannelDebug -
25204 Display DXE Channel debugging information
25205 User may request to display DXE channel snapshot
25206 Or if host driver detects any abnormal stcuk may display
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025207
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025208 @param displaySnapshot : Dispaly DXE snapshot option
25209 @param enableStallDetect : Enable stall detect feature
25210 This feature will take effect to data performance
25211 Not integrate till fully verification
25212 @see
25213 @return none
25214*/
25215void WDI_TransportChannelDebug
25216(
25217 wpt_boolean displaySnapshot,
25218 wpt_boolean toggleStallDetect
25219)
25220{
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025221 WDTS_ChannelDebug(displaySnapshot, toggleStallDetect);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025222 return;
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -070025223}