blob: b70ac328095aa9de8fd189c2845889de8ac0c3ef [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 */
Madan Mohan Koyyalamudidfd6aa82012-10-18 20:18:43 -0700103static tWlanFeatCaps *gpHostWlanFeatCaps;
Jeff Johnson295189b2012-06-20 16:38:30 -0700104/* FW capability bitmap global */
Madan Mohan Koyyalamudidfd6aa82012-10-18 20:18:43 -0700105static tWlanFeatCaps *gpFwWlanFeatCaps;
Jeff Johnson295189b2012-06-20 16:38:30 -0700106/* 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*/
Madan Mohan Koyyalamudia2fc6412012-10-21 12:06:12 -0700144 WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/
Jeff Johnson295189b2012-06-20 16:38:30 -0700145 }},
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 */
Madan Mohan Koyyalamudia208d102012-10-15 15:18:18 -07007440#ifdef WLAN_FEATURE_11AC
7441 if (WDI_getFwWlanFeatCaps(DOT11AC))
7442 WDI_CopyWDIConfigBSSToHALConfigBSS( (tConfigBssParams*)&halConfigBssReqMsg.uBssParams.configBssParams_V1,
7443 &pwdiConfigBSSParams->wdiReqInfo);
7444 else
7445#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07007446 WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07007447 &pwdiConfigBSSParams->wdiReqInfo);
7448
7449 /* Need to fill in the STA Index to invalid, since at this point we have not
7450 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -07007451 halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -07007452
7453 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007454 halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx;
7455
7456 wpalMemoryCopy( pSendBuffer+usDataOffset,
7457 &halConfigBssReqMsg.uBssParams.configBssParams,
7458 uMsgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07007459
7460 pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007461 pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007462
7463 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007464 Send Config BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007465 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007466 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
7467 wdiConfigBSSRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07007468 WDI_CONFIG_BSS_RESP);
7469
7470}/*WDI_ProcessConfigBSSReq*/
7471
7472
7473/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007474 @brief Process Del BSS Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007475 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007476
7477 @param pWDICtx: pointer to the WLAN DAL context
7478 pEventData: pointer to the event information structure
7479
Jeff Johnson295189b2012-06-20 16:38:30 -07007480 @see
7481 @return Result of the function call
7482*/
7483WDI_Status
7484WDI_ProcessDelBSSReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007485(
Jeff Johnson295189b2012-06-20 16:38:30 -07007486 WDI_ControlBlockType* pWDICtx,
7487 WDI_EventInfoType* pEventData
7488)
7489{
7490 WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL;
7491 WDI_DelBSSRspCb wdiDelBSSRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007492 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007493 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007494 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007495 wpt_uint16 usDataOffset = 0;
7496 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007497 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007498
Jeff Johnsone7245742012-09-05 17:12:55 -07007499 tDeleteBssReqMsg halBssReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007500 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7501
7502 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007503 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007504 -------------------------------------------------------------------------*/
7505 if (( NULL == pEventData ) ||
7506 ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) ||
7507 ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc)))
7508 {
7509 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7510 "%s: Invalid parameters", __FUNCTION__);
7511 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007512 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007513 }
7514
7515 /*-------------------------------------------------------------------------
7516 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007517 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007518 -------------------------------------------------------------------------*/
7519 wpalMutexAcquire(&pWDICtx->wptMutex);
7520
7521 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007522 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007523 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007524 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7525 pwdiDelBSSParams->ucBssIdx,
7526 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007527
Jeff Johnsone7245742012-09-05 17:12:55 -07007528 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007529 {
7530 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007531 "%s: BSS does not yet exist. ucBssIdx %d",
7532 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007533
7534 wpalMutexRelease(&pWDICtx->wptMutex);
7535
Jeff Johnsone7245742012-09-05 17:12:55 -07007536 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007537 }
7538
7539 /*------------------------------------------------------------------------
7540 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007541 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007542 ------------------------------------------------------------------------*/
7543 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7544 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007545 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7546 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
7547 __func__, pwdiDelBSSParams->ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007548
Jeff Johnsone7245742012-09-05 17:12:55 -07007549 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007550
7551 wpalMutexRelease(&pWDICtx->wptMutex);
7552
Jeff Johnsone7245742012-09-05 17:12:55 -07007553 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007554 }
7555
7556 /*-----------------------------------------------------------------------
7557 If we receive a Del BSS request for an association that is already in
7558 progress, it indicates that the assoc has failed => we no longer have
7559 an association in progress => we must check for pending associations
Jeff Johnsone7245742012-09-05 17:12:55 -07007560 that were queued and start as soon as the Del BSS response is received
Jeff Johnson295189b2012-06-20 16:38:30 -07007561 -----------------------------------------------------------------------*/
7562 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
7563 {
7564 /*We can switch to false here because even if a subsequent Join comes in
7565 it will only be processed when DAL transitions out of BUSY state which
7566 happens when the Del BSS request comes */
7567 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
7568
7569 /*Former association is complete - prepare next pending assoc for
7570 processing */
7571 WDI_DequeueAssocRequest(pWDICtx);
7572 }
7573
7574 wpalMutexRelease(&pWDICtx->wptMutex);
7575 /*-----------------------------------------------------------------------
7576 Get message buffer
7577 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007578 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007579 sizeof(halBssReqMsg.deleteBssParams),
7580 &pSendBuffer, &usDataOffset, &usSendSize))||
7581 ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) )))
7582 {
7583 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7584 "Unable to get send buffer in start req %x %x %x",
7585 pEventData, pwdiDelBSSParams, wdiDelBSSRspCb);
7586 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007587 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007588 }
7589
7590 /*Fill in the message request structure*/
7591
7592 /*BSS Index is saved on config BSS response and Post Assoc Response */
Jeff Johnsone7245742012-09-05 17:12:55 -07007593 halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07007594
Jeff Johnsone7245742012-09-05 17:12:55 -07007595 wpalMemoryCopy( pSendBuffer+usDataOffset,
7596 &halBssReqMsg.deleteBssParams,
7597 sizeof(halBssReqMsg.deleteBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007598
7599 pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007600 pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007601
Jeff Johnsone7245742012-09-05 17:12:55 -07007602
Jeff Johnson295189b2012-06-20 16:38:30 -07007603 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007604 Send Del BSS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007605 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007606 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007607 wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP);
7608
Jeff Johnsone7245742012-09-05 17:12:55 -07007609
Jeff Johnson295189b2012-06-20 16:38:30 -07007610}/*WDI_ProcessDelBSSReq*/
7611
7612/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007613 @brief Process Post Assoc Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07007614 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007615
7616 @param pWDICtx: pointer to the WLAN DAL context
7617 pEventData: pointer to the event information structure
7618
Jeff Johnson295189b2012-06-20 16:38:30 -07007619 @see
7620 @return Result of the function call
7621*/
7622WDI_Status
7623WDI_ProcessPostAssocReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007624(
Jeff Johnson295189b2012-06-20 16:38:30 -07007625 WDI_ControlBlockType* pWDICtx,
7626 WDI_EventInfoType* pEventData
7627)
7628{
7629 WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL;
7630 WDI_PostAssocRspCb wdiPostAssocRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007631 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007632 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007633 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007634 wpt_uint16 usDataOffset = 0;
7635 wpt_uint16 usSendSize = 0;
7636 wpt_uint16 uMsgSize = 0;
7637 wpt_uint16 uOffset = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007638 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007639
Jeff Johnsone7245742012-09-05 17:12:55 -07007640 tPostAssocReqMsg halPostAssocReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007641 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7642
7643 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007644 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007645 -------------------------------------------------------------------------*/
7646 if (( NULL == pEventData ) ||
7647 ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) ||
7648 ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc)))
7649 {
7650 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7651 "%s: Invalid parameters", __FUNCTION__);
7652 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007653 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007654 }
7655
7656 /*-------------------------------------------------------------------------
7657 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007658 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007659 -------------------------------------------------------------------------*/
7660 wpalMutexAcquire(&pWDICtx->wptMutex);
7661
7662 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007663 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007664 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007665 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
7666 pwdiPostAssocParams->wdiBSSParams.macBSSID,
7667 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007668
7669 if ( NULL == pBSSSes )
7670 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007671 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7672 "%s: Association sequence for this BSS does not yet exist - "
7673 "operation not allowed. macBSSID " MAC_ADDRESS_STR,
7674 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007675
7676 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007677 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007678 }
7679
7680 /*------------------------------------------------------------------------
7681 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007682 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007683 ------------------------------------------------------------------------*/
7684 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7685 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007686 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7687 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7688 __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007689
Jeff Johnsone7245742012-09-05 17:12:55 -07007690 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007691
7692 wpalMutexRelease(&pWDICtx->wptMutex);
7693
Jeff Johnsone7245742012-09-05 17:12:55 -07007694 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007695 }
7696
7697 /*-----------------------------------------------------------------------
7698 If Post Assoc was not yet received - the current association must
7699 be in progress
7700 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007701 if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -07007702 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
7703 {
7704 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7705 "Association sequence for this BSS association no longer in "
7706 "progress - not allowed");
7707
7708 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007709 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007710 }
7711
7712 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007713 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -07007714 -----------------------------------------------------------------------*/
7715 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
7716 {
7717 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7718 "Post Assoc not allowed before JOIN - failing request");
7719
7720 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007721 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007722 }
7723
7724 wpalMutexRelease(&pWDICtx->wptMutex);
7725
7726 uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) +
7727 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ;
7728 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007729 Fill message for tx over the bus
Jeff Johnson295189b2012-06-20 16:38:30 -07007730 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007731 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007732 uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))||
7733 ( usSendSize < (usDataOffset + uMsgSize )))
7734 {
7735 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7736 "Unable to get send buffer in start req %x %x %x",
7737 pEventData, pwdiPostAssocParams, wdiPostAssocRspCb);
7738 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007739 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007740 }
7741
7742 /*Copy the STA parameters */
7743 WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams,
7744 &pwdiPostAssocParams->wdiSTAParams );
7745
7746 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007747 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007748 WDI_STATableFindStaidByAddr(pWDICtx,
7749 pwdiPostAssocParams->wdiSTAParams.macSTA,
7750 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx ))
7751 {
7752 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7753 "This station does not exist in the WDI Station Table %d");
7754 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007755 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007756 }
7757
7758 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007759 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007760 pBSSSes->ucBSSIdx;
7761
7762 /*Copy the BSS parameters */
7763 WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7764 &pwdiPostAssocParams->wdiBSSParams);
7765
7766 /* Need to fill in the STA index of the peer */
Jeff Johnsone7245742012-09-05 17:12:55 -07007767 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -07007768 WDI_STATableFindStaidByAddr(pWDICtx,
7769 pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -07007770 (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx))
Jeff Johnson295189b2012-06-20 16:38:30 -07007771 {
7772 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7773 "This station does not exist in the WDI Station Table %d");
7774 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007775 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007776 }
7777
7778 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -07007779 halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07007780 pBSSSes->ucBSSIdx;
7781
Jeff Johnsone7245742012-09-05 17:12:55 -07007782
7783 wpalMemoryCopy( pSendBuffer+usDataOffset,
7784 &halPostAssocReqMsg.postAssocReqParams.configStaParams,
7785 sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007786
7787 uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams);
7788
Jeff Johnsone7245742012-09-05 17:12:55 -07007789 wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset,
7790 &halPostAssocReqMsg.postAssocReqParams.configBssParams,
7791 sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007792
Jeff Johnsone7245742012-09-05 17:12:55 -07007793
Jeff Johnson295189b2012-06-20 16:38:30 -07007794 pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007795 pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007796
Jeff Johnsone7245742012-09-05 17:12:55 -07007797
7798 wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq,
Jeff Johnson295189b2012-06-20 16:38:30 -07007799 pwdiPostAssocParams,
Jeff Johnsone7245742012-09-05 17:12:55 -07007800 sizeof(pWDICtx->wdiCachedPostAssocReq));
Jeff Johnson295189b2012-06-20 16:38:30 -07007801
7802 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007803 Send Post Assoc Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007804 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007805 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007806 wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP);
7807
Jeff Johnsone7245742012-09-05 17:12:55 -07007808
Jeff Johnson295189b2012-06-20 16:38:30 -07007809}/*WDI_ProcessPostAssocReq*/
7810
7811/**
Jeff Johnsone7245742012-09-05 17:12:55 -07007812 @brief Process Del STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07007813 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007814
7815 @param pWDICtx: pointer to the WLAN DAL context
7816 pEventData: pointer to the event information structure
7817
Jeff Johnson295189b2012-06-20 16:38:30 -07007818 @see
7819 @return Result of the function call
7820*/
7821WDI_Status
7822WDI_ProcessDelSTAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007823(
Jeff Johnson295189b2012-06-20 16:38:30 -07007824 WDI_ControlBlockType* pWDICtx,
7825 WDI_EventInfoType* pEventData
7826)
7827{
7828 WDI_DelSTAReqParamsType* pwdiDelSTAParams;
7829 WDI_DelSTARspCb wdiDelSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007830 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007831 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007832 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007833 wpt_uint16 usDataOffset = 0;
7834 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007835 wpt_macAddr macBSSID;
Jeff Johnson295189b2012-06-20 16:38:30 -07007836 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
7837
Jeff Johnsone7245742012-09-05 17:12:55 -07007838 tDeleteStaReqMsg halDelStaReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -07007839 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7840
7841 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007842 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007843 -------------------------------------------------------------------------*/
7844 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7845 ( NULL == pEventData->pCBfnc ))
7846 {
7847 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7848 "%s: Invalid parameters", __FUNCTION__);
7849 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007850 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007851 }
7852
7853 pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData;
7854 wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc;
7855 /*-------------------------------------------------------------------------
7856 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007857 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007858 -------------------------------------------------------------------------*/
7859 wpalMutexAcquire(&pWDICtx->wptMutex);
7860
7861 /*------------------------------------------------------------------------
7862 Find the BSS for which the request is made and identify WDI session
7863 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007864 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
7865 pwdiDelSTAParams->ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07007866 &macBSSID))
7867 {
7868 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7869 "This station does not exist in the WDI Station Table %d");
7870 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007871 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007872 }
7873
Jeff Johnsone7245742012-09-05 17:12:55 -07007874 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
7875 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007876 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007877 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
7878 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
7879 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007880
7881 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007882 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07007883 }
7884
7885 /*------------------------------------------------------------------------
7886 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07007887 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07007888 ------------------------------------------------------------------------*/
7889 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
7890 {
Jeff Johnsone7245742012-09-05 17:12:55 -07007891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7892 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
7893 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07007894
Jeff Johnsone7245742012-09-05 17:12:55 -07007895 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07007896 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07007897 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07007898 }
7899
7900 wpalMutexRelease(&pWDICtx->wptMutex);
7901 /*-----------------------------------------------------------------------
7902 Get message buffer
7903 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007904 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07007905 sizeof(halDelStaReqMsg.delStaParams),
7906 &pSendBuffer, &usDataOffset, &usSendSize))||
7907 ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) )))
7908 {
7909 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7910 "Unable to get send buffer in start req %x %x %x",
7911 pEventData, pwdiDelSTAParams, wdiDelSTARspCb);
7912 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007913 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007914 }
7915
Jeff Johnsone7245742012-09-05 17:12:55 -07007916 halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx;
7917 wpalMemoryCopy( pSendBuffer+usDataOffset,
7918 &halDelStaReqMsg.delStaParams,
7919 sizeof(halDelStaReqMsg.delStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07007920
7921 pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07007922 pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07007923
7924 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007925 Send Del STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07007926 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007927 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07007928 wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP);
7929
7930}/*WDI_ProcessDelSTAReq*/
7931
7932
7933/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07007934 SECURITY REQUEST PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -07007935==========================================================================*/
7936/**
7937 @brief Process Set BSS Key Request function (called when Main FSM
7938 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07007939
7940 @param pWDICtx: pointer to the WLAN DAL context
7941 pEventData: pointer to the event information structure
7942
Jeff Johnson295189b2012-06-20 16:38:30 -07007943 @see
7944 @return Result of the function call
7945*/
7946WDI_Status
7947WDI_ProcessSetBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07007948(
Jeff Johnson295189b2012-06-20 16:38:30 -07007949 WDI_ControlBlockType* pWDICtx,
7950 WDI_EventInfoType* pEventData
7951)
7952{
7953 WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams;
7954 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07007955 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07007956 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07007957 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07007958 wpt_uint16 usDataOffset = 0;
7959 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07007960 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07007961 tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}};
7962 wpt_uint8 keyIndex = 0;
7963
7964 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
7965
7966 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007967 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07007968 -------------------------------------------------------------------------*/
7969 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
7970 ( NULL == pEventData->pCBfnc ))
7971 {
7972 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
7973 "%s: Invalid parameters", __FUNCTION__);
7974 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07007975 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07007976 }
7977
7978 pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData;
7979 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc;
7980 /*-------------------------------------------------------------------------
7981 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07007982 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07007983 -------------------------------------------------------------------------*/
7984 wpalMutexAcquire(&pWDICtx->wptMutex);
7985
7986 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07007987 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07007988 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07007989 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
7990 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx,
7991 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07007992
Jeff Johnsone7245742012-09-05 17:12:55 -07007993 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07007994 {
7995 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07007996 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
7997 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07007998
7999 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008000 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008001 }
8002
8003 /*------------------------------------------------------------------------
8004 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008005 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008006 ------------------------------------------------------------------------*/
8007 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8008 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008009 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8010 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8011 __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008012
Jeff Johnsone7245742012-09-05 17:12:55 -07008013 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008014 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008015 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008016 }
8017
8018
8019 wpalMutexRelease(&pWDICtx->wptMutex);
8020 /*-----------------------------------------------------------------------
8021 Get message buffer
8022 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008023 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008024 sizeof(halSetBssKeyReqMsg.setBssKeyParams),
8025 &pSendBuffer, &usDataOffset, &usSendSize))||
8026 ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) )))
8027 {
8028 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8029 "Unable to get send buffer in set bss key req %x %x %x",
8030 pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb);
8031 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008032 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008033 }
8034
8035 /*-----------------------------------------------------------------------
8036 Copy the Key parameters into the HAL message
8037 -----------------------------------------------------------------------*/
8038
Jeff Johnsone7245742012-09-05 17:12:55 -07008039 halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008040
Jeff Johnsone7245742012-09-05 17:12:55 -07008041 halSetBssKeyReqMsg.setBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008042 WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType);
8043
Jeff Johnsone7245742012-09-05 17:12:55 -07008044 halSetBssKeyReqMsg.setBssKeyParams.numKeys =
Jeff Johnson295189b2012-06-20 16:38:30 -07008045 pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys;
8046
8047 for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ;
8048 keyIndex++)
8049 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008050 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008051 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId;
8052 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast =
8053 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast;
8054 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection =
8055 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection;
8056 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008057 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008058 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008059 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008060 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008061 halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008062 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength;
8063 wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008064 pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008065 WDI_MAX_KEY_LENGTH);
8066 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008067
8068 wpalMemoryCopy( pSendBuffer+usDataOffset,
8069 &halSetBssKeyReqMsg.setBssKeyParams,
8070 sizeof(halSetBssKeyReqMsg.setBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008071
8072 pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008073 pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008074
8075 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008076 Send Set BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008077 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008078 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8079 wdiSetBSSKeyRspCb, pEventData->pUserData,
8080 WDI_SET_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008081
8082}/*WDI_ProcessSetBssKeyReq*/
8083
8084/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008085 @brief Process Remove BSS Key Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07008086 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008087
8088 @param pWDICtx: pointer to the WLAN DAL context
8089 pEventData: pointer to the event information structure
8090
Jeff Johnson295189b2012-06-20 16:38:30 -07008091 @see
8092 @return Result of the function call
8093*/
8094WDI_Status
8095WDI_ProcessRemoveBssKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008096(
Jeff Johnson295189b2012-06-20 16:38:30 -07008097 WDI_ControlBlockType* pWDICtx,
8098 WDI_EventInfoType* pEventData
8099)
8100{
8101 WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams;
8102 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008103 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008104 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008105 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008106 wpt_uint16 usDataOffset = 0;
8107 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008108 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008109 tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}};
8110 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8111
8112 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008113 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008114 -------------------------------------------------------------------------*/
8115 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8116 ( NULL == pEventData->pCBfnc ))
8117 {
8118 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8119 "%s: Invalid parameters", __FUNCTION__);
8120 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008121 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008122 }
8123
8124 pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData;
8125 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc;
8126 /*-------------------------------------------------------------------------
8127 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008128 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008129 -------------------------------------------------------------------------*/
8130 wpalMutexAcquire(&pWDICtx->wptMutex);
8131
8132 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008133 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07008134 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008135 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
8136 pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx,
8137 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07008138
Jeff Johnsone7245742012-09-05 17:12:55 -07008139 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008140 {
8141 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008142 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
8143 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008144
8145 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008146 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008147 }
8148
8149 /*------------------------------------------------------------------------
8150 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008151 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008152 ------------------------------------------------------------------------*/
8153 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8154 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008155 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8156 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
8157 __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07008158
Jeff Johnsone7245742012-09-05 17:12:55 -07008159 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008160 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008161 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008162 }
8163
8164
8165 wpalMutexRelease(&pWDICtx->wptMutex);
8166
8167 /*-----------------------------------------------------------------------
8168 Get message buffer
8169 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008170 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008171 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams),
8172 &pSendBuffer, &usDataOffset, &usSendSize))||
8173 ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) )))
8174 {
8175 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8176 "Unable to get send buffer in set bss key req %x %x %x",
8177 pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb);
8178 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008179 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008180 }
8181 /*-----------------------------------------------------------------------
8182 Copy the Key parameters into the HAL message
8183 -----------------------------------------------------------------------*/
8184 halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx;
8185
Jeff Johnsone7245742012-09-05 17:12:55 -07008186 halRemoveBssKeyReqMsg.removeBssKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008187 WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType);
8188
8189 halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId;
8190
Jeff Johnsone7245742012-09-05 17:12:55 -07008191 halRemoveBssKeyReqMsg.removeBssKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008192 WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType);
8193
Jeff Johnsone7245742012-09-05 17:12:55 -07008194 wpalMemoryCopy( pSendBuffer+usDataOffset,
8195 &halRemoveBssKeyReqMsg.removeBssKeyParams,
8196 sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008197
8198 pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008199 pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008200
8201 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008202 Send Remove BSS Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008203 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008204 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008205 wdiRemoveBSSKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008206 WDI_RMV_BSS_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008207}/*WDI_ProcessRemoveBssKeyReq*/
8208
8209/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008210 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008211 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008212
8213 @param pWDICtx: pointer to the WLAN DAL context
8214 pEventData: pointer to the event information structure
8215
Jeff Johnson295189b2012-06-20 16:38:30 -07008216 @see
8217 @return Result of the function call
8218*/
8219WDI_Status
8220WDI_ProcessSetStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008221(
Jeff Johnson295189b2012-06-20 16:38:30 -07008222 WDI_ControlBlockType* pWDICtx,
8223 WDI_EventInfoType* pEventData
8224)
8225{
8226 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8227 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8228 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008229 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008230 wpt_uint16 usDataOffset = 0;
8231 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008232 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008233 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008234 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008235 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8236 wpt_uint8 keyIndex = 0;
8237
8238 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8239
8240 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008241 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008242 -------------------------------------------------------------------------*/
8243 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8244 ( NULL == pEventData->pCBfnc ))
8245 {
8246 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8247 "%s: Invalid parameters", __FUNCTION__);
8248 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008249 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008250 }
8251
8252 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8253 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8254 /*-------------------------------------------------------------------------
8255 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008256 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008257 -------------------------------------------------------------------------*/
8258 wpalMutexAcquire(&pWDICtx->wptMutex);
8259
8260 /*------------------------------------------------------------------------
8261 Find the BSS for which the request is made and identify WDI session
8262 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008263 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8264 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008265 &macBSSID))
8266 {
8267 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8268 "This station does not exist in the WDI Station Table %d");
8269 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008270 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008271 }
8272
Jeff Johnsone7245742012-09-05 17:12:55 -07008273 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8274 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008275 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008276 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8277 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8278 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008279
8280 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008281 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008282 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008283
Jeff Johnson295189b2012-06-20 16:38:30 -07008284 /*------------------------------------------------------------------------
8285 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008286 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008287 ------------------------------------------------------------------------*/
8288 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8289 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008290 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8291 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8292 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008293
Jeff Johnsone7245742012-09-05 17:12:55 -07008294 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008295 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008296 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008297 }
8298
8299
8300 wpalMutexRelease(&pWDICtx->wptMutex);
8301 /*-----------------------------------------------------------------------
8302 Get message buffer
8303 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008304 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008305 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8306 &pSendBuffer, &usDataOffset, &usSendSize))||
8307 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8308 {
8309 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8310 "Unable to get send buffer in set bss key req %x %x %x",
8311 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8312 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008313 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008314 }
8315 /*-----------------------------------------------------------------------
8316 Copy the STA Key parameters into the HAL message
8317 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008318 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008319 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8320
Jeff Johnsone7245742012-09-05 17:12:55 -07008321 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008322 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8323
8324 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8325
8326 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8327
8328 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8329
8330#ifdef WLAN_SOFTAP_FEATURE
8331 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8332 keyIndex++)
8333 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008334 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008335 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8336 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8337 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8338 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8339 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8340 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008341 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008342 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008343 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008344 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008345 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008346 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8347 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008348 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008349 WDI_MAX_KEY_LENGTH);
8350 }
8351#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008352 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008353 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8354 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8355 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8356 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8357 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8358 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008359 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008360 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008361 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008362 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008363 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008364 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8365 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008366 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008367 WDI_MAX_KEY_LENGTH);
8368#endif
8369
Jeff Johnsone7245742012-09-05 17:12:55 -07008370 wpalMemoryCopy( pSendBuffer+usDataOffset,
8371 &halSetStaKeyReqMsg.setStaKeyParams,
8372 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008373
8374 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008375 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008376
8377 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008378 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008379 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008380 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8381 wdiSetSTAKeyRspCb, pEventData->pUserData,
8382 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008383
8384}/*WDI_ProcessSetSTAKeyReq*/
8385
8386/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008387 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008388 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008389
8390 @param pWDICtx: pointer to the WLAN DAL context
8391 pEventData: pointer to the event information structure
8392
Jeff Johnson295189b2012-06-20 16:38:30 -07008393 @see
8394 @return Result of the function call
8395*/
8396WDI_Status
8397WDI_ProcessRemoveStaKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008398(
Jeff Johnson295189b2012-06-20 16:38:30 -07008399 WDI_ControlBlockType* pWDICtx,
8400 WDI_EventInfoType* pEventData
8401)
8402{
8403 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams;
8404 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8405 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008406 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008407 wpt_uint16 usDataOffset = 0;
8408 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008409 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008410 wpt_macAddr macBSSID;
8411 wpt_uint8 ucCurrentBSSSesIdx;
8412 tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}};
8413 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8414
8415 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008416 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008417 -------------------------------------------------------------------------*/
8418 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8419 ( NULL == pEventData->pCBfnc ))
8420 {
8421 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8422 "%s: Invalid parameters", __FUNCTION__);
8423 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008424 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008425 }
8426
8427 pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8428 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8429 /*-------------------------------------------------------------------------
8430 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008431 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008432 -------------------------------------------------------------------------*/
8433 wpalMutexAcquire(&pWDICtx->wptMutex);
8434
8435 /*------------------------------------------------------------------------
8436 Find the BSS for which the request is made and identify WDI session
8437 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008438 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8439 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008440 &macBSSID))
8441 {
8442 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8443 "This station does not exist in the WDI Station Table %d");
8444 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008445 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008446 }
8447
Jeff Johnsone7245742012-09-05 17:12:55 -07008448 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8449 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008450 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008451 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8452 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8453 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008454
8455 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008456 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008457 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008458
Jeff Johnson295189b2012-06-20 16:38:30 -07008459 /*------------------------------------------------------------------------
8460 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008461 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008462 ------------------------------------------------------------------------*/
8463 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8464 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008465 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8466 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8467 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008468
Jeff Johnsone7245742012-09-05 17:12:55 -07008469 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008470 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008471 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008472 }
8473
8474
8475
8476 wpalMutexRelease(&pWDICtx->wptMutex);
8477 /*-----------------------------------------------------------------------
8478 Get message buffer
8479 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008480 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008481 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams),
8482 &pSendBuffer, &usDataOffset, &usSendSize))||
8483 ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) )))
8484 {
8485 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8486 "Unable to get send buffer in set bss key req %x %x %x",
8487 pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb);
8488 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008489 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008490 }
8491
8492 /*-----------------------------------------------------------------------
8493 Copy the Key parameters into the HAL message
8494 -----------------------------------------------------------------------*/
8495
Jeff Johnsone7245742012-09-05 17:12:55 -07008496 halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008497 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8498
Jeff Johnsone7245742012-09-05 17:12:55 -07008499 halRemoveStaKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008500 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType);
8501
Jeff Johnsone7245742012-09-05 17:12:55 -07008502 halRemoveStaKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008503 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId;
8504
Jeff Johnsone7245742012-09-05 17:12:55 -07008505 halRemoveStaKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008506 pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast;
8507
Jeff Johnsone7245742012-09-05 17:12:55 -07008508 wpalMemoryCopy( pSendBuffer+usDataOffset,
8509 &halRemoveStaKeyReqMsg.removeStaKeyParams,
8510 sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008511
8512 pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008513 pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008514
8515 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008516 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008517 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008518 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008519 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008520 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008521
8522}/*WDI_ProcessRemoveSTAKeyReq*/
8523
8524/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008525 @brief Process Set STA KeyRequest function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07008526 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008527
8528 @param pWDICtx: pointer to the WLAN DAL context
8529 pEventData: pointer to the event information structure
8530
Jeff Johnson295189b2012-06-20 16:38:30 -07008531 @see
8532 @return Result of the function call
8533*/
8534WDI_Status
8535WDI_ProcessSetStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008536(
Jeff Johnson295189b2012-06-20 16:38:30 -07008537 WDI_ControlBlockType* pWDICtx,
8538 WDI_EventInfoType* pEventData
8539)
8540{
8541 WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams;
8542 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
8543 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008544 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008545 wpt_uint16 usDataOffset = 0;
8546 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008547 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008548 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -07008549 wpt_uint8 ucCurrentBSSSesIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07008550 tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}};
8551 wpt_uint8 keyIndex = 0;
8552
8553 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8554
8555 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008556 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008557 -------------------------------------------------------------------------*/
8558 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8559 ( NULL == pEventData->pCBfnc ))
8560 {
8561 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8562 "%s: Invalid parameters", __FUNCTION__);
8563 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008564 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008565 }
8566
8567 pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData;
8568 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc;
8569 /*-------------------------------------------------------------------------
8570 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008571 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008572 -------------------------------------------------------------------------*/
8573 wpalMutexAcquire(&pWDICtx->wptMutex);
8574
8575 /*------------------------------------------------------------------------
8576 Find the BSS for which the request is made and identify WDI session
8577 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008578 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8579 pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008580 &macBSSID))
8581 {
8582 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8583 "This station does not exist in the WDI Station Table %d");
8584 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008585 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008586 }
8587
Jeff Johnsone7245742012-09-05 17:12:55 -07008588 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8589 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008590 {
8591 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07008592 "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8593 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008594
8595 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008596 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008597 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008598
Jeff Johnson295189b2012-06-20 16:38:30 -07008599 /*------------------------------------------------------------------------
8600 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008601 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008602 ------------------------------------------------------------------------*/
8603 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8604 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008605 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8606 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8607 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008608
Jeff Johnsone7245742012-09-05 17:12:55 -07008609 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008610 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008611 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008612 }
8613
8614
8615 wpalMutexRelease(&pWDICtx->wptMutex);
8616 /*-----------------------------------------------------------------------
8617 Get message buffer
8618 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008619 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008620 sizeof(halSetStaKeyReqMsg.setStaKeyParams),
8621 &pSendBuffer, &usDataOffset, &usSendSize))||
8622 ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) )))
8623 {
8624 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8625 "Unable to get send buffer in set bss key req %x %x %x",
8626 pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb);
8627 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008628 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008629 }
8630 /*-----------------------------------------------------------------------
8631 Copy the STA Key parameters into the HAL message
8632 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008633 halSetStaKeyReqMsg.setStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008634 WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType);
8635
Jeff Johnsone7245742012-09-05 17:12:55 -07008636 halSetStaKeyReqMsg.setStaKeyParams.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008637 WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType );
8638
8639 halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx;
8640
8641 halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx;
8642
8643 halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc;
8644
8645#ifdef WLAN_SOFTAP_FEATURE
8646 for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ;
8647 keyIndex++)
8648 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008649 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008650 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId;
8651 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast =
8652 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast;
8653 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection =
8654 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection;
8655 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008656 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008657 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008658 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008659 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008660 halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008661 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength;
8662 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008663 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008664 WDI_MAX_KEY_LENGTH);
8665 }
8666#else
Jeff Johnsone7245742012-09-05 17:12:55 -07008667 halSetStaKeyReqMsg.setStaKeyParams.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008668 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId;
8669 halSetStaKeyReqMsg.setStaKeyParams.key.unicast =
8670 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast;
8671 halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection =
8672 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection;
8673 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -07008674 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -07008675 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -07008676 halSetStaKeyReqMsg.setStaKeyParams.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -07008677 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -07008678 halSetStaKeyReqMsg.setStaKeyParams.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -07008679 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength;
8680 wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -07008681 pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -07008682 WDI_MAX_KEY_LENGTH);
8683#endif
8684
Jeff Johnsone7245742012-09-05 17:12:55 -07008685 wpalMemoryCopy( pSendBuffer+usDataOffset,
8686 &halSetStaKeyReqMsg.setStaKeyParams,
8687 sizeof(halSetStaKeyReqMsg.setStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008688
8689 pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008690 pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008691
8692 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008693 Send Set STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008694 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008695 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
8696 wdiSetSTAKeyRspCb, pEventData->pUserData,
8697 WDI_SET_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008698
8699}/*WDI_ProcessSetSTABcastKeyReq*/
8700
8701/**
Jeff Johnsone7245742012-09-05 17:12:55 -07008702 @brief Process Remove STA Key Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -07008703 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008704
8705 @param pWDICtx: pointer to the WLAN DAL context
8706 pEventData: pointer to the event information structure
8707
Jeff Johnson295189b2012-06-20 16:38:30 -07008708 @see
8709 @return Result of the function call
8710*/
8711WDI_Status
8712WDI_ProcessRemoveStaBcastKeyReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008713(
Jeff Johnson295189b2012-06-20 16:38:30 -07008714 WDI_ControlBlockType* pWDICtx,
8715 WDI_EventInfoType* pEventData
8716)
8717{
8718 WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams;
8719 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
8720 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008721 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008722 wpt_uint16 usDataOffset = 0;
8723 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008724 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008725 wpt_macAddr macBSSID;
8726 wpt_uint8 ucCurrentBSSSesIdx;
8727 tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}};
8728 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8729
8730 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008731 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008732 -------------------------------------------------------------------------*/
8733 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8734 ( NULL == pEventData->pCBfnc ))
8735 {
8736 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8737 "%s: Invalid parameters", __FUNCTION__);
8738 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008739 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008740 }
8741
8742 pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData;
8743 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc;
8744 /*-------------------------------------------------------------------------
8745 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008746 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008747 -------------------------------------------------------------------------*/
8748 wpalMutexAcquire(&pWDICtx->wptMutex);
8749
8750 /*------------------------------------------------------------------------
8751 Find the BSS for which the request is made and identify WDI session
8752 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008753 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8754 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008755 &macBSSID))
8756 {
8757 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8758 "This station does not exist in the WDI Station Table %d");
8759 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008760 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008761 }
8762
Jeff Johnsone7245742012-09-05 17:12:55 -07008763 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8764 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008765 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008766 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8767 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8768 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008769
8770 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008771 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008772 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008773
Jeff Johnson295189b2012-06-20 16:38:30 -07008774 /*------------------------------------------------------------------------
8775 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008776 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008777 ------------------------------------------------------------------------*/
8778 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8779 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008780 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8781 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8782 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008783
Jeff Johnsone7245742012-09-05 17:12:55 -07008784 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008785 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008786 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008787 }
8788
8789
8790
8791 wpalMutexRelease(&pWDICtx->wptMutex);
8792 /*-----------------------------------------------------------------------
8793 Get message buffer
8794 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008795 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07008796 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams),
8797 &pSendBuffer, &usDataOffset, &usSendSize))||
8798 ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) )))
8799 {
8800 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8801 "Unable to get send buffer in set bss key req %x %x %x",
8802 pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb);
8803 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008804 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008805 }
8806
8807 /*-----------------------------------------------------------------------
8808 Copy the Key parameters into the HAL message
8809 -----------------------------------------------------------------------*/
8810
Jeff Johnsone7245742012-09-05 17:12:55 -07008811 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -07008812 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx;
8813
Jeff Johnsone7245742012-09-05 17:12:55 -07008814 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -07008815 WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType);
8816
Jeff Johnsone7245742012-09-05 17:12:55 -07008817 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -07008818 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId;
8819
Jeff Johnsone7245742012-09-05 17:12:55 -07008820 halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast =
Jeff Johnson295189b2012-06-20 16:38:30 -07008821 pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast;
8822
Jeff Johnsone7245742012-09-05 17:12:55 -07008823 wpalMemoryCopy( pSendBuffer+usDataOffset,
8824 &halRemoveStaBcastKeyReqMsg.removeStaKeyParams,
8825 sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07008826
8827 pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07008828 pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07008829
8830 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008831 Send Remove STA Key Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07008832 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008833 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07008834 wdiRemoveSTAKeyRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07008835 WDI_RMV_STA_KEY_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07008836
8837}/*WDI_ProcessRemoveSTABcastKeyReq*/
8838
8839/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -07008840 QOS and BA PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -07008841==========================================================================*/
8842/**
8843 @brief Process Add TSpec Request function (called when Main FSM
8844 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07008845
8846 @param pWDICtx: pointer to the WLAN DAL context
8847 pEventData: pointer to the event information structure
8848
Jeff Johnson295189b2012-06-20 16:38:30 -07008849 @see
8850 @return Result of the function call
8851*/
8852WDI_Status
8853WDI_ProcessAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07008854(
Jeff Johnson295189b2012-06-20 16:38:30 -07008855 WDI_ControlBlockType* pWDICtx,
8856 WDI_EventInfoType* pEventData
8857)
8858{
8859 WDI_AddTSReqParamsType* pwdiAddTSParams;
8860 WDI_AddTsRspCb wdiAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008861 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07008862 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07008863 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07008864 wpt_uint16 usDataOffset = 0;
8865 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07008866 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07008867 wpt_macAddr macBSSID;
8868 tAddTsParams halAddTsParams = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -07008869
Jeff Johnson295189b2012-06-20 16:38:30 -07008870 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
8871
8872 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07008873 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07008874 -------------------------------------------------------------------------*/
8875 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
8876 ( NULL == pEventData->pCBfnc ))
8877 {
8878 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8879 "%s: Invalid parameters", __FUNCTION__);
8880 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008881 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008882 }
8883
8884 pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData;
8885 wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc;
8886 /*-------------------------------------------------------------------------
8887 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07008888 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07008889 -------------------------------------------------------------------------*/
8890 wpalMutexAcquire(&pWDICtx->wptMutex);
8891
8892 /*------------------------------------------------------------------------
8893 Find the BSS for which the request is made and identify WDI session
8894 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008895 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
8896 pwdiAddTSParams->wdiTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07008897 &macBSSID))
8898 {
8899 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8900 "This station does not exist in the WDI Station Table %d");
8901 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008902 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008903 }
8904
Jeff Johnsone7245742012-09-05 17:12:55 -07008905 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
8906 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07008907 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008908 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
8909 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
8910 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008911
8912 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008913 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07008914 }
Jeff Johnsone7245742012-09-05 17:12:55 -07008915
Jeff Johnson295189b2012-06-20 16:38:30 -07008916 /*------------------------------------------------------------------------
8917 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07008918 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07008919 ------------------------------------------------------------------------*/
8920 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
8921 {
Jeff Johnsone7245742012-09-05 17:12:55 -07008922 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8923 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
8924 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07008925
Jeff Johnsone7245742012-09-05 17:12:55 -07008926 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07008927 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07008928 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07008929 }
8930
8931 wpalMutexRelease(&pWDICtx->wptMutex);
8932 /*-----------------------------------------------------------------------
8933 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07008934 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07008935 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07008936 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ,
8937 sizeof(halAddTsParams),
8938 &pSendBuffer, &usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -07008939 &usSendSize))||
8940 ( usSendSize < (usDataOffset + sizeof(halAddTsParams) )))
8941 {
8942 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
8943 "Unable to get send buffer in set bss key req %x %x %x",
8944 pEventData, pwdiAddTSParams, wdiAddTSRspCb);
8945 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07008946 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07008947 }
8948
8949 halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx;
8950 halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx;
8951
8952 //TSPEC IE
8953 halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType;
8954 halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -07008955 halAddTsParams.tspec.nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008956 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008957 halAddTsParams.tspec.maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008958 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008959 halAddTsParams.tspec.minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008960 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008961 halAddTsParams.tspec.maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008962 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008963 halAddTsParams.tspec.inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008964 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008965 halAddTsParams.tspec.suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -07008966 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -07008967 halAddTsParams.tspec.svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008968 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -07008969 halAddTsParams.tspec.minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008970 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008971 halAddTsParams.tspec.meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008972 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008973 halAddTsParams.tspec.peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008974 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008975 halAddTsParams.tspec.maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -07008976 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -07008977 halAddTsParams.tspec.delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -07008978 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -07008979 halAddTsParams.tspec.minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -07008980 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -07008981 halAddTsParams.tspec.surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -07008982 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -07008983 halAddTsParams.tspec.mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -07008984 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime;
8985
8986 //TSPEC IE : TS INFO : TRAFFIC
Jeff Johnsone7245742012-09-05 17:12:55 -07008987 halAddTsParams.tspec.tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -07008988 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -07008989 halAddTsParams.tspec.tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -07008990 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -07008991 halAddTsParams.tspec.tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -07008992 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb;
Jeff Johnsone7245742012-09-05 17:12:55 -07008993 halAddTsParams.tspec.tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -07008994 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -07008995 halAddTsParams.tspec.tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -07008996 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction;
Jeff Johnsone7245742012-09-05 17:12:55 -07008997 halAddTsParams.tspec.tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -07008998 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid;
Jeff Johnsone7245742012-09-05 17:12:55 -07008999 halAddTsParams.tspec.tsinfo.traffic.trafficType =
Jeff Johnson295189b2012-06-20 16:38:30 -07009000 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType;
9001
9002 //TSPEC IE : TS INFO : SCHEDULE
Jeff Johnsone7245742012-09-05 17:12:55 -07009003 halAddTsParams.tspec.tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -07009004 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -07009005 halAddTsParams.tspec.tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -07009006 pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule;
9007
Jeff Johnsone7245742012-09-05 17:12:55 -07009008 wpalMemoryCopy( pSendBuffer+usDataOffset,
9009 &halAddTsParams,
9010 sizeof(halAddTsParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009011
9012 pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009013 pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009014
9015 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009016 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009017 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009018 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -07009019 wdiAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -07009020 WDI_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009021}/*WDI_ProcessAddTSpecReq*/
9022
9023
9024/**
9025 @brief Process Del TSpec Request function (called when Main FSM
9026 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009027
9028 @param pWDICtx: pointer to the WLAN DAL context
9029 pEventData: pointer to the event information structure
9030
Jeff Johnson295189b2012-06-20 16:38:30 -07009031 @see
9032 @return Result of the function call
9033*/
9034WDI_Status
9035WDI_ProcessDelTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009036(
Jeff Johnson295189b2012-06-20 16:38:30 -07009037 WDI_ControlBlockType* pWDICtx,
9038 WDI_EventInfoType* pEventData
9039)
9040{
9041 WDI_DelTSReqParamsType* pwdiDelTSParams;
9042 WDI_DelTsRspCb wdiDelTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009043 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009044 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009045 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009046 wpt_uint16 usDataOffset = 0;
9047 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009048 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009049 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9050
9051 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009052 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009053 -------------------------------------------------------------------------*/
9054 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9055 ( NULL == pEventData->pCBfnc ))
9056 {
9057 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9058 "%s: Invalid parameters", __FUNCTION__);
9059 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009060 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009061 }
9062
9063 pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData;
9064 wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc;
9065
9066 /*-------------------------------------------------------------------------
9067 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009068 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009069 -------------------------------------------------------------------------*/
9070 wpalMutexAcquire(&pWDICtx->wptMutex);
9071
9072 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009073 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009074 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009075 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
9076 pwdiDelTSParams->wdiDelTSInfo.macBSSID,
9077 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009078
Jeff Johnsone7245742012-09-05 17:12:55 -07009079 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009080 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009081 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9082 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9083 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
9084
Jeff Johnson295189b2012-06-20 16:38:30 -07009085 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009086 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009087 }
9088
9089 /*------------------------------------------------------------------------
9090 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009091 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009092 ------------------------------------------------------------------------*/
9093 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9094 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009095 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9096 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9097 __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009098
Jeff Johnsone7245742012-09-05 17:12:55 -07009099 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009100 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009101 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009102 }
9103
9104
9105 wpalMutexRelease(&pWDICtx->wptMutex);
9106 /*-----------------------------------------------------------------------
9107 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009108 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009109 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009110 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009111 sizeof(pwdiDelTSParams->wdiDelTSInfo),
9112 &pSendBuffer, &usDataOffset, &usSendSize))||
9113 ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) )))
9114 {
9115 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9116 "Unable to get send buffer in set bss key req %x %x %x",
9117 pEventData, pwdiDelTSParams, wdiDelTSRspCb);
9118 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009119 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009120 }
9121
Jeff Johnsone7245742012-09-05 17:12:55 -07009122 wpalMemoryCopy( pSendBuffer+usDataOffset,
9123 &pwdiDelTSParams->wdiDelTSInfo,
9124 sizeof(pwdiDelTSParams->wdiDelTSInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009125
9126 pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009127 pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009128
9129 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009130 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009131 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009132 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9133 wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009134}/*WDI_ProcessDelTSpecReq*/
9135
9136/**
9137 @brief Process Update EDCA Params Request function (called when
9138 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009139
9140 @param pWDICtx: pointer to the WLAN DAL context
9141 pEventData: pointer to the event information structure
9142
Jeff Johnson295189b2012-06-20 16:38:30 -07009143 @see
9144 @return Result of the function call
9145*/
9146WDI_Status
9147WDI_ProcessUpdateEDCAParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009148(
Jeff Johnson295189b2012-06-20 16:38:30 -07009149 WDI_ControlBlockType* pWDICtx,
9150 WDI_EventInfoType* pEventData
9151)
9152{
9153 WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams;
9154 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009155 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009156 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009157 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009158 wpt_uint16 usDataOffset = 0;
9159 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009160 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009161 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9162
9163 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009164 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009165 -------------------------------------------------------------------------*/
9166 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9167 ( NULL == pEventData->pCBfnc ))
9168 {
9169 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9170 "%s: Invalid parameters", __FUNCTION__);
9171 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009172 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009173 }
9174
9175 pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData;
9176 wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc;
9177 /*-------------------------------------------------------------------------
9178 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009179 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009180 -------------------------------------------------------------------------*/
9181 wpalMutexAcquire(&pWDICtx->wptMutex);
9182
9183 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009184 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009185 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009186 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
9187 pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx,
9188 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009189
Jeff Johnsone7245742012-09-05 17:12:55 -07009190 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009191 {
9192 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -07009193 "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d",
9194 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009195
9196 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009197 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009198 }
9199
9200 /*------------------------------------------------------------------------
9201 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009202 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009203 ------------------------------------------------------------------------*/
9204 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9205 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9207 "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d",
9208 __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07009209
Jeff Johnsone7245742012-09-05 17:12:55 -07009210 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009211 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009212 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009213 }
9214
9215
9216 wpalMutexRelease(&pWDICtx->wptMutex);
9217 /*-----------------------------------------------------------------------
9218 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009219 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009220 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009221 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009222 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo),
9223 &pSendBuffer, &usDataOffset, &usSendSize))||
9224 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) )))
9225 {
9226 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9227 "Unable to get send buffer in set bss key req %x %x %x",
9228 pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb);
9229 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009230 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009231 }
9232
Jeff Johnsone7245742012-09-05 17:12:55 -07009233 wpalMemoryCopy( pSendBuffer+usDataOffset,
9234 &pwdiUpdateEDCAParams->wdiEDCAInfo,
9235 sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009236
9237 pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009238 pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009239
9240 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009241 Send Update EDCA Params Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009242 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009243 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9244 wdiUpdateEDCARspCb, pEventData->pUserData,
9245 WDI_UPD_EDCA_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009246}/*WDI_ProcessUpdateEDCAParamsReq*/
9247
9248/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009249 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009250 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009251
9252 @param pWDICtx: pointer to the WLAN DAL context
9253 pEventData: pointer to the event information structure
9254
Jeff Johnson295189b2012-06-20 16:38:30 -07009255 @see
9256 @return Result of the function call
9257*/
9258WDI_Status
9259WDI_ProcessAddBASessionReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009260(
Jeff Johnson295189b2012-06-20 16:38:30 -07009261 WDI_ControlBlockType* pWDICtx,
9262 WDI_EventInfoType* pEventData
9263)
9264{
9265 WDI_AddBASessionReqParamsType* pwdiAddBASessionParams;
9266 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009267 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009268 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009269 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009270 wpt_uint16 usDataOffset = 0;
9271 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009272 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009273 wpt_macAddr macBSSID;
9274
9275 tAddBASessionReqMsg halAddBASessionReq;
9276 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9277
9278 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009279 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009280 -------------------------------------------------------------------------*/
9281 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9282 ( NULL == pEventData->pCBfnc ))
9283 {
9284 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9285 "%s: Invalid parameters", __FUNCTION__);
9286 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009287 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009288 }
9289
Jeff Johnsone7245742012-09-05 17:12:55 -07009290 pwdiAddBASessionParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009291 (WDI_AddBASessionReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009292 wdiAddBASessionRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009293 (WDI_AddBASessionRspCb)pEventData->pCBfnc;
9294 /*-------------------------------------------------------------------------
9295 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009296 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009297 -------------------------------------------------------------------------*/
9298 wpalMutexAcquire(&pWDICtx->wptMutex);
9299
9300 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009301 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009302 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009303 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9304 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009305 &macBSSID))
9306 {
9307 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9308 "This station does not exist in the WDI Station Table %d");
9309 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009310 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009311 }
9312
9313
Jeff Johnsone7245742012-09-05 17:12:55 -07009314 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009315
Jeff Johnsone7245742012-09-05 17:12:55 -07009316 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009317 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009318 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9319 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9320 __func__, MAC_ADDR_ARRAY(macBSSID));
9321
Jeff Johnson295189b2012-06-20 16:38:30 -07009322 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009323 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009324 }
9325
9326 /*------------------------------------------------------------------------
9327 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009328 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009329 ------------------------------------------------------------------------*/
9330 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9331 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009332 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9333 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9334 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009335
Jeff Johnsone7245742012-09-05 17:12:55 -07009336 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009337 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009338 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009339 }
9340
9341
9342 wpalMutexRelease(&pWDICtx->wptMutex);
9343 /*-----------------------------------------------------------------------
9344 Get message buffer
9345 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009346 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9347 WDI_ADD_BA_SESSION_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009348 sizeof(halAddBASessionReq.addBASessionParams),
9349 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009350 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009351 (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) )))
9352 {
9353 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9354 "Unable to get send buffer in Add BA session req %x %x %x",
9355 pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb);
9356 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009357 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009358 }
9359
9360 halAddBASessionReq.addBASessionParams.staIdx =
9361 pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx;
9362 wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr,
9363 pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr,
9364 WDI_MAC_ADDR_LEN);
9365 halAddBASessionReq.addBASessionParams.baTID =
9366 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID;
9367 halAddBASessionReq.addBASessionParams.baPolicy =
9368 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy;
9369 halAddBASessionReq.addBASessionParams.baBufferSize =
9370 pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize;
9371 halAddBASessionReq.addBASessionParams.baTimeout =
9372 pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout;
9373 halAddBASessionReq.addBASessionParams.baSSN =
9374 pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN;
9375 halAddBASessionReq.addBASessionParams.baDirection =
9376 pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection;
9377
Jeff Johnsone7245742012-09-05 17:12:55 -07009378 wpalMemoryCopy( pSendBuffer+usDataOffset,
9379 &halAddBASessionReq.addBASessionParams,
9380 sizeof(halAddBASessionReq.addBASessionParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009381
9382 pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009383 pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009384
9385 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009386 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009387 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009388 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9389 wdiAddBASessionRspCb, pEventData->pUserData,
9390 WDI_ADD_BA_SESSION_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009391}/*WDI_ProcessAddBASessionReq*/
9392
9393/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009394 @brief Process Del BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009395 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009396
9397 @param pWDICtx: pointer to the WLAN DAL context
9398 pEventData: pointer to the event information structure
9399
Jeff Johnson295189b2012-06-20 16:38:30 -07009400 @see
9401 @return Result of the function call
9402*/
9403WDI_Status
9404WDI_ProcessDelBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009405(
Jeff Johnson295189b2012-06-20 16:38:30 -07009406 WDI_ControlBlockType* pWDICtx,
9407 WDI_EventInfoType* pEventData
9408)
9409{
9410 WDI_DelBAReqParamsType* pwdiDelBAParams;
9411 WDI_DelBARspCb wdiDelBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009412 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07009413 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07009414 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009415 wpt_uint16 usDataOffset = 0;
9416 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009417 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -07009418 wpt_macAddr macBSSID;
9419 tDelBAParams halDelBAparam;
9420 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9421
9422 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009423 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009424 -------------------------------------------------------------------------*/
9425 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9426 ( NULL == pEventData->pCBfnc ))
9427 {
9428 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9429 "%s: Invalid parameters", __FUNCTION__);
9430 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009431 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009432 }
9433
9434 pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData;
9435 wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc;
9436 /*-------------------------------------------------------------------------
9437 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -07009438 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -07009439 -------------------------------------------------------------------------*/
9440 wpalMutexAcquire(&pWDICtx->wptMutex);
9441
9442 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009443 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -07009444 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009445 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
9446 pwdiDelBAParams->wdiBAInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -07009447 &macBSSID))
9448 {
9449 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9450 "This station does not exist in the WDI Station Table %d");
9451 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009452 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009453 }
9454
Jeff Johnsone7245742012-09-05 17:12:55 -07009455 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -07009456
Jeff Johnsone7245742012-09-05 17:12:55 -07009457 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -07009458 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009459 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9460 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9461 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009462
9463 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009464 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -07009465 }
9466
9467 /*------------------------------------------------------------------------
9468 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -07009469 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -07009470 ------------------------------------------------------------------------*/
9471 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9472 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009473 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9474 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9475 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -07009476
Jeff Johnsone7245742012-09-05 17:12:55 -07009477 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -07009478 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009479 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07009480 }
9481
9482 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -07009483 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009484 sizeof(halDelBAparam),
9485 &pSendBuffer, &usDataOffset, &usSendSize))||
9486 ( usSendSize < (usDataOffset + sizeof(halDelBAparam) )))
9487 {
9488 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9489 "Unable to get send buffer for DEL BA req %x %x %x",
9490 pEventData, pwdiDelBAParams, wdiDelBARspCb);
9491 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009492 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009493 }
9494
9495 halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx;
9496 halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID;
9497 halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection;
9498
Jeff Johnsone7245742012-09-05 17:12:55 -07009499 wpalMemoryCopy( pSendBuffer+usDataOffset,
9500 &halDelBAparam,
9501 sizeof(halDelBAparam));
Jeff Johnson295189b2012-06-20 16:38:30 -07009502
9503 pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009504 pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009505
9506 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009507 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009508 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009509 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9510 wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009511}/*WDI_ProcessDelBAReq*/
9512
9513#ifdef FEATURE_WLAN_CCX
9514
9515WDI_Status
9516WDI_ProcessTSMStatsReq
9517(
9518 WDI_ControlBlockType* pWDICtx,
9519 WDI_EventInfoType* pEventData
9520)
9521{
9522 WDI_TSMStatsReqParamsType* pwdiTSMParams;
9523 WDI_TsmRspCb wdiTSMRspCb;
9524 wpt_uint8 ucCurrentBSSSesIdx = 0;
9525 WDI_BSSSessionType* pBSSSes = NULL;
9526 wpt_uint8* pSendBuffer = NULL;
9527 wpt_uint16 usDataOffset = 0;
9528 wpt_uint16 usSendSize = 0;
9529 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
9530 tTsmStatsParams halTsmStatsReqParams = {0};
9531
9532 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9533
9534 /*-------------------------------------------------------------------------
9535 Sanity check
9536 -------------------------------------------------------------------------*/
9537 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9538 ( NULL == pEventData->pCBfnc ))
9539 {
9540 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9541 "%s: Invalid parameters", __FUNCTION__);
9542 WDI_ASSERT(0);
9543 return WDI_STATUS_E_FAILURE;
9544 }
9545
9546 pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData;
9547 wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc;
9548 /*-------------------------------------------------------------------------
9549 Check to see if we are in the middle of an association, if so queue, if
9550 not it means it is free to process request
9551 -------------------------------------------------------------------------*/
9552 wpalMutexAcquire(&pWDICtx->wptMutex);
9553
9554 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes);
9555 if ( NULL == pBSSSes )
9556 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009557 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9558 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
9559 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009560
9561 wpalMutexRelease(&pWDICtx->wptMutex);
9562 return WDI_STATUS_E_NOT_ALLOWED;
9563 }
9564
9565 /*------------------------------------------------------------------------
9566 Check if this BSS is being currently processed or queued,
9567 if queued - queue the new request as well
9568 ------------------------------------------------------------------------*/
9569 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
9570 {
Jeff Johnsone7245742012-09-05 17:12:55 -07009571 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9572 "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
9573 __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid));
Jeff Johnson295189b2012-06-20 16:38:30 -07009574
9575 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
9576 wpalMutexRelease(&pWDICtx->wptMutex);
9577 return wdiStatus;
9578 }
9579
9580 wpalMutexRelease(&pWDICtx->wptMutex);
9581 /*-----------------------------------------------------------------------
9582 Get message buffer
9583 ! TO DO : proper conversion into the HAL Message Request Format
9584 -----------------------------------------------------------------------*/
9585 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ,
9586 sizeof(halTsmStatsReqParams),
9587 &pSendBuffer, &usDataOffset, &usSendSize))||
9588 ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) )))
9589 {
9590 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
9591 "Unable to get send buffer in set bss key req %x %x %x",
9592 pEventData, pwdiTSMParams, wdiTSMRspCb);
9593 WDI_ASSERT(0);
9594 return WDI_STATUS_E_FAILURE;
9595 }
9596
9597 halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid;
9598 wpalMemoryCopy(halTsmStatsReqParams.bssId,
9599 pwdiTSMParams->wdiTsmStatsParamsInfo.bssid,
9600 WDI_MAC_ADDR_LEN);
9601 wpalMemoryCopy( pSendBuffer+usDataOffset,
9602 &halTsmStatsReqParams,
9603 sizeof(halTsmStatsReqParams));
9604
9605 pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB;
9606 pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData;
9607
9608 /*-------------------------------------------------------------------------
9609 Send TSM Stats Request to HAL
9610 -------------------------------------------------------------------------*/
9611 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9612 wdiTSMRspCb, pEventData->pUserData,
9613 WDI_TSM_STATS_RESP);
9614}/*WDI_ProcessTSMStatsReq*/
9615
9616#endif
9617
9618
9619/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009620 @brief Process Flush AC Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -07009621 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009622
9623 @param pWDICtx: pointer to the WLAN DAL context
9624 pEventData: pointer to the event information structure
9625
Jeff Johnson295189b2012-06-20 16:38:30 -07009626 @see
9627 @return Result of the function call
9628*/
9629WDI_Status
9630WDI_ProcessFlushAcReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009631(
Jeff Johnson295189b2012-06-20 16:38:30 -07009632 WDI_ControlBlockType* pWDICtx,
9633 WDI_EventInfoType* pEventData
9634)
9635{
9636 WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL;
9637 WDI_FlushAcRspCb wdiFlushAcRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009638 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009639 wpt_uint16 usDataOffset = 0;
9640 wpt_uint16 usSendSize = 0;
9641 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9642
9643 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009644 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009645 -------------------------------------------------------------------------*/
9646 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9647 ( NULL == pEventData->pCBfnc ))
9648 {
9649 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9650 "%s: Invalid parameters", __FUNCTION__);
9651 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009652 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009653 }
9654
9655 pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData;
9656 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc;
9657 /*-----------------------------------------------------------------------
9658 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009659 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009660 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009661 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009662 sizeof(pwdiFlushAcParams->wdiFlushAcInfo),
9663 &pSendBuffer, &usDataOffset, &usSendSize))||
9664 ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) )))
9665 {
9666 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9667 "Unable to get send buffer in set bss key req %x %x %x",
9668 pEventData, pwdiFlushAcParams, wdiFlushAcRspCb);
9669 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009670 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009671 }
9672
Jeff Johnsone7245742012-09-05 17:12:55 -07009673 wpalMemoryCopy( pSendBuffer+usDataOffset,
9674 &pwdiFlushAcParams->wdiFlushAcInfo,
9675 sizeof(pwdiFlushAcParams->wdiFlushAcInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -07009676
9677 pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009678 pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009679
9680 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009681 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009682 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009683 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9684 wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009685}/*WDI_ProcessFlushAcReq*/
9686
9687/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009688 @brief Process BT AMP event Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009689 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009690
9691 @param pWDICtx: pointer to the WLAN DAL context
9692 pEventData: pointer to the event information structure
9693
Jeff Johnson295189b2012-06-20 16:38:30 -07009694 @see
9695 @return Result of the function call
9696*/
9697WDI_Status
9698WDI_ProcessBtAmpEventReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009699(
Jeff Johnson295189b2012-06-20 16:38:30 -07009700 WDI_ControlBlockType* pWDICtx,
9701 WDI_EventInfoType* pEventData
9702)
9703{
9704 WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL;
9705 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009706 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009707 wpt_uint16 usDataOffset = 0;
9708 wpt_uint16 usSendSize = 0;
9709
9710 tBtAmpEventMsg haltBtAmpEventMsg;
9711 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9712
9713 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009714 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009715 -------------------------------------------------------------------------*/
9716 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9717 ( NULL == pEventData->pCBfnc ))
9718 {
9719 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9720 "%s: Invalid parameters", __FUNCTION__);
9721 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009722 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009723 }
9724
9725 pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData;
9726 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc;
9727 /*-----------------------------------------------------------------------
9728 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009729 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009730 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009731 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009732 sizeof(haltBtAmpEventMsg.btAmpEventParams),
9733 &pSendBuffer, &usDataOffset, &usSendSize))||
9734 ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) )))
9735 {
9736 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9737 "Unable to get send buffer in BT AMP event req %x %x %x",
9738 pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb);
9739 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009740 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009741 }
9742
Jeff Johnsone7245742012-09-05 17:12:55 -07009743 haltBtAmpEventMsg.btAmpEventParams.btAmpEventType =
Jeff Johnson295189b2012-06-20 16:38:30 -07009744 pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType;
Jeff Johnsone7245742012-09-05 17:12:55 -07009745 wpalMemoryCopy( pSendBuffer+usDataOffset,
9746 &haltBtAmpEventMsg.btAmpEventParams,
9747 sizeof(haltBtAmpEventMsg.btAmpEventParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009748
9749 pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009750 pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009751
9752 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009753 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009754 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009755 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9756 wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009757}/*WDI_ProcessBtAmpEventReq*/
9758
9759/**
9760 @brief Process Add STA self Request function (called when Main FSM
9761 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009762
9763 @param pWDICtx: pointer to the WLAN DAL context
9764 pEventData: pointer to the event information structure
9765
Jeff Johnson295189b2012-06-20 16:38:30 -07009766 @see
9767 @return Result of the function call
9768*/
9769WDI_Status
9770WDI_ProcessAddSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009771(
Jeff Johnson295189b2012-06-20 16:38:30 -07009772 WDI_ControlBlockType* pWDICtx,
9773 WDI_EventInfoType* pEventData
9774)
9775{
9776 WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams;
9777 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009778 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009779 wpt_uint16 usDataOffset = 0;
9780 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07009781 tAddStaSelfParams halAddSTASelfParams;
Jeff Johnson295189b2012-06-20 16:38:30 -07009782 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9783
9784 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009785 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009786 -------------------------------------------------------------------------*/
9787 if (( NULL == pEventData ) ||
9788 ( NULL == pEventData->pEventData) ||
9789 ( NULL == pEventData->pCBfnc))
9790 {
9791 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9792 "%s: Invalid parameters", __FUNCTION__);
9793 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009794 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009795 }
9796
Jeff Johnsone7245742012-09-05 17:12:55 -07009797 pwdiAddSTASelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009798 (WDI_AddSTASelfReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -07009799 wdiAddSTASelfReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -07009800 (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc;
9801 /*-----------------------------------------------------------------------
9802 Get message buffer
9803 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009804 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9805 WDI_ADD_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009806 sizeof(tAddStaSelfParams),
9807 &pSendBuffer, &usDataOffset, &usSendSize))||
9808 ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) )))
9809 {
9810 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9811 "Unable to get send buffer in ADD STA SELF REQ %x %x %x",
9812 pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb);
9813 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009814 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009815 }
9816
9817 /* Cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -07009818 wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -07009819 sizeof(pWDICtx->wdiCacheAddSTASelfReq));
9820
Jeff Johnsone7245742012-09-05 17:12:55 -07009821 wpalMemoryCopy(halAddSTASelfParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009822 pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ;
9823
Jeff Johnsone7245742012-09-05 17:12:55 -07009824 wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams,
9825 sizeof(tAddStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009826
9827 pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009828 pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009829
9830 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009831 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009832 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009833 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9834 wdiAddSTASelfReqRspCb, pEventData->pUserData,
9835 WDI_ADD_STA_SELF_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -07009836}/*WDI_ProcessAddSTASelfReq*/
9837
9838
9839
9840/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009841 @brief Process Del Sta Self Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009842 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009843
9844 @param pWDICtx: pointer to the WLAN DAL context
9845 pEventData: pointer to the event information structure
9846
Jeff Johnson295189b2012-06-20 16:38:30 -07009847 @see
9848 @return Result of the function call
9849*/
9850WDI_Status
9851WDI_ProcessDelSTASelfReq
Jeff Johnsone7245742012-09-05 17:12:55 -07009852(
Jeff Johnson295189b2012-06-20 16:38:30 -07009853 WDI_ControlBlockType* pWDICtx,
9854 WDI_EventInfoType* pEventData
9855)
9856{
9857 WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams;
9858 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -07009859 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07009860 wpt_uint16 usDataOffset = 0;
9861 wpt_uint16 usSendSize = 0;
9862 tDelStaSelfParams halSetDelSelfSTAParams;
9863 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
9864
9865 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009866 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -07009867 -------------------------------------------------------------------------*/
9868 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9869 ( NULL == pEventData->pCBfnc ))
9870 {
9871 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9872 "%s: Invalid parameters", __FUNCTION__);
9873 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009874 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009875 }
9876
Jeff Johnsone7245742012-09-05 17:12:55 -07009877 pwdiDelStaSelfReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -07009878 (WDI_DelSTASelfReqParamsType*)pEventData->pEventData;
9879 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc;
9880
9881 /*-----------------------------------------------------------------------
9882 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -07009883 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -07009884 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009885 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -07009886 sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo),
9887 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -07009888 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -07009889 (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) )))
9890 {
9891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9892 "Unable to get send buffer in Del Sta Self req %x %x %x",
9893 pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb);
9894 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -07009895 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -07009896 }
9897
Jeff Johnsone7245742012-09-05 17:12:55 -07009898 wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07009899 pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ;
9900
Jeff Johnsone7245742012-09-05 17:12:55 -07009901 wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams,
9902 sizeof(tDelStaSelfParams));
Jeff Johnson295189b2012-06-20 16:38:30 -07009903
9904 pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -07009905 pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -07009906
9907 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -07009908 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -07009909 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -07009910 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9911 wdiDelStaSelfRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -07009912 WDI_DEL_STA_SELF_RESP);
9913
9914}
9915
Jeff Johnsone7245742012-09-05 17:12:55 -07009916#ifdef FEATURE_OEM_DATA_SUPPORT
9917/**
9918 @brief Process Start Oem Data Request function (called when Main
9919 FSM allows it)
9920
9921 @param pWDICtx: pointer to the WLAN DAL context
9922 pEventData: pointer to the event information structure
9923
9924 @see
9925 @return Result of the function call
9926*/
9927WDI_Status
9928WDI_ProcessStartOemDataReq
9929(
9930 WDI_ControlBlockType* pWDICtx,
9931 WDI_EventInfoType* pEventData
9932)
9933{
9934 WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL;
9935 WDI_oemDataRspCb wdiOemDataRspCb;
9936 wpt_uint8* pSendBuffer = NULL;
9937 wpt_uint16 usDataOffset = 0;
9938 wpt_uint16 usSendSize = 0;
9939 wpt_uint16 reqLen;
9940 tStartOemDataReqParams* halStartOemDataReqParams;
9941
9942 /*-------------------------------------------------------------------------
9943 Sanity check
9944 -------------------------------------------------------------------------*/
9945 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
9946 ( NULL == pEventData->pCBfnc ))
9947 {
9948 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9949 "%s: Invalid parameters", __FUNCTION__);
9950 WDI_ASSERT(0);
9951 return WDI_STATUS_E_FAILURE;
9952 }
9953
9954 pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData;
9955 wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc;
9956
9957 /*-----------------------------------------------------------------------
9958 Get message buffer
9959 -----------------------------------------------------------------------*/
9960
9961 reqLen = sizeof(tStartOemDataReqParams);
9962
9963 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
9964 WDI_START_OEM_DATA_REQ, reqLen,
9965 &pSendBuffer, &usDataOffset, &usSendSize))||
9966 (usSendSize < (usDataOffset + reqLen)))
9967 {
9968 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
9969 "Unable to get send buffer in Start Oem Data req %x %x %x",
9970 pEventData, pwdiOemDataReqParams, wdiOemDataRspCb);
9971 WDI_ASSERT(0);
9972 return WDI_STATUS_E_FAILURE;
9973 }
9974
9975 //copying WDI OEM DATA REQ PARAMS to shared memory
9976 halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset );
9977
9978 wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr));
9979 wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE);
9980
9981 pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB;
9982 pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData;
9983
9984 /*-------------------------------------------------------------------------
9985 Send Start Request to HAL
9986 -------------------------------------------------------------------------*/
9987 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
9988 wdiOemDataRspCb, pEventData->pUserData,
9989 WDI_START_OEM_DATA_RESP);
9990}/*WDI_ProcessStartOemDataReq*/
9991#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07009992
9993/**
Jeff Johnsone7245742012-09-05 17:12:55 -07009994 @brief Process Host Resume Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -07009995 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -07009996
9997 @param pWDICtx: pointer to the WLAN DAL context
9998 pEventData: pointer to the event information structure
9999
Jeff Johnson295189b2012-06-20 16:38:30 -070010000 @see
10001 @return Result of the function call
10002*/
10003WDI_Status
10004WDI_ProcessHostResumeReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010005(
Jeff Johnson295189b2012-06-20 16:38:30 -070010006 WDI_ControlBlockType* pWDICtx,
10007 WDI_EventInfoType* pEventData
10008)
10009{
10010 WDI_ResumeParamsType* pwdiHostResumeParams = NULL;
10011 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010012 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010013 wpt_uint16 usDataOffset = 0;
10014 wpt_uint16 usSendSize = 0;
10015 tHalWlanHostResumeReqParam halResumeReqParams;
10016
10017 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10018
10019 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010020 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010021 -------------------------------------------------------------------------*/
10022 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10023 ( NULL == pEventData->pCBfnc ))
10024 {
10025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10026 "%s: Invalid parameters ",__FUNCTION__);
10027 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010028 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010029 }
10030
10031 pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData;
10032 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc;
10033
10034 /*-----------------------------------------------------------------------
10035 Get message buffer
10036 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010037 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010038 WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams),
10039 &pSendBuffer, &usDataOffset, &usSendSize))||
10040 (usSendSize < (usDataOffset + sizeof(halResumeReqParams))))
10041 {
10042 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070010043 "Unable to get send buffer in Start Oem Data req %x %x %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070010044 pEventData, pwdiHostResumeParams, wdiHostResumeRspCb);
10045 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010046 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010047 }
10048
Jeff Johnsone7245742012-09-05 17:12:55 -070010049 halResumeReqParams.configuredMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070010050 pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070010051
10052 wpalMemoryCopy( pSendBuffer+usDataOffset,
10053 &halResumeReqParams,
10054 sizeof(halResumeReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010055
10056 pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010057 pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010058
10059 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010060 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010061 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010062 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10063 wdiHostResumeRspCb, pEventData->pUserData,
10064 WDI_HOST_RESUME_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010065}/*WDI_ProcessHostResumeReq*/
10066
10067/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010068 @brief Process set Tx Per Tracking Parameters Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070010069 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010070
10071 @param pWDICtx: pointer to the WLAN DAL context
10072 pEventData: pointer to the event information structure
10073
Jeff Johnson295189b2012-06-20 16:38:30 -070010074 @see
10075 @return Result of the function call
10076*/
10077WDI_Status
10078WDI_ProcessSetTxPerTrackingReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010079(
Jeff Johnson295189b2012-06-20 16:38:30 -070010080 WDI_ControlBlockType* pWDICtx,
10081 WDI_EventInfoType* pEventData
10082)
10083{
10084 WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL;
10085 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010086 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010087 wpt_uint16 usDataOffset = 0;
10088 wpt_uint16 usSendSize = 0;
10089 tHalTxPerTrackingReqParam halTxPerTrackingReqParam;
10090 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10091
10092 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010093 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010094 -------------------------------------------------------------------------*/
10095 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10096 ( NULL == pEventData->pCBfnc ))
10097 {
10098 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10099 "%s: Invalid parameters ",__FUNCTION__);
10100 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010101 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010102 }
10103
10104 pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData;
10105 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc;
Jeff Johnsone7245742012-09-05 17:12:55 -070010106
Jeff Johnson295189b2012-06-20 16:38:30 -070010107 /*-----------------------------------------------------------------------
10108 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010109 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010110 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010111 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010112 sizeof(halTxPerTrackingReqParam),
10113 &pSendBuffer, &usDataOffset, &usSendSize))||
10114 ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) )))
10115 {
10116 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10117 "Unable to get send buffer in set tx per tracking req %x %x %x",
10118 pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb);
10119 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010120 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010121 }
Jeff Johnsone7245742012-09-05 17:12:55 -070010122
Jeff Johnson295189b2012-06-20 16:38:30 -070010123 halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable;
10124 halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod;
10125 halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio;
10126 halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark;
Jeff Johnsone7245742012-09-05 17:12:55 -070010127
10128 wpalMemoryCopy( pSendBuffer+usDataOffset,
10129 &halTxPerTrackingReqParam,
10130 sizeof(halTxPerTrackingReqParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010131
10132 pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010133 pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010134
10135 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010136 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010137 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010138 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10139 pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010140}/*WDI_ProcessSetTxPerTrackingReq*/
10141
10142/*=========================================================================
10143 Indications
10144=========================================================================*/
10145
10146/**
10147 @brief Process Suspend Indications function (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010148
10149 @param pWDICtx: pointer to the WLAN DAL context
10150 pEventData: pointer to the event information structure
10151
Jeff Johnson295189b2012-06-20 16:38:30 -070010152 @see
10153 @return Result of the function call
10154*/
10155WDI_Status
10156WDI_ProcessHostSuspendInd
Jeff Johnsone7245742012-09-05 17:12:55 -070010157(
Jeff Johnson295189b2012-06-20 16:38:30 -070010158 WDI_ControlBlockType* pWDICtx,
10159 WDI_EventInfoType* pEventData
10160)
10161{
10162 WDI_SuspendParamsType *pSuspendIndParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070010163 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010164 wpt_uint16 usDataOffset = 0;
10165 wpt_uint16 usSendSize = 0;
10166 WDI_Status wdiStatus;
10167 tHalWlanHostSuspendIndParam halWlanSuspendIndparams;
10168 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10169
10170 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010171 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010172 -------------------------------------------------------------------------*/
10173 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
10174 {
10175 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10176 "%s: Invalid parameters in Suspend ind",__FUNCTION__);
10177 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010178 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010179 }
10180
10181 pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData;
10182
10183 /*-----------------------------------------------------------------------
10184 Get message buffer
10185 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010186 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
10187 WDI_HOST_SUSPEND_IND,
Jeff Johnson295189b2012-06-20 16:38:30 -070010188 sizeof(halWlanSuspendIndparams),
10189 &pSendBuffer, &usDataOffset, &usSendSize))||
10190 (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams))))
10191 {
10192 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10193 "Unable to get send buffer in Suspend Ind ");
10194 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010195 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010196 }
10197
10198 halWlanSuspendIndparams.configuredMcstBcstFilterSetting =
10199 pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting;
10200
Jeff Johnsone7245742012-09-05 17:12:55 -070010201 halWlanSuspendIndparams.activeSessionCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070010202 WDI_GetActiveSessionsCount(pWDICtx);
10203
Jeff Johnsone7245742012-09-05 17:12:55 -070010204 wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams,
10205 sizeof(tHalWlanHostSuspendIndParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070010206
10207 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010208 Send Suspend Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010209 -------------------------------------------------------------------------*/
10210 pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010211 pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010212
Jeff Johnsone7245742012-09-05 17:12:55 -070010213 wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070010214 return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC;
10215}/*WDI_ProcessHostSuspendInd*/
10216
10217/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070010218 MISC CONTROL PROCESSING REQUEST API
Jeff Johnson295189b2012-06-20 16:38:30 -070010219==========================================================================*/
10220/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010221 @brief Process Channel Switch Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010222 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010223
10224 @param pWDICtx: pointer to the WLAN DAL context
10225 pEventData: pointer to the event information structure
10226
Jeff Johnson295189b2012-06-20 16:38:30 -070010227 @see
10228 @return Result of the function call
10229*/
10230WDI_Status
10231WDI_ProcessChannelSwitchReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010232(
Jeff Johnson295189b2012-06-20 16:38:30 -070010233 WDI_ControlBlockType* pWDICtx,
10234 WDI_EventInfoType* pEventData
10235)
10236{
10237 WDI_SwitchChReqParamsType* pwdiSwitchChParams;
10238 WDI_SwitchChRspCb wdiSwitchChRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010239 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010240 wpt_uint16 usDataOffset = 0;
10241 wpt_uint16 usSendSize = 0;
10242 tSwitchChannelReqMsg halSwitchChannelReq = {{0}};
10243 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10244
10245 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010246 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010247 -------------------------------------------------------------------------*/
10248 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10249 ( NULL == pEventData->pCBfnc ))
10250 {
10251 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10252 "%s: Invalid parameters", __FUNCTION__);
10253 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010254 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010255 }
10256
10257 pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData;
10258 wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc;
10259 /*-----------------------------------------------------------------------
10260 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010261 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010262 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010263 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010264 sizeof(halSwitchChannelReq.switchChannelParams),
10265 &pSendBuffer, &usDataOffset, &usSendSize))||
10266 ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) )))
10267 {
10268 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10269 "Unable to get send buffer in channel switch req %x %x %x",
10270 pEventData, pwdiSwitchChParams, wdiSwitchChRspCb);
10271 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010272 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010273 }
10274
Jeff Johnsone7245742012-09-05 17:12:55 -070010275 halSwitchChannelReq.switchChannelParams.channelNumber =
Jeff Johnson295189b2012-06-20 16:38:30 -070010276 pwdiSwitchChParams->wdiChInfo.ucChannel;
Jeff Johnsone7245742012-09-05 17:12:55 -070010277#ifndef WLAN_FEATURE_VOWIFI
10278 halSwitchChannelReq.switchChannelParams.localPowerConstraint =
Jeff Johnson295189b2012-06-20 16:38:30 -070010279 pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint;
10280#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010281 halSwitchChannelReq.switchChannelParams.secondaryChannelOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070010282 pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset;
10283
10284#ifdef WLAN_FEATURE_VOWIFI
10285 halSwitchChannelReq.switchChannelParams.maxTxPower
Jeff Johnsone7245742012-09-05 17:12:55 -070010286 = pwdiSwitchChParams->wdiChInfo.cMaxTxPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070010287 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr,
10288 pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr,
10289 WDI_MAC_ADDR_LEN);
10290 wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId,
10291 pwdiSwitchChParams->wdiChInfo.macBSSId,
10292 WDI_MAC_ADDR_LEN);
10293#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070010294 wpalMemoryCopy( pSendBuffer+usDataOffset,
10295 &halSwitchChannelReq.switchChannelParams,
10296 sizeof(halSwitchChannelReq.switchChannelParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010297
10298 pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010299 pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010300
10301 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010302 Send Switch Channel Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010303 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010304 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10305 wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010306}/*WDI_ProcessChannelSwitchReq*/
10307
10308/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010309 @brief Process Config STA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010310 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010311
10312 @param pWDICtx: pointer to the WLAN DAL context
10313 pEventData: pointer to the event information structure
10314
Jeff Johnson295189b2012-06-20 16:38:30 -070010315 @see
10316 @return Result of the function call
10317*/
10318WDI_Status
10319WDI_ProcessConfigStaReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010320(
Jeff Johnson295189b2012-06-20 16:38:30 -070010321 WDI_ControlBlockType* pWDICtx,
10322 WDI_EventInfoType* pEventData
10323)
10324{
10325 WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams;
10326 WDI_ConfigSTARspCb wdiConfigSTARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010327 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010328 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010329 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010330 wpt_uint16 usDataOffset = 0;
10331 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010332 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010333
Jeff Johnsone7245742012-09-05 17:12:55 -070010334 tConfigStaReqMsg halConfigStaReqMsg;
10335 wpt_uint16 uMsgSize = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010336 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10337
10338 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010339 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010340 -------------------------------------------------------------------------*/
10341 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10342 ( NULL == pEventData->pCBfnc ))
10343 {
10344 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10345 "%s: Invalid parameters", __FUNCTION__);
10346 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010347 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010348 }
10349
10350 pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData;
10351 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc;
10352 /*-------------------------------------------------------------------------
10353 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010354 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010355 -------------------------------------------------------------------------*/
10356 wpalMutexAcquire(&pWDICtx->wptMutex);
10357
10358 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010359 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010360 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010361 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10362 pwdiConfigSTAParams->wdiReqInfo.macBSSID,
10363 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010364
Jeff Johnsone7245742012-09-05 17:12:55 -070010365 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010366 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010367 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10368 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10369 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010370
10371 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010372 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010373 }
10374
10375 /*------------------------------------------------------------------------
10376 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010377 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010378 ------------------------------------------------------------------------*/
10379 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10380 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010381 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10382 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10383 __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010384
Jeff Johnsone7245742012-09-05 17:12:55 -070010385 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010386 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010387 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010388 }
10389
10390 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010391
10392 /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */
10393#ifdef WLAN_FEATURE_11AC
10394 if (WDI_getFwWlanFeatCaps(DOT11AC))
10395 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC
10396 else
10397#endif
10398 uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default
10399
Jeff Johnson295189b2012-06-20 16:38:30 -070010400 /*-----------------------------------------------------------------------
10401 Get message buffer
10402 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010403 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ,
10404 uMsgSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070010405 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010406 ( usSendSize < (usDataOffset + uMsgSize )))
Jeff Johnson295189b2012-06-20 16:38:30 -070010407 {
10408 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10409 "Unable to get send buffer in config sta req %x %x %x",
10410 pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb);
10411 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010412 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010413 }
10414
10415 /*Copy the station context*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010416 WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010417 &pwdiConfigSTAParams->wdiReqInfo);
10418
10419 if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF)
10420 {
10421 /* Need to fill in the self STA Index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010422 if ( WDI_STATUS_SUCCESS !=
Jeff Johnson295189b2012-06-20 16:38:30 -070010423 WDI_STATableFindStaidByAddr(pWDICtx,
10424 pwdiConfigSTAParams->wdiReqInfo.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070010425 (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx ))
Jeff Johnson295189b2012-06-20 16:38:30 -070010426 {
10427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10428 "This station does not exist in the WDI Station Table %d");
10429 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010430 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010431 }
10432 }
10433 else
10434 {
10435 /* Need to fill in the STA Index to invalid, since at this point we have not
10436 yet received it from HAL */
Jeff Johnsone7245742012-09-05 17:12:55 -070010437 halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070010438 }
10439
10440 /* Need to fill in the BSS index */
Jeff Johnsone7245742012-09-05 17:12:55 -070010441 halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070010442
Jeff Johnsone7245742012-09-05 17:12:55 -070010443 wpalMemoryCopy( pSendBuffer+usDataOffset,
10444 &halConfigStaReqMsg.uStaParams,
10445 sizeof(halConfigStaReqMsg.uStaParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010446
10447 pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010448 pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010449
Jeff Johnsone7245742012-09-05 17:12:55 -070010450 wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq,
10451 pwdiConfigSTAParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010452 sizeof(pWDICtx->wdiCachedConfigStaReq));
10453
10454 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010455 Send Config STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010456 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010457 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10458 wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010459}/*WDI_ProcessConfigStaReq*/
10460
10461
10462/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010463 @brief Process Set Link State Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070010464 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010465
10466 @param pWDICtx: pointer to the WLAN DAL context
10467 pEventData: pointer to the event information structure
10468
Jeff Johnson295189b2012-06-20 16:38:30 -070010469 @see
10470 @return Result of the function call
10471*/
10472WDI_Status
10473WDI_ProcessSetLinkStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010474(
Jeff Johnson295189b2012-06-20 16:38:30 -070010475 WDI_ControlBlockType* pWDICtx,
10476 WDI_EventInfoType* pEventData
10477)
10478{
10479 WDI_SetLinkReqParamsType* pwdiSetLinkParams;
10480 WDI_SetLinkStateRspCb wdiSetLinkRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010481 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010482 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010483 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010484 wpt_uint16 usDataOffset = 0;
10485 wpt_uint16 usSendSize = 0;
10486 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnsone7245742012-09-05 17:12:55 -070010487 tLinkStateParams halLinkStateReqMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070010488 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10489
10490 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010491 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010492 -------------------------------------------------------------------------*/
10493 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10494 ( NULL == pEventData->pCBfnc ))
10495 {
10496 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10497 "%s: Invalid parameters", __FUNCTION__);
10498 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010499 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010500 }
10501
10502 pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData;
10503 wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc;
10504 /*-------------------------------------------------------------------------
10505 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010506 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010507 -------------------------------------------------------------------------*/
10508 wpalMutexAcquire(&pWDICtx->wptMutex);
10509
10510 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010511 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010512 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010513 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
10514 pwdiSetLinkParams->wdiLinkInfo.macBSSID,
10515 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070010516
Jeff Johnsone7245742012-09-05 17:12:55 -070010517 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010518 {
Madan Mohan Koyyalamudi891e9492012-10-21 12:19:31 -070010519 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070010520 "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR,
10521 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010522 }
10523 else
10524 {
10525 /*------------------------------------------------------------------------
10526 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010527 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010528 ------------------------------------------------------------------------*/
10529 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10530 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010531 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10532 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10533 __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID));
10534
10535 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010536 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010537 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010538 }
10539 }
10540 /* If the link is set to enter IDLE - the Session allocated for this BSS
10541 will be deleted on the Set Link State response coming from HAL
10542 - cache the request for response processing */
Jeff Johnsone7245742012-09-05 17:12:55 -070010543 wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070010544 sizeof(pWDICtx->wdiCacheSetLinkStReq));
10545
10546 wpalMutexRelease(&pWDICtx->wptMutex);
10547 /*-----------------------------------------------------------------------
10548 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010549 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010550 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010551
10552 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010553 sizeof(halLinkStateReqMsg),
10554 &pSendBuffer, &usDataOffset, &usSendSize))||
10555 ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) )))
10556 {
10557 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10558 "Unable to get send buffer in set bss key req %x %x %x",
10559 pEventData, pwdiSetLinkParams, wdiSetLinkRspCb);
10560 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010561 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010562 }
10563
10564 wpalMemoryCopy(halLinkStateReqMsg.bssid,
10565 pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN);
10566
10567 wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr,
10568 pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN);
10569
Jeff Johnsone7245742012-09-05 17:12:55 -070010570 halLinkStateReqMsg.state =
Jeff Johnson295189b2012-06-20 16:38:30 -070010571 WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState);
10572
Jeff Johnsone7245742012-09-05 17:12:55 -070010573 wpalMemoryCopy( pSendBuffer+usDataOffset,
10574 &halLinkStateReqMsg,
10575 sizeof(halLinkStateReqMsg));
Jeff Johnson295189b2012-06-20 16:38:30 -070010576
10577 pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010578 pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010579
10580 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010581 Send Set Link State Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010582 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010583 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10584 wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010585}/*WDI_ProcessSetLinkStateReq*/
10586
10587
10588/**
10589 @brief Process Get Stats Request function (called when Main FSM
10590 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010591
10592 @param pWDICtx: pointer to the WLAN DAL context
10593 pEventData: pointer to the event information structure
10594
Jeff Johnson295189b2012-06-20 16:38:30 -070010595 @see
10596 @return Result of the function call
10597*/
10598WDI_Status
10599WDI_ProcessGetStatsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010600(
Jeff Johnson295189b2012-06-20 16:38:30 -070010601 WDI_ControlBlockType* pWDICtx,
10602 WDI_EventInfoType* pEventData
10603)
10604{
10605 WDI_GetStatsReqParamsType* pwdiGetStatsParams;
10606 WDI_GetStatsRspCb wdiGetStatsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010607 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010608 wpt_uint16 usDataOffset = 0;
10609 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010610 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010611 WDI_BSSSessionType* pBSSSes = NULL;
10612 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010613 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010614 tHalStatsReqMsg halStatsReqMsg;
10615 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10616
10617 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010618 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010619 -------------------------------------------------------------------------*/
10620 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) ||
10621 ( NULL == pEventData->pCBfnc ) )
10622 {
10623 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10624 "%s: Invalid parameters", __FUNCTION__);
10625 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010626 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010627 }
10628
10629 pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData;
10630 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc;
10631
10632 /*-------------------------------------------------------------------------
10633 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010634 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010635 -------------------------------------------------------------------------*/
10636 wpalMutexAcquire(&pWDICtx->wptMutex);
10637
10638 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010639 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010640 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010641 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10642 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010643 &macBSSID))
10644 {
10645 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10646 "This station does not exist in the WDI Station Table %d");
10647 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010648 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010649 }
10650
Jeff Johnsone7245742012-09-05 17:12:55 -070010651 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10652 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010653 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010654 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10655 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10656 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010657
10658 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010659 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010660 }
10661
10662 /*------------------------------------------------------------------------
10663 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010664 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010665 ------------------------------------------------------------------------*/
10666 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10667 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010668 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10669 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10670 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010671
Jeff Johnsone7245742012-09-05 17:12:55 -070010672 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010673 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010674 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010675 }
10676
10677
10678 wpalMutexRelease(&pWDICtx->wptMutex);
10679
10680 /*-----------------------------------------------------------------------
10681 Get message buffer
10682 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010683 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010684 sizeof(halStatsReqMsg.statsReqParams),
10685 &pSendBuffer, &usDataOffset, &usSendSize))||
10686 ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) )))
10687 {
10688 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10689 "Unable to get send buffer in set bss key req %x %x %x",
10690 pEventData, pwdiGetStatsParams, wdiGetStatsRspCb);
10691 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010692 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010693 }
10694
Jeff Johnsone7245742012-09-05 17:12:55 -070010695 halStatsReqMsg.statsReqParams.staId =
Jeff Johnson295189b2012-06-20 16:38:30 -070010696 pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070010697 halStatsReqMsg.statsReqParams.statsMask =
Jeff Johnson295189b2012-06-20 16:38:30 -070010698 pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask;
Jeff Johnsone7245742012-09-05 17:12:55 -070010699 wpalMemoryCopy( pSendBuffer+usDataOffset,
10700 &halStatsReqMsg.statsReqParams,
10701 sizeof(halStatsReqMsg.statsReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010702
10703 pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010704 pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010705
10706 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010707 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010708 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010709 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10710 wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010711}/*WDI_ProcessGetStatsReq*/
10712
10713/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010714 @brief Process Update Cfg Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070010715 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010716
10717 @param pWDICtx: pointer to the WLAN DAL context
10718 pEventData: pointer to the event information structure
10719
Jeff Johnson295189b2012-06-20 16:38:30 -070010720 @see
10721 @return Result of the function call
10722*/
10723WDI_Status
10724WDI_ProcessUpdateCfgReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010725(
Jeff Johnson295189b2012-06-20 16:38:30 -070010726 WDI_ControlBlockType* pWDICtx,
10727 WDI_EventInfoType* pEventData
10728)
10729{
10730 WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL;
10731 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL;
10732
Jeff Johnsone7245742012-09-05 17:12:55 -070010733 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010734 wpt_uint16 usDataOffset = 0;
10735 wpt_uint16 usSendSize = 0;
10736 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10737
10738 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010739 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010740 -------------------------------------------------------------------------*/
10741 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
10742 ( NULL == pEventData->pCBfnc))
10743 {
10744 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10745 "%s: Invalid parameters", __FUNCTION__);
10746 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010747 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010748 }
10749
10750 pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData;
10751 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc;
10752
10753 /*-----------------------------------------------------------------------
10754 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070010755 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070010756 -----------------------------------------------------------------------*/
10757
Jeff Johnsone7245742012-09-05 17:12:55 -070010758 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010759 pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32),
10760 &pSendBuffer, &usDataOffset, &usSendSize))||
10761 ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen)))
10762 {
10763 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10764 "Unable to get send buffer in set bss key req %x %x %x",
10765 pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb);
10766 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010767 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010768 }
10769
Jeff Johnsone7245742012-09-05 17:12:55 -070010770 wpalMemoryCopy( pSendBuffer+usDataOffset,
10771 &pwdiUpdateCfgParams->uConfigBufferLen,
10772 sizeof(wpt_uint32));
10773 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32),
10774 pwdiUpdateCfgParams->pConfigBuffer,
10775 pwdiUpdateCfgParams->uConfigBufferLen);
Jeff Johnson295189b2012-06-20 16:38:30 -070010776
10777 pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010778 pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010779
10780 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010781 Send Update Cfg Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010782 -------------------------------------------------------------------------*/
10783
Jeff Johnsone7245742012-09-05 17:12:55 -070010784 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10785 wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010786
10787}/*WDI_ProcessUpdateCfgReq*/
10788
10789
10790/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010791 @brief Process Add BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010792 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010793
10794 @param pWDICtx: pointer to the WLAN DAL context
10795 pEventData: pointer to the event information structure
10796
Jeff Johnson295189b2012-06-20 16:38:30 -070010797 @see
10798 @return Result of the function call
10799*/
10800WDI_Status
10801WDI_ProcessAddBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010802(
Jeff Johnson295189b2012-06-20 16:38:30 -070010803 WDI_ControlBlockType* pWDICtx,
10804 WDI_EventInfoType* pEventData
10805)
10806{
10807 WDI_AddBAReqParamsType* pwdiAddBAParams;
10808 WDI_AddBARspCb wdiAddBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010809 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010810 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010811 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010812 wpt_uint16 usDataOffset = 0;
10813 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010814 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010815 wpt_macAddr macBSSID;
10816
10817 tAddBAReqMsg halAddBAReq;
10818 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10819
10820 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010821 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010822 -------------------------------------------------------------------------*/
10823 if (( NULL == pEventData ) ||
10824 ( NULL == pEventData->pEventData) ||
10825 ( NULL == pEventData->pCBfnc ))
10826 {
10827 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10828 "%s: Invalid parameters", __FUNCTION__);
10829 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010830 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010831 }
10832
10833 pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData;
10834 wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc;
10835
10836 /*-------------------------------------------------------------------------
10837 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010838 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010839 -------------------------------------------------------------------------*/
10840 wpalMutexAcquire(&pWDICtx->wptMutex);
10841
10842 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010843 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010844 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010845 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10846 pwdiAddBAParams->wdiBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010847 &macBSSID))
10848 {
10849 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10850 "This station does not exist in the WDI Station Table %d");
10851 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010852 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010853 }
10854
Jeff Johnsone7245742012-09-05 17:12:55 -070010855 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10856 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010857 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10859 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10860 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010861
10862 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010863 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070010864 }
10865
10866 /*------------------------------------------------------------------------
10867 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070010868 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070010869 ------------------------------------------------------------------------*/
10870 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
10871 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010872 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10873 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
10874 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010875
Jeff Johnsone7245742012-09-05 17:12:55 -070010876 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070010877 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010878 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070010879 }
10880
10881
10882 wpalMutexRelease(&pWDICtx->wptMutex);
10883 /*-----------------------------------------------------------------------
10884 Get message buffer
10885 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010886 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070010887 sizeof(halAddBAReq.addBAParams),
10888 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070010889 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070010890 (usDataOffset + sizeof(halAddBAReq.addBAParams) )))
10891 {
10892 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10893 "Unable to get send buffer in Add BA req %x %x %x",
10894 pEventData, pwdiAddBAParams, wdiAddBARspCb);
10895 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010896 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010897 }
10898
Jeff Johnsone7245742012-09-05 17:12:55 -070010899 halAddBAReq.addBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070010900 pwdiAddBAParams->wdiBAInfoType.ucBaSessionID;
10901 halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize;
10902#ifdef FEATURE_ON_CHIP_REORDERING
Jeff Johnsone7245742012-09-05 17:12:55 -070010903 halAddBAReq.addBAParams.isReorderingDoneOnChip =
Jeff Johnson295189b2012-06-20 16:38:30 -070010904 pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip;
10905#endif
10906
Jeff Johnsone7245742012-09-05 17:12:55 -070010907 wpalMemoryCopy( pSendBuffer+usDataOffset,
10908 &halAddBAReq.addBAParams,
10909 sizeof(halAddBAReq.addBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070010910
10911 pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070010912 pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070010913
10914 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010915 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070010916 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010917 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
10918 wdiAddBARspCb, pEventData->pUserData,
10919 WDI_ADD_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070010920}/*WDI_ProcessAddBAReq*/
10921
10922
10923
10924/**
Jeff Johnsone7245742012-09-05 17:12:55 -070010925 @brief Process Trigger BA Request function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070010926 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070010927
10928 @param pWDICtx: pointer to the WLAN DAL context
10929 pEventData: pointer to the event information structure
10930
Jeff Johnson295189b2012-06-20 16:38:30 -070010931 @see
10932 @return Result of the function call
10933*/
10934WDI_Status
10935WDI_ProcessTriggerBAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070010936(
Jeff Johnson295189b2012-06-20 16:38:30 -070010937 WDI_ControlBlockType* pWDICtx,
10938 WDI_EventInfoType* pEventData
10939)
10940{
10941 WDI_TriggerBAReqParamsType* pwdiTriggerBAParams;
10942 WDI_TriggerBARspCb wdiTriggerBARspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070010943 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070010944 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070010945 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070010946 wpt_uint16 usDataOffset = 0;
10947 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070010948 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070010949 wpt_uint16 index;
10950 wpt_macAddr macBSSID;
Jeff Johnsone7245742012-09-05 17:12:55 -070010951
Jeff Johnson295189b2012-06-20 16:38:30 -070010952 tTriggerBAReqMsg halTriggerBAReq;
10953 tTriggerBaReqCandidate* halTriggerBACandidate;
10954 WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate;
10955 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
10956
10957 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010958 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070010959 -------------------------------------------------------------------------*/
10960 if (( NULL == pEventData ) ||
10961 ( NULL == pEventData->pEventData ) ||
10962 ( NULL == pEventData->pCBfnc ))
10963 {
10964 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10965 "%s: Invalid parameters", __FUNCTION__);
10966 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070010967 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010968 }
10969
10970 pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData;
10971 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc;
10972 /*-------------------------------------------------------------------------
10973 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070010974 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070010975 -------------------------------------------------------------------------*/
10976 wpalMutexAcquire(&pWDICtx->wptMutex);
10977
10978 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070010979 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070010980 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070010981 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
10982 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070010983 &macBSSID))
10984 {
10985 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
10986 "This station does not exist in the WDI Station Table %d");
10987 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010988 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070010989 }
10990
Jeff Johnsone7245742012-09-05 17:12:55 -070010991 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
10992 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070010993 {
Jeff Johnsone7245742012-09-05 17:12:55 -070010994 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
10995 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
10996 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070010997
10998 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070010999 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070011000 }
11001
11002 /*------------------------------------------------------------------------
11003 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070011004 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070011005 ------------------------------------------------------------------------*/
11006 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
11007 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011008 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11009 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
11010 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070011011
Jeff Johnsone7245742012-09-05 17:12:55 -070011012 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070011013 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070011014 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011015 }
11016
11017
11018 wpalMutexRelease(&pWDICtx->wptMutex);
11019 /*-----------------------------------------------------------------------
11020 Get message buffer
11021 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011022 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11023 WDI_TRIGGER_BA_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011024 sizeof(halTriggerBAReq.triggerBAParams) +
Jeff Johnsone7245742012-09-05 17:12:55 -070011025 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011026 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt),
11027 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011028 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070011029 (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+
Jeff Johnsone7245742012-09-05 17:12:55 -070011030 (sizeof(tTriggerBaReqCandidate) *
Jeff Johnson295189b2012-06-20 16:38:30 -070011031 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) )))
11032 {
11033 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11034 "Unable to get send buffer in Trigger BA req %x %x %x",
11035 pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb);
11036 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011037 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011038 }
11039
Jeff Johnsone7245742012-09-05 17:12:55 -070011040 halTriggerBAReq.triggerBAParams.baSessionID =
Jeff Johnson295189b2012-06-20 16:38:30 -070011041 pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID;
Jeff Johnsone7245742012-09-05 17:12:55 -070011042 halTriggerBAReq.triggerBAParams.baCandidateCnt =
Jeff Johnson295189b2012-06-20 16:38:30 -070011043 pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt;
11044
Jeff Johnsone7245742012-09-05 17:12:55 -070011045 wpalMemoryCopy( pSendBuffer+usDataOffset,
11046 &halTriggerBAReq.triggerBAParams,
11047 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011048
Jeff Johnsone7245742012-09-05 17:12:55 -070011049 wdiTriggerBACandidate =
Jeff Johnson295189b2012-06-20 16:38:30 -070011050 (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1);
11051 halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+
11052 sizeof(halTriggerBAReq.triggerBAParams));
Jeff Johnsone7245742012-09-05 17:12:55 -070011053
11054 for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ;
Jeff Johnson295189b2012-06-20 16:38:30 -070011055 index++)
11056 {
11057 halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx;
11058 halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap;
11059 halTriggerBACandidate++;
11060 wdiTriggerBACandidate++;
11061 }
11062
11063 pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011064 pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011065
11066 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011067 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011068 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011069 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11070 wdiTriggerBARspCb, pEventData->pUserData,
11071 WDI_TRIGGER_BA_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011072}/*WDI_ProcessTriggerBAReq*/
11073
11074
11075
11076/**
11077 @brief Process Update Beacon Params Request function (called when Main FSM
11078 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011079
11080 @param pWDICtx: pointer to the WLAN DAL context
11081 pEventData: pointer to the event information structure
11082
Jeff Johnson295189b2012-06-20 16:38:30 -070011083 @see
11084 @return Result of the function call
11085*/
11086WDI_Status
11087WDI_ProcessUpdateBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011088(
Jeff Johnson295189b2012-06-20 16:38:30 -070011089 WDI_ControlBlockType* pWDICtx,
11090 WDI_EventInfoType* pEventData
11091)
11092{
11093 WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams;
11094 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011095 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011096 wpt_uint16 usDataOffset = 0;
11097 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011098 tUpdateBeaconParams halUpdateBeaconParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011099 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11100
11101 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011102 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011103 -------------------------------------------------------------------------*/
11104 if (( NULL == pEventData ) ||
11105 ( NULL == pEventData->pEventData) ||
11106 ( NULL == pEventData->pCBfnc))
11107 {
11108 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11109 "%s: Invalid parameters", __FUNCTION__);
11110 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011111 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011112 }
11113
11114 pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData;
11115 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc;
11116 /*-----------------------------------------------------------------------
11117 Get message buffer
11118 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011119 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011120 sizeof(halUpdateBeaconParams),
11121 &pSendBuffer, &usDataOffset, &usSendSize))||
11122 ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) )))
11123 {
11124 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11125 "Unable to get send buffer in set bss key req %x %x %x",
11126 pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb);
11127 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011128 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011129 }
11130
11131 /*BSS Index of the BSS*/
11132 halUpdateBeaconParams.bssIdx =
11133 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx;
11134 /*shortPreamble mode. HAL should update all the STA rates when it
11135 receives this message*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011136 halUpdateBeaconParams.fShortPreamble =
Jeff Johnson295189b2012-06-20 16:38:30 -070011137 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble;
11138 /* short Slot time.*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011139 halUpdateBeaconParams.fShortSlotTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070011140 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime;
11141 /* Beacon Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070011142 halUpdateBeaconParams.beaconInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011143 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval;
11144
11145 /*Protection related */
Jeff Johnsone7245742012-09-05 17:12:55 -070011146 halUpdateBeaconParams.llaCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011147 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011148 halUpdateBeaconParams.llbCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011149 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011150 halUpdateBeaconParams.llgCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011151 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011152 halUpdateBeaconParams.ht20MhzCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011153 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011154 halUpdateBeaconParams.llnNonGFCoexist =
Jeff Johnson295189b2012-06-20 16:38:30 -070011155 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070011156 halUpdateBeaconParams.fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070011157 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport;
11158 halUpdateBeaconParams.fRIFSMode =
11159 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode;
Jeff Johnsone7245742012-09-05 17:12:55 -070011160 halUpdateBeaconParams.paramChangeBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070011161 pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap;
11162
Jeff Johnsone7245742012-09-05 17:12:55 -070011163 wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams,
11164 sizeof(halUpdateBeaconParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011165
11166 pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011167 pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011168
11169 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011170 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011171 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011172 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11173 wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011174}/*WDI_ProcessUpdateBeaconParamsReq*/
11175
11176
11177
11178/**
11179 @brief Process Send Beacon template Request function (called when Main FSM
11180 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011181
11182 @param pWDICtx: pointer to the WLAN DAL context
11183 pEventData: pointer to the event information structure
11184
Jeff Johnson295189b2012-06-20 16:38:30 -070011185 @see
11186 @return Result of the function call
11187*/
11188WDI_Status
11189WDI_ProcessSendBeaconParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011190(
Jeff Johnson295189b2012-06-20 16:38:30 -070011191 WDI_ControlBlockType* pWDICtx,
11192 WDI_EventInfoType* pEventData
11193)
11194{
11195 WDI_SendBeaconParamsType* pwdiSendBeaconParams;
11196 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011197 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011198 wpt_uint16 usDataOffset = 0;
11199 wpt_uint16 usSendSize = 0;
11200 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11201
11202 tSendBeaconReqMsg halSendBeaconReq;
11203 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011204 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011205 -------------------------------------------------------------------------*/
11206 if (( NULL == pEventData ) ||
11207 ( NULL == pEventData->pEventData ) ||
11208 ( NULL == pEventData->pCBfnc ))
11209 {
11210 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11211 "%s: Invalid parameters", __FUNCTION__);
11212 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011213 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011214 }
11215
11216 pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData;
11217 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc;
11218 /*-----------------------------------------------------------------------
11219 Get message buffer
11220 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011221 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011222 sizeof(halSendBeaconReq.sendBeaconParam),
11223 &pSendBuffer, &usDataOffset, &usSendSize))||
11224 ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) )))
11225 {
11226 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11227 "Unable to get send buffer in send beacon req %x %x %x",
11228 pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb);
11229 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011230 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011231 }
11232
11233 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId,
11234 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID,
11235 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011236 halSendBeaconReq.sendBeaconParam.beaconLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070011237 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength;
11238 wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon,
11239 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon,
11240 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength);
11241#ifdef WLAN_SOFTAP_FEATURE
Jeff Johnsone7245742012-09-05 17:12:55 -070011242 halSendBeaconReq.sendBeaconParam.timIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011243 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset;
11244#endif
11245#ifdef WLAN_FEATURE_P2P
Jeff Johnsone7245742012-09-05 17:12:55 -070011246 halSendBeaconReq.sendBeaconParam.p2pIeOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070011247 pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset;
11248#endif
11249
Jeff Johnsone7245742012-09-05 17:12:55 -070011250 wpalMemoryCopy( pSendBuffer+usDataOffset,
11251 &halSendBeaconReq.sendBeaconParam,
11252 sizeof(halSendBeaconReq.sendBeaconParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070011253
11254 pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011255 pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011256
11257 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011258 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011259 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011260 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11261 wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011262}/*WDI_ProcessSendBeaconParamsReq*/
11263
11264/**
11265 @brief Process Update Beacon Params Request function (called when Main FSM
11266 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011267
11268 @param pWDICtx: pointer to the WLAN DAL context
11269 pEventData: pointer to the event information structure
11270
Jeff Johnson295189b2012-06-20 16:38:30 -070011271 @see
11272 @return Result of the function call
11273*/
11274WDI_Status
11275WDI_ProcessUpdateProbeRspTemplateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011276(
Jeff Johnson295189b2012-06-20 16:38:30 -070011277 WDI_ControlBlockType* pWDICtx,
11278 WDI_EventInfoType* pEventData
11279)
11280{
11281 WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams;
11282 WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011283 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011284 wpt_uint16 usDataOffset = 0;
11285 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011286 tSendProbeRespReqParams halUpdateProbeRspTmplParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011287 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11288
11289 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011290 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011291 -------------------------------------------------------------------------*/
11292 if (( NULL == pEventData ) ||
11293 ( NULL == pEventData->pEventData) ||
11294 ( NULL == pEventData->pCBfnc))
11295 {
11296 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11297 "%s: Invalid parameters", __FUNCTION__);
11298 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011299 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011300 }
11301
Jeff Johnsone7245742012-09-05 17:12:55 -070011302 pwdiUpdateProbeRespTmplParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011303 (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011304 wdiUpdateProbeRespTmplRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011305 (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc;
11306 /*-----------------------------------------------------------------------
11307 Get message buffer
11308 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011309 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011310 sizeof(halUpdateProbeRspTmplParams),
11311 &pSendBuffer, &usDataOffset, &usSendSize))||
11312 ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) )))
11313 {
11314 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11315 "Unable to get send buffer in set bss key req %x %x %x",
11316 pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb);
11317 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011318 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011319 }
11320
11321 wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070011322 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070011323 WDI_MAC_ADDR_LEN);
11324
Jeff Johnsone7245742012-09-05 17:12:55 -070011325 halUpdateProbeRspTmplParams.probeRespTemplateLen =
Jeff Johnson295189b2012-06-20 16:38:30 -070011326 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen;
11327
11328 wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate,
11329 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070011330 BEACON_TEMPLATE_SIZE);
Jeff Johnson295189b2012-06-20 16:38:30 -070011331
11332
11333 wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap,
11334 pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap,
11335 WDI_PROBE_REQ_BITMAP_IE_LEN);
11336
Jeff Johnsone7245742012-09-05 17:12:55 -070011337 wpalMemoryCopy( pSendBuffer+usDataOffset,
11338 &halUpdateProbeRspTmplParams,
11339 sizeof(halUpdateProbeRspTmplParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011340
11341 pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011342 pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011343
11344 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011345 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011346 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011347 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11348 wdiUpdateProbeRespTmplRspCb, pEventData->pUserData,
11349 WDI_UPD_PROBE_RSP_TEMPLATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011350}/*WDI_ProcessUpdateProbeRspTemplateReq*/
11351
11352/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011353 @brief Process NV blob download function (called when Main FSM
Jeff Johnson295189b2012-06-20 16:38:30 -070011354 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011355
11356 @param pWDICtx: pointer to the WLAN DAL context
11357 pEventData: pointer to the event information structure
11358
Jeff Johnson295189b2012-06-20 16:38:30 -070011359 @see
11360 @return Result of the function call
11361*/
11362WDI_Status
11363WDI_ProcessNvDownloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011364(
Jeff Johnson295189b2012-06-20 16:38:30 -070011365 WDI_ControlBlockType* pWDICtx,
11366 WDI_EventInfoType* pEventData
11367)
11368{
11369
11370 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL;
11371 WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL;
11372
11373 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011374 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011375 -------------------------------------------------------------------------*/
11376 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011377 ( NULL == (pwdiNvDownloadReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011378 (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070011379 ( NULL == (wdiNvDownloadRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011380 (WDI_NvDownloadRspCb)pEventData->pCBfnc)))
11381 {
11382 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11383 "%s: Invalid parameters", __FUNCTION__);
11384 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011385 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011386 }
11387
11388 /*Intialize the Nv Blob Info */
Jeff Johnsone7245742012-09-05 17:12:55 -070011389 pWDICtx->wdiNvBlobInfo.usTotalFragment =
Jeff Johnson295189b2012-06-20 16:38:30 -070011390 TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize);
11391
11392 /*cache the wdi nv request message here if the the first fragment
11393 * To issue the request to HAL for the next fragment */
11394 if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
11395 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011396 wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq,
11397 pwdiNvDownloadReqParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070011398 sizeof(pWDICtx->wdiCachedNvDownloadReq));
11399
11400 pWDICtx->pfncRspCB = pEventData->pCBfnc;
11401 pWDICtx->pRspCBUserData = pEventData->pUserData;
11402 }
11403
11404 return WDI_SendNvBlobReq(pWDICtx,pEventData);
11405}
11406
11407/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011408 @brief Process Set Max Tx Power Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011409 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011410
11411 @param pWDICtx: pointer to the WLAN DAL context
11412 pEventData: pointer to the event information structure
11413
Jeff Johnson295189b2012-06-20 16:38:30 -070011414 @see
11415 @return Result of the function call
11416*/
11417WDI_Status WDI_ProcessSetMaxTxPowerReq
11418(
11419 WDI_ControlBlockType* pWDICtx,
11420 WDI_EventInfoType* pEventData
11421)
11422{
11423 WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL;
11424 WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011425 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011426 wpt_uint16 usDataOffset = 0;
11427 wpt_uint16 usSendSize = 0;
11428 tSetMaxTxPwrReq halSetMaxTxPower;
11429 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11430
11431 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011432 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011433 -------------------------------------------------------------------------*/
11434 if (( NULL == pEventData ) ||
11435 ( NULL == pEventData->pEventData ) ||
11436 ( NULL == pEventData->pCBfnc ))
11437 {
11438 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11439 "%s: Invalid parameters", __FUNCTION__);
11440 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011441 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011442 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011443 pwdiSetMaxTxPowerParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011444 (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011445 wdiSetMaxTxPowerRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011446 (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc;
11447
11448 /*-----------------------------------------------------------------------
11449 Get message buffer
11450 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011451if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011452 sizeof(halSetMaxTxPower.setMaxTxPwrParams),
11453 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070011454 ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams)
Jeff Johnson295189b2012-06-20 16:38:30 -070011455)))
11456 {
11457 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
11458 "Unable to get Set Max Tx Power req %x %x %x",
11459 pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb);
11460 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011461 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011462 }
11463
11464 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId,
11465 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId,
11466 WDI_MAC_ADDR_LEN);
11467
11468 wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr,
11469 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr,
11470 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070011471 halSetMaxTxPower.setMaxTxPwrParams.power =
Jeff Johnson295189b2012-06-20 16:38:30 -070011472 pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070011473
11474 wpalMemoryCopy( pSendBuffer+usDataOffset,
11475 &halSetMaxTxPower.setMaxTxPwrParams,
11476 sizeof(halSetMaxTxPower.setMaxTxPwrParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011477
11478 pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011479 pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011480
11481 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011482 Send Del TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011483 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011484 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11485 wdiSetMaxTxPowerRspCb, pEventData->pUserData,
11486 WDI_SET_MAX_TX_POWER_RESP);
11487
Jeff Johnson295189b2012-06-20 16:38:30 -070011488}
11489
11490#ifdef WLAN_FEATURE_P2P
11491
11492/**
11493 @brief Process P2P Notice Of Absence Request function (called when Main FSM
11494 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011495
11496 @param pWDICtx: pointer to the WLAN DAL context
11497 pEventData: pointer to the event information structure
11498
Jeff Johnson295189b2012-06-20 16:38:30 -070011499 @see
11500 @return Result of the function call
11501*/
11502WDI_Status
11503WDI_ProcessP2PGONOAReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011504(
Jeff Johnson295189b2012-06-20 16:38:30 -070011505 WDI_ControlBlockType* pWDICtx,
11506 WDI_EventInfoType* pEventData
11507)
11508{
11509 WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams;
11510 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070011511 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011512 wpt_uint16 usDataOffset = 0;
11513 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070011514 tSetP2PGONOAParams halSetP2PGONOAParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070011515 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11516
11517 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011518 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011519 -------------------------------------------------------------------------*/
11520 if (( NULL == pEventData ) ||
11521 ( NULL == pEventData->pEventData) ||
11522 ( NULL == pEventData->pCBfnc))
11523 {
11524 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11525 "%s: Invalid parameters", __FUNCTION__);
11526 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011527 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011528 }
11529
Jeff Johnsone7245742012-09-05 17:12:55 -070011530 pwdiP2PGONOAReqParams =
Jeff Johnson295189b2012-06-20 16:38:30 -070011531 (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070011532 wdiP2PGONOAReqRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070011533 (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc;
11534 /*-----------------------------------------------------------------------
11535 Get message buffer
11536 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011537 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
11538 WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011539 sizeof(halSetP2PGONOAParams),
11540 &pSendBuffer, &usDataOffset, &usSendSize))||
11541 ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) )))
11542 {
11543 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11544 "Unable to get send buffer in set P2P GO NOA REQ %x %x %x",
11545 pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb);
11546 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011547 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011548 }
11549
Jeff Johnsone7245742012-09-05 17:12:55 -070011550 halSetP2PGONOAParams.opp_ps =
Jeff Johnson295189b2012-06-20 16:38:30 -070011551 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps;
Jeff Johnsone7245742012-09-05 17:12:55 -070011552 halSetP2PGONOAParams.ctWindow =
Jeff Johnson295189b2012-06-20 16:38:30 -070011553 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow;
11554 halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount;
Jeff Johnsone7245742012-09-05 17:12:55 -070011555 halSetP2PGONOAParams.duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011556 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011557 halSetP2PGONOAParams.interval =
Jeff Johnson295189b2012-06-20 16:38:30 -070011558 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070011559 halSetP2PGONOAParams.single_noa_duration =
Jeff Johnson295189b2012-06-20 16:38:30 -070011560 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration;
Jeff Johnsone7245742012-09-05 17:12:55 -070011561 halSetP2PGONOAParams.psSelection =
Jeff Johnson295189b2012-06-20 16:38:30 -070011562 pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection;
11563
Jeff Johnsone7245742012-09-05 17:12:55 -070011564 wpalMemoryCopy( pSendBuffer+usDataOffset,
11565 &halSetP2PGONOAParams,
11566 sizeof(halSetP2PGONOAParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070011567
11568 pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011569 pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011570
11571 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011572 Send Update Probe Resp Template Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011573 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011574 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11575 wdiP2PGONOAReqRspCb, pEventData->pUserData,
11576 WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011577}/*WDI_ProcessP2PGONOAReq*/
11578
11579#endif
11580
11581
11582/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011583 @brief Function to handle the ack from DXE once the power
Jeff Johnson295189b2012-06-20 16:38:30 -070011584 state is set.
Jeff Johnsone7245742012-09-05 17:12:55 -070011585 @param None
11586
11587 @see
11588 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070011589*/
11590void
11591WDI_SetPowerStateCb
11592(
11593 wpt_status status,
11594 unsigned int dxePhyAddr,
11595 void *pContext
11596)
11597{
11598 wpt_status wptStatus;
11599 WDI_ControlBlockType *pCB = NULL;
11600 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
11601 if(eWLAN_PAL_STATUS_E_FAILURE == status )
11602 {
11603 //it shouldn't happen, put an error msg
11604 }
Jeff Johnsone7245742012-09-05 17:12:55 -070011605 /*
11606 * Trigger the event to bring the Enter BMPS req function to come
11607 * out of wait
Jeff Johnson295189b2012-06-20 16:38:30 -070011608*/
11609 if( NULL != pContext )
11610 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011611 pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnson295189b2012-06-20 16:38:30 -070011612 }
11613 else
11614 {
Jeff Johnsone7245742012-09-05 17:12:55 -070011615 //put an error msg
Jeff Johnson295189b2012-06-20 16:38:30 -070011616 pCB = &gWDICb;
11617 }
11618 pCB->dxePhyAddr = dxePhyAddr;
11619 wptStatus = wpalEventSet(&pCB->setPowerStateEvent);
11620 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
11621 {
11622 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11623 "Failed to set an event");
11624
Jeff Johnsone7245742012-09-05 17:12:55 -070011625 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011626 }
11627 return;
11628}
11629
11630
11631/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011632 @brief Process Enter IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011633 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011634
11635 @param pWDICtx: pointer to the WLAN DAL context
11636 pEventData: pointer to the event information structure
11637
Jeff Johnson295189b2012-06-20 16:38:30 -070011638 @see
11639 @return Result of the function call
11640*/
11641WDI_Status
11642WDI_ProcessEnterImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011643(
Jeff Johnson295189b2012-06-20 16:38:30 -070011644 WDI_ControlBlockType* pWDICtx,
11645 WDI_EventInfoType* pEventData
11646)
11647{
Jeff Johnson43971f52012-07-17 12:26:56 -070011648 wpt_status wptStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070011649 WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011650 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011651 wpt_uint16 usDataOffset = 0;
11652 wpt_uint16 usSendSize = 0;
11653 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11654
11655 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011656 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011657 -------------------------------------------------------------------------*/
11658 if (( NULL == pEventData ) ||
11659 ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc)))
11660 {
11661 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11662 "%s: Invalid parameters", __FUNCTION__);
11663 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011664 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011665 }
11666
11667 /*-----------------------------------------------------------------------
11668 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011669 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011670 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011671 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011672 0,
11673 &pSendBuffer, &usDataOffset, &usSendSize))||
11674 ( usSendSize < (usDataOffset )))
11675 {
11676 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11677 "Unable to get send buffer in Enter IMPS req %x %x",
11678 pEventData, wdiEnterImpsRspCb);
11679 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011680 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011681 }
11682
11683 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011684 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11685 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011686 {
11687 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11688 "WDI Init failed to reset an event");
11689
Jeff Johnsone7245742012-09-05 17:12:55 -070011690 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011691 return VOS_STATUS_E_FAILURE;
11692 }
11693
11694 // notify DTS that we are entering IMPS
11695 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb);
11696
11697 /*
Jeff Johnsone7245742012-09-05 17:12:55 -070011698 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011699 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011700 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11701 WDI_SET_POWER_STATE_TIMEOUT);
11702 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011703 {
11704 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11705 "WDI Init failed to wait on an event");
11706
Jeff Johnsone7245742012-09-05 17:12:55 -070011707 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011708 return VOS_STATUS_E_FAILURE;
11709 }
11710
11711 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011712 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011713 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011714 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11715 wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011716}/*WDI_ProcessEnterImpsReq*/
11717
11718/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011719 @brief Process Exit IMPS Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070011720 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011721
11722 @param pWDICtx: pointer to the WLAN DAL context
11723 pEventData: pointer to the event information structure
11724
Jeff Johnson295189b2012-06-20 16:38:30 -070011725 @see
11726 @return Result of the function call
11727*/
11728WDI_Status
11729WDI_ProcessExitImpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011730(
Jeff Johnson295189b2012-06-20 16:38:30 -070011731 WDI_ControlBlockType* pWDICtx,
11732 WDI_EventInfoType* pEventData
11733)
11734{
11735 WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011736 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011737 wpt_uint16 usDataOffset = 0;
11738 wpt_uint16 usSendSize = 0;
11739 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11740
11741 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011742 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011743 -------------------------------------------------------------------------*/
11744 if (( NULL == pEventData ) ||
11745 ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc)))
11746 {
11747 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11748 "%s: Invalid parameters", __FUNCTION__);
11749 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011750 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011751 }
11752
11753 /*-----------------------------------------------------------------------
11754 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011755 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011756 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011757 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011758 0,
11759 &pSendBuffer, &usDataOffset, &usSendSize))||
11760 ( usSendSize < (usDataOffset )))
11761 {
11762 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11763 "Unable to get send buffer in Exit IMPS req %x %x",
11764 pEventData, wdiExitImpsRspCb);
11765 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011766 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011767 }
11768
11769 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011770 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011771 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011772 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11773 wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011774}/*WDI_ProcessExitImpsReq*/
11775
11776/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011777 @brief Process Enter BMPS Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011778 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011779
11780 @param pWDICtx: pointer to the WLAN DAL context
11781 pEventData: pointer to the event information structure
11782
Jeff Johnson295189b2012-06-20 16:38:30 -070011783 @see
11784 @return Result of the function call
11785*/
11786WDI_Status
11787WDI_ProcessEnterBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011788(
Jeff Johnson295189b2012-06-20 16:38:30 -070011789 WDI_ControlBlockType* pWDICtx,
11790 WDI_EventInfoType* pEventData
11791)
11792{
11793 WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL;
11794 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011795 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011796 wpt_uint16 usDataOffset = 0;
11797 wpt_uint16 usSendSize = 0;
11798 tHalEnterBmpsReqParams enterBmpsReq;
Jeff Johnson43971f52012-07-17 12:26:56 -070011799 wpt_status wptStatus;
11800
Jeff Johnson295189b2012-06-20 16:38:30 -070011801 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11802
11803 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011804 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011805 -------------------------------------------------------------------------*/
11806 if (( NULL == pEventData ) ||
11807 ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) ||
11808 ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc)))
11809 {
11810 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11811 "%s: Invalid parameters", __FUNCTION__);
11812 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011813 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011814 }
11815
11816 /*-----------------------------------------------------------------------
11817 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011818 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011819 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011820 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011821 sizeof(enterBmpsReq),
11822 &pSendBuffer, &usDataOffset, &usSendSize))||
11823 ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) )))
11824 {
11825 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11826 "Unable to get send buffer in Enter BMPS req %x %x %x",
11827 pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb);
11828 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011829 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011830 }
11831
11832 /* Reset the event to be not signalled */
Jeff Johnson43971f52012-07-17 12:26:56 -070011833 wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
11834 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011835 {
11836 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11837 "WDI Init failed to reset an event");
11838
Jeff Johnsone7245742012-09-05 17:12:55 -070011839 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011840 return VOS_STATUS_E_FAILURE;
11841 }
11842
11843 // notify DTS that we are entering BMPS
11844 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb);
11845
11846/*
Jeff Johnsone7245742012-09-05 17:12:55 -070011847 * Wait for the event to be set once the ACK comes back from DXE
Jeff Johnson295189b2012-06-20 16:38:30 -070011848 */
Jeff Johnson43971f52012-07-17 12:26:56 -070011849 wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent,
11850 WDI_SET_POWER_STATE_TIMEOUT);
11851 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070011852 {
11853 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11854 "WDI Init failed to wait on an event");
11855
Jeff Johnsone7245742012-09-05 17:12:55 -070011856 WDI_ASSERT(0);
Jeff Johnson295189b2012-06-20 16:38:30 -070011857 return VOS_STATUS_E_FAILURE;
11858 }
11859
11860 pWDICtx->bInBmps = eWLAN_PAL_TRUE;
11861
11862 enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx;
11863 enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt;
11864 enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount;
11865 enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod;
11866
11867 // For CCX and 11R Roaming
11868 enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod;
11869 enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage;
11870 enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable;
11871
11872 wpalMemoryCopy( pSendBuffer+usDataOffset,
11873 &enterBmpsReq,
11874 sizeof(enterBmpsReq));
11875
11876 pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011877 pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011878
11879 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011880 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011881 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011882 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11883 wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011884}/*WDI_ProcessEnterBmpsReq*/
11885
11886/**
11887 @brief Process Exit BMPS Request function (called when Main FSM
11888 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011889
11890 @param pWDICtx: pointer to the WLAN DAL context
11891 pEventData: pointer to the event information structure
11892
Jeff Johnson295189b2012-06-20 16:38:30 -070011893 @see
11894 @return Result of the function call
11895*/
11896WDI_Status
11897WDI_ProcessExitBmpsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011898(
Jeff Johnson295189b2012-06-20 16:38:30 -070011899 WDI_ControlBlockType* pWDICtx,
11900 WDI_EventInfoType* pEventData
11901)
11902{
11903 WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL;
11904 WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011905 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011906 wpt_uint16 usDataOffset = 0;
11907 wpt_uint16 usSendSize = 0;
11908 tHalExitBmpsReqParams exitBmpsReq;
11909 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11910
11911 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011912 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011913 -------------------------------------------------------------------------*/
11914 if (( NULL == pEventData ) ||
11915 ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) ||
11916 ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc)))
11917 {
11918 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11919 "%s: Invalid parameters", __FUNCTION__);
11920 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011921 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011922 }
11923
11924 /*-----------------------------------------------------------------------
11925 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011926 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011927 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011928 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070011929 sizeof(exitBmpsReq),
11930 &pSendBuffer, &usDataOffset, &usSendSize))||
11931 ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) )))
11932 {
11933 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11934 "Unable to get send buffer in Exit BMPS req %x %x %x",
11935 pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb);
11936 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011937 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011938 }
11939 exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull;
11940
Jeff Johnsone7245742012-09-05 17:12:55 -070011941 exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx;
11942
Jeff Johnson295189b2012-06-20 16:38:30 -070011943 wpalMemoryCopy( pSendBuffer+usDataOffset,
11944 &exitBmpsReq,
11945 sizeof(exitBmpsReq));
11946
11947 pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070011948 pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070011949
11950 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011951 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070011952 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011953 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
11954 wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070011955}/*WDI_ProcessExitBmpsReq*/
11956
11957/**
Jeff Johnsone7245742012-09-05 17:12:55 -070011958 @brief Process Enter UAPSD Request function (called when Main
Jeff Johnson295189b2012-06-20 16:38:30 -070011959 FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070011960
11961 @param pWDICtx: pointer to the WLAN DAL context
11962 pEventData: pointer to the event information structure
11963
Jeff Johnson295189b2012-06-20 16:38:30 -070011964 @see
11965 @return Result of the function call
11966*/
11967WDI_Status
11968WDI_ProcessEnterUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070011969(
Jeff Johnson295189b2012-06-20 16:38:30 -070011970 WDI_ControlBlockType* pWDICtx,
11971 WDI_EventInfoType* pEventData
11972)
11973{
11974 WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL;
11975 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070011976 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070011977 wpt_uint16 usDataOffset = 0;
11978 wpt_uint16 usSendSize = 0;
11979 tUapsdReqParams enterUapsdReq;
11980 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
11981
11982 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070011983 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070011984 -------------------------------------------------------------------------*/
11985 if (( NULL == pEventData ) ||
11986 ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) ||
11987 ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc)))
11988 {
11989 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
11990 "%s: Invalid parameters", __FUNCTION__);
11991 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070011992 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070011993 }
11994
11995 /*-----------------------------------------------------------------------
11996 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070011997 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070011998 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070011999 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012000 sizeof(enterUapsdReq),
12001 &pSendBuffer, &usDataOffset, &usSendSize))||
12002 ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) )))
12003 {
12004 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12005 "Unable to get send buffer in Enter UAPSD req %x %x %x",
12006 pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb);
12007 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012008 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012009 }
12010
12011 enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled;
12012 enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled;
12013 enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled;
12014 enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled;
12015 enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled;
12016 enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled;
12017 enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled;
12018 enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070012019 enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070012020
Jeff Johnsone7245742012-09-05 17:12:55 -070012021 wpalMemoryCopy( pSendBuffer+usDataOffset,
12022 &enterUapsdReq,
12023 sizeof(enterUapsdReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012024
12025 pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012026 pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012027
12028 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012029 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012030 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012031 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12032 wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012033}/*WDI_ProcessEnterUapsdReq*/
12034
12035/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012036 @brief Process Exit UAPSD Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012037 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012038
12039 @param pWDICtx: pointer to the WLAN DAL context
12040 pEventData: pointer to the event information structure
12041
Jeff Johnson295189b2012-06-20 16:38:30 -070012042 @see
12043 @return Result of the function call
12044*/
12045WDI_Status
12046WDI_ProcessExitUapsdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012047(
Jeff Johnson295189b2012-06-20 16:38:30 -070012048 WDI_ControlBlockType* pWDICtx,
12049 WDI_EventInfoType* pEventData
12050)
12051{
12052 WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012053 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012054 wpt_uint16 usDataOffset = 0;
12055 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012056 WDI_ExitUapsdReqParamsType *pExitUapsdparams;
12057 wpt_uint8 bssIdx = 0;
12058
Jeff Johnson295189b2012-06-20 16:38:30 -070012059 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12060
12061 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012062 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012063 -------------------------------------------------------------------------*/
12064 if (( NULL == pEventData ) ||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012065 ( NULL == (pExitUapsdparams = (WDI_ExitUapsdReqParamsType *)pEventData->pEventData)) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070012066 ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc)))
12067 {
12068 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12069 "%s: Invalid parameters", __FUNCTION__);
12070 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012071 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012072 }
12073
12074 /*-----------------------------------------------------------------------
12075 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012076 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012077 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012078 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012079 sizeof(wpt_uint8),
Jeff Johnson295189b2012-06-20 16:38:30 -070012080 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012081 ( usSendSize < (usDataOffset + sizeof(wpt_uint8))))
Jeff Johnson295189b2012-06-20 16:38:30 -070012082 {
12083 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12084 "Unable to get send buffer in Exit UAPSD req %x %x",
12085 pEventData, wdiExitUapsdRspCb);
12086 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012087 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012088 }
12089
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012090 bssIdx = pExitUapsdparams->wdiExitUapsdInfo.bssIdx;
12091
12092 wpalMemoryCopy( pSendBuffer+usDataOffset,
12093 &bssIdx,
12094 sizeof(wpt_uint8));
12095
12096 pWDICtx->wdiReqStatusCB = pExitUapsdparams->wdiReqStatusCB;
12097 pWDICtx->pReqStatusUserData = pExitUapsdparams->pUserData;
12098
Jeff Johnson295189b2012-06-20 16:38:30 -070012099 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012100 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012101 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012102 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12103 wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012104}/*WDI_ProcessExitUapsdReq*/
12105
12106/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012107 @brief Process Set UAPSD params Request function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070012108 Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012109
12110 @param pWDICtx: pointer to the WLAN DAL context
12111 pEventData: pointer to the event information structure
12112
Jeff Johnson295189b2012-06-20 16:38:30 -070012113 @see
12114 @return Result of the function call
12115*/
12116WDI_Status
12117WDI_ProcessSetUapsdAcParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012118(
Jeff Johnson295189b2012-06-20 16:38:30 -070012119 WDI_ControlBlockType* pWDICtx,
12120 WDI_EventInfoType* pEventData
12121)
12122{
12123 WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL;
12124 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012125 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012126 wpt_uint16 usDataOffset = 0;
12127 wpt_uint16 usSendSize = 0;
12128 tUapsdInfo uapsdAcParamsReq;
12129 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12130
12131 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012132 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012133 -------------------------------------------------------------------------*/
12134 if (( NULL == pEventData ) ||
12135 ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) ||
12136 ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc)))
12137 {
12138 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12139 "%s: Invalid parameters", __FUNCTION__);
12140 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012141 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012142 }
12143
12144 /*-----------------------------------------------------------------------
12145 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012146 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012147 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012148 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012149 sizeof(uapsdAcParamsReq),
12150 &pSendBuffer, &usDataOffset, &usSendSize))||
12151 ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) )))
12152 {
12153 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12154 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12155 pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb);
12156 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012157 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012158 }
12159
12160 uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc;
12161 uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx;
12162 uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp;
12163 uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval;
12164 uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval;
12165 uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval;
12166
Jeff Johnsone7245742012-09-05 17:12:55 -070012167 wpalMemoryCopy( pSendBuffer+usDataOffset,
12168 &uapsdAcParamsReq,
12169 sizeof(uapsdAcParamsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012170
12171 pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012172 pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012173
12174 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012175 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012176 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012177 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12178 wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012179}/*WDI_ProcessSetUapsdAcParamsReq*/
12180
12181/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012182 @brief Process update UAPSD params Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012183 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012184
12185 @param pWDICtx: pointer to the WLAN DAL context
12186 pEventData: pointer to the event information structure
12187
Jeff Johnson295189b2012-06-20 16:38:30 -070012188 @see
12189 @return Result of the function call
12190*/
12191WDI_Status
12192WDI_ProcessUpdateUapsdParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012193(
Jeff Johnson295189b2012-06-20 16:38:30 -070012194 WDI_ControlBlockType* pWDICtx,
12195 WDI_EventInfoType* pEventData
12196)
12197{
12198 WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL;
12199 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012200 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012201 wpt_uint16 usDataOffset = 0;
12202 wpt_uint16 usSendSize = 0;
12203 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12204
12205 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012206 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012207 -------------------------------------------------------------------------*/
12208 if (( NULL == pEventData ) ||
12209 ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) ||
12210 ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc)))
12211 {
12212 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12213 "%s: Invalid parameters", __FUNCTION__);
12214 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012215 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012216 }
12217
12218 /*-----------------------------------------------------------------------
12219 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012220 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012221 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012222 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012223 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo),
12224 &pSendBuffer, &usDataOffset, &usSendSize))||
12225 ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) )))
12226 {
12227 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12228 "Unable to get send buffer in Update UAPSD params req %x %x %x",
12229 pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb);
12230 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012231 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012232 }
12233
Jeff Johnsone7245742012-09-05 17:12:55 -070012234 wpalMemoryCopy( pSendBuffer+usDataOffset,
12235 &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo,
12236 sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012237
12238 pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012239 pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012240
12241 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012242 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012243 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012244 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12245 wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012246}/*WDI_ProcessUpdateUapsdParamsReq*/
12247
12248/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012249 @brief Process Configure RXP filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012250 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012251
12252 @param pWDICtx: pointer to the WLAN DAL context
12253 pEventData: pointer to the event information structure
12254
Jeff Johnson295189b2012-06-20 16:38:30 -070012255 @see
12256 @return Result of the function call
12257*/
12258WDI_Status
12259WDI_ProcessConfigureRxpFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012260(
Jeff Johnson295189b2012-06-20 16:38:30 -070012261 WDI_ControlBlockType* pWDICtx,
12262 WDI_EventInfoType* pEventData
12263)
12264{
12265 WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL;
12266 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012267 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012268 wpt_uint16 usDataOffset = 0;
12269 wpt_uint16 usSendSize = 0;
12270 tHalConfigureRxpFilterReqParams halRxpFilterParams;
12271
12272 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12273
12274 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012275 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012276 -------------------------------------------------------------------------*/
12277 if (( NULL == pEventData ) ||
12278 ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) ||
12279 ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc)))
12280 {
12281 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12282 "%s: Invalid parameters", __FUNCTION__);
12283 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012284 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012285 }
12286
12287 /*-----------------------------------------------------------------------
12288 Get message buffer
12289 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012290 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012291 sizeof(halRxpFilterParams),
12292 &pSendBuffer, &usDataOffset, &usSendSize))||
12293 ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) )))
12294 {
12295 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12296 "Unable to get send buffer in Set UAPSD params req %x %x %x",
12297 pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb);
12298 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012299 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012300 }
12301
Jeff Johnsone7245742012-09-05 17:12:55 -070012302 halRxpFilterParams.setMcstBcstFilterSetting =
Jeff Johnson295189b2012-06-20 16:38:30 -070012303 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting;
Jeff Johnsone7245742012-09-05 17:12:55 -070012304 halRxpFilterParams.setMcstBcstFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070012305 pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter;
12306
Jeff Johnsone7245742012-09-05 17:12:55 -070012307 wpalMemoryCopy( pSendBuffer+usDataOffset,
12308 &halRxpFilterParams,
12309 sizeof(halRxpFilterParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070012310
12311 pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012312 pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012313
12314 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012315 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012316 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012317 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12318 wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012319}/*WDI_ProcessConfigureRxpFilterReq*/
12320
12321/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012322 @brief Process set beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012323 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012324
12325 @param pWDICtx: pointer to the WLAN DAL context
12326 pEventData: pointer to the event information structure
12327
Jeff Johnson295189b2012-06-20 16:38:30 -070012328 @see
12329 @return Result of the function call
12330*/
12331WDI_Status
12332WDI_ProcessSetBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012333(
Jeff Johnson295189b2012-06-20 16:38:30 -070012334 WDI_ControlBlockType* pWDICtx,
12335 WDI_EventInfoType* pEventData
12336)
12337{
12338 WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12339 WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012340 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012341 wpt_uint16 usDataOffset = 0;
12342 wpt_uint16 usSendSize = 0;
12343 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12344
12345 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012346 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012347 -------------------------------------------------------------------------*/
12348 if (( NULL == pEventData ) ||
12349 ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) ||
12350 ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc)))
12351 {
12352 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12353 "%s: Invalid parameters", __FUNCTION__);
12354 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012355 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012356 }
12357
12358 /*-----------------------------------------------------------------------
12359 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012360 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012361 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012362 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012363 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe),
12364 &pSendBuffer, &usDataOffset, &usSendSize))||
12365 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12366 {
12367 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12368 "Unable to get send buffer in Set beacon filter req %x %x %x",
12369 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12370 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012371 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012372 }
12373
Jeff Johnsone7245742012-09-05 17:12:55 -070012374 wpalMemoryCopy( pSendBuffer+usDataOffset,
12375 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12376 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
12377 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12378 &pwdiBeaconFilterParams->aFilters[0],
12379 pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe));
Jeff Johnson295189b2012-06-20 16:38:30 -070012380
12381 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012382 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012383
12384 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012385 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012386 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012387 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12388 wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012389}/*WDI_ProcessSetBeaconFilterReq*/
12390
12391/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012392 @brief Process remove beacon filter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012393 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012394
12395 @param pWDICtx: pointer to the WLAN DAL context
12396 pEventData: pointer to the event information structure
12397
Jeff Johnson295189b2012-06-20 16:38:30 -070012398 @see
12399 @return Result of the function call
12400*/
12401WDI_Status
12402WDI_ProcessRemBeaconFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012403(
Jeff Johnson295189b2012-06-20 16:38:30 -070012404 WDI_ControlBlockType* pWDICtx,
12405 WDI_EventInfoType* pEventData
12406)
12407{
12408 WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL;
12409 WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012410 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012411 wpt_uint16 usDataOffset = 0;
12412 wpt_uint16 usSendSize = 0;
12413 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12414
12415 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012416 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012417 -------------------------------------------------------------------------*/
12418 if (( NULL == pEventData ) ||
12419 ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) ||
12420 ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc)))
12421 {
12422 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12423 "%s: Invalid parameters", __FUNCTION__);
12424 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012425 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012426 }
12427
12428 /*-----------------------------------------------------------------------
12429 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012430 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012431 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012432 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012433 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo),
12434 &pSendBuffer, &usDataOffset, &usSendSize))||
12435 ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) )))
12436 {
12437 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12438 "Unable to get send buffer in remove beacon filter req %x %x %x",
12439 pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb);
12440 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012441 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012442 }
12443
Jeff Johnsone7245742012-09-05 17:12:55 -070012444 wpalMemoryCopy( pSendBuffer+usDataOffset,
12445 &pwdiBeaconFilterParams->wdiBeaconFilterInfo,
12446 sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -070012447
12448 pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012449 pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012450
12451 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012452 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012453 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012454 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12455 wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012456}
12457
12458/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012459 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012460 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012461
12462 @param pWDICtx: pointer to the WLAN DAL context
12463 pEventData: pointer to the event information structure
12464
Jeff Johnson295189b2012-06-20 16:38:30 -070012465 @see
12466 @return Result of the function call
12467*/
12468WDI_Status
12469WDI_ProcessSetRSSIThresholdsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012470(
Jeff Johnson295189b2012-06-20 16:38:30 -070012471 WDI_ControlBlockType* pWDICtx,
12472 WDI_EventInfoType* pEventData
12473)
12474{
12475 WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL;
12476 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012477 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012478 wpt_uint16 usDataOffset = 0;
12479 wpt_uint16 usSendSize = 0;
12480 tHalRSSIThresholds rssiThresholdsReq;
12481 WDI_Status ret_status = 0;
12482 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12483
12484 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012485 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012486 -------------------------------------------------------------------------*/
12487 if (( NULL == pEventData ) ||
12488 ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) ||
12489 ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc)))
12490 {
12491 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12492 "%s: Invalid parameters", __FUNCTION__);
12493 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012494 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012495 }
12496
12497 /*-----------------------------------------------------------------------
12498 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012499 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012500 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012501 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012502 sizeof(rssiThresholdsReq),
12503 &pSendBuffer, &usDataOffset, &usSendSize))||
12504 ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) )))
12505 {
12506 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12507 "Unable to get send buffer in remove beacon filter req %x %x %x",
12508 pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb);
12509 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012510 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012511 }
12512
Jeff Johnsone7245742012-09-05 17:12:55 -070012513 rssiThresholdsReq.bReserved10 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012514 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10;
Jeff Johnsone7245742012-09-05 17:12:55 -070012515 rssiThresholdsReq.bRssiThres1NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012516 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012517 rssiThresholdsReq.bRssiThres1PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012518 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012519 rssiThresholdsReq.bRssiThres2NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012520 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012521 rssiThresholdsReq.bRssiThres2PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012522 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012523 rssiThresholdsReq.bRssiThres3NegNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012524 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012525 rssiThresholdsReq.bRssiThres3PosNotify =
Jeff Johnson295189b2012-06-20 16:38:30 -070012526 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify;
Jeff Johnsone7245742012-09-05 17:12:55 -070012527 rssiThresholdsReq.ucRssiThreshold1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012528 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1;
Jeff Johnsone7245742012-09-05 17:12:55 -070012529 rssiThresholdsReq.ucRssiThreshold2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012530 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2;
Jeff Johnsone7245742012-09-05 17:12:55 -070012531 rssiThresholdsReq.ucRssiThreshold3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070012532 pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3;
12533
Jeff Johnsone7245742012-09-05 17:12:55 -070012534 wpalMemoryCopy( pSendBuffer+usDataOffset,
12535 &rssiThresholdsReq,
12536 sizeof(rssiThresholdsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012537
12538 pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012539 pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012540
12541 /*-------------------------------------------------------------------------
12542 Send Set threshold req to HAL
12543 -------------------------------------------------------------------------*/
12544 if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12545 wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS)
12546 {
12547 // When we are in idle state WDI_STARTED_ST and we receive indication for threshold
12548 // req. Then as a result of processing the threshold cross ind, we trigger
12549 // a Set threshold req, then we need to indicate to WDI that it needs to
12550 // go to busy state as a result of the indication as we sent a req in the
12551 // same WDI context.
12552 // Hence expected state transition is to busy.
12553 pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST;
12554 }
12555
12556 return ret_status;
12557}
12558
12559/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012560 @brief Process set RSSI thresholds Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012561 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012562
12563 @param pWDICtx: pointer to the WLAN DAL context
12564 pEventData: pointer to the event information structure
12565
Jeff Johnson295189b2012-06-20 16:38:30 -070012566 @see
12567 @return Result of the function call
12568*/
12569WDI_Status
12570WDI_ProcessHostOffloadReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012571(
Jeff Johnson295189b2012-06-20 16:38:30 -070012572 WDI_ControlBlockType* pWDICtx,
12573 WDI_EventInfoType* pEventData
12574)
12575{
12576 WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL;
12577 WDI_HostOffloadCb wdiHostOffloadCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012578 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012579 wpt_uint16 usDataOffset = 0;
12580 wpt_uint16 usSendSize = 0;
12581 tHalHostOffloadReq hostOffloadParams;
12582 tHalNSOffloadParams nsOffloadParams;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012583 wpt_uint8 ucCurrentBSSSesIdx = 0;
12584 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012585
12586 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12587
12588 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012589 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012590 -------------------------------------------------------------------------*/
12591 if (( NULL == pEventData ) ||
12592 ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) ||
12593 ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc)))
12594 {
12595 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12596 "%s: Invalid parameters", __FUNCTION__);
12597 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012598 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012599 }
12600
12601 /*-----------------------------------------------------------------------
12602 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012603 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012604 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012605 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012606 sizeof(hostOffloadParams)+sizeof(nsOffloadParams),
12607 &pSendBuffer, &usDataOffset, &usSendSize))||
12608 ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) )))
12609 {
12610 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12611 "Unable to get send buffer in host offload req %x %x %x",
12612 pEventData, pwdiHostOffloadParams, wdiHostOffloadCb);
12613 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012614 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012615 }
12616
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012617 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12618 pwdiHostOffloadParams->wdiHostOffloadInfo.bssId,
12619 &pBSSSes);
12620 if ( NULL == pBSSSes )
12621 {
12622 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12623 " %s : Association for this BSSID does not exist",__FUNCTION__);
12624 return WDI_STATUS_E_FAILURE;
12625 }
12626
Jeff Johnson295189b2012-06-20 16:38:30 -070012627 hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType;
12628 hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable;
Jeff Johnsone7245742012-09-05 17:12:55 -070012629
Jeff Johnson295189b2012-06-20 16:38:30 -070012630 if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType )
12631 {
12632 // ARP Offload
12633 wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr,
12634 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr,
12635 4);
12636 }
12637 else
12638 {
12639 // NS Offload
12640 wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr,
12641 pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr,
12642 16);
12643
12644#ifdef WLAN_NS_OFFLOAD
12645 // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams
12646 wpalMemoryCopy(nsOffloadParams.srcIPv6Addr,
12647 pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr,
12648 16);
12649 wpalMemoryCopy(nsOffloadParams.selfIPv6Addr,
12650 pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr,
12651 16);
12652 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1,
12653 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1,
12654 16);
12655 wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2,
12656 pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2,
12657 16);
12658 wpalMemoryCopy(nsOffloadParams.selfMacAddr,
12659 pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr,
12660 6);
12661 nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid;
12662 nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid;
12663 nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid;
Jeff Johnsone7245742012-09-05 17:12:55 -070012664
Jeff Johnson295189b2012-06-20 16:38:30 -070012665#endif // WLAN_NS_OFFLOAD
12666 }
12667
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012668 nsOffloadParams.bssIdx = pBSSSes->ucBSSIdx;
12669
Jeff Johnson295189b2012-06-20 16:38:30 -070012670 // copy hostOffloadParams into pSendBuffer
12671 wpalMemoryCopy( pSendBuffer+usDataOffset,
12672 &hostOffloadParams,
12673 sizeof(hostOffloadParams));
12674
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012675 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) )
Jeff Johnson295189b2012-06-20 16:38:30 -070012676 {
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012677 // copy nsOffloadParams into pSendBuffer
12678 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070012679 &nsOffloadParams,
12680 sizeof(nsOffloadParams));
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012681 }
12682 else
12683 {
12684#ifdef WLAN_NS_OFFLOAD
12685 if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType )
12686 {
12687 // copy nsOffloadParams into pSendBuffer
12688 wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams),
12689 &nsOffloadParams,
12690 sizeof(nsOffloadParams));
12691 }
12692#endif
12693 }
Jeff Johnson295189b2012-06-20 16:38:30 -070012694
12695 pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012696 pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012697
12698 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012699 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012700 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012701 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12702 wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012703}/*WDI_ProcessHostOffloadReq*/
12704
12705/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012706 @brief Process Keep Alive Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012707 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012708
12709 @param pWDICtx: pointer to the WLAN DAL context
12710 pEventData: pointer to the event information structure
12711
Jeff Johnson295189b2012-06-20 16:38:30 -070012712 @see
12713 @return Result of the function call
12714*/
12715WDI_Status
12716WDI_ProcessKeepAliveReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012717(
Jeff Johnson295189b2012-06-20 16:38:30 -070012718 WDI_ControlBlockType* pWDICtx,
12719 WDI_EventInfoType* pEventData
12720)
12721{
12722 WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL;
12723 WDI_KeepAliveCb wdiKeepAliveCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012724 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012725 wpt_uint16 usDataOffset = 0;
12726 wpt_uint16 usSendSize = 0;
12727 tHalKeepAliveReq keepAliveReq;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012728 wpt_uint8 ucCurrentBSSSesIdx = 0;
12729 WDI_BSSSessionType* pBSSSes = NULL;
12730
Jeff Johnson295189b2012-06-20 16:38:30 -070012731 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12732
12733 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012734 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012735 -------------------------------------------------------------------------*/
12736 if (( NULL == pEventData ) ||
12737 ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) ||
12738 ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc)))
12739 {
12740 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12741 "Invalid parameters in Keep Alive req");
12742 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012743 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012744 }
12745
12746 /*-----------------------------------------------------------------------
12747 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012748 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012749 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012750 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012751 sizeof(keepAliveReq),
12752 &pSendBuffer, &usDataOffset, &usSendSize))||
12753 ( usSendSize < (usDataOffset + sizeof(keepAliveReq) )))
12754 {
12755 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12756 "Unable to get send buffer in keep alive req %x %x %x",
12757 pEventData, pwdiKeepAliveParams, wdiKeepAliveCb);
12758 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012759 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012760 }
12761
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012762 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12763 pwdiKeepAliveParams->wdiKeepAliveInfo.bssId,
12764 &pBSSSes);
12765 if ( NULL == pBSSSes )
12766 {
12767 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12768 " %s : Association for this BSSID does not exist",__FUNCTION__);
12769 return WDI_STATUS_E_FAILURE;
12770 }
12771
Jeff Johnson295189b2012-06-20 16:38:30 -070012772 keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType;
12773 keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod;
12774
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012775 keepAliveReq.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070012776
Jeff Johnson295189b2012-06-20 16:38:30 -070012777 if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2)
12778 {
12779 wpalMemoryCopy(keepAliveReq.hostIpv4Addr,
12780 pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr,
12781 HAL_IPV4_ADDR_LEN);
12782 wpalMemoryCopy(keepAliveReq.destIpv4Addr,
12783 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr,
Jeff Johnsone7245742012-09-05 17:12:55 -070012784 HAL_IPV4_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070012785 wpalMemoryCopy(keepAliveReq.destMacAddr,
12786 pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr,
12787 HAL_MAC_ADDR_LEN);
12788 }
Jeff Johnsone7245742012-09-05 17:12:55 -070012789
12790 wpalMemoryCopy( pSendBuffer+usDataOffset,
12791 &keepAliveReq,
12792 sizeof(keepAliveReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070012793
12794 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12795 "Process keep alive req %d",sizeof(keepAliveReq));
12796
12797 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12798 "Process keep alive req time period %d",keepAliveReq.timePeriod);
12799
12800 pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012801 pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012802
12803 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
12804 "Sending keep alive req to HAL");
12805
12806 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012807 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012808 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012809 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12810 wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012811}/*WDI_ProcessKeepAliveReq*/
12812
12813
12814/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012815 @brief Process Wowl add bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012816 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012817
12818 @param pWDICtx: pointer to the WLAN DAL context
12819 pEventData: pointer to the event information structure
12820
Jeff Johnson295189b2012-06-20 16:38:30 -070012821 @see
12822 @return Result of the function call
12823*/
12824WDI_Status
12825WDI_ProcessWowlAddBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012826(
Jeff Johnson295189b2012-06-20 16:38:30 -070012827 WDI_ControlBlockType* pWDICtx,
12828 WDI_EventInfoType* pEventData
12829)
12830{
12831 WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL;
12832 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012833 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012834 wpt_uint16 usDataOffset = 0;
12835 wpt_uint16 usSendSize = 0;
12836 tHalWowlAddBcastPtrn wowlAddBcPtrnReq;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012837 wpt_uint8 ucCurrentBSSSesIdx = 0;
12838 WDI_BSSSessionType* pBSSSes = NULL;
12839
Jeff Johnson295189b2012-06-20 16:38:30 -070012840 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12841
12842 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012843 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012844 -------------------------------------------------------------------------*/
12845 if (( NULL == pEventData ) ||
12846 ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) ||
12847 ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc)))
12848 {
12849 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12850 "%s: Invalid parameters", __FUNCTION__);
12851 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012852 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012853 }
12854
12855 /*-----------------------------------------------------------------------
12856 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012857 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012858 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012859 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012860 sizeof(wowlAddBcPtrnReq),
12861 &pSendBuffer, &usDataOffset, &usSendSize))||
12862 ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) )))
12863 {
12864 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12865 "Unable to get send buffer in Wowl add bc ptrn req %x %x %x",
12866 pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb);
12867 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012868 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012869 }
12870
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012871 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12872 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.bssId,
12873 &pBSSSes);
12874 if ( NULL == pBSSSes )
12875 {
12876 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12877 " %s : Association for this BSSID does not exist",__FUNCTION__);
12878 return WDI_STATUS_E_FAILURE;
12879 }
12880
Jeff Johnsone7245742012-09-05 17:12:55 -070012881 wowlAddBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012882 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId;
Jeff Johnsone7245742012-09-05 17:12:55 -070012883 wowlAddBcPtrnReq.ucPatternByteOffset =
Jeff Johnson295189b2012-06-20 16:38:30 -070012884 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset;
Jeff Johnsone7245742012-09-05 17:12:55 -070012885 wowlAddBcPtrnReq.ucPatternMaskSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012886 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize;
Jeff Johnsone7245742012-09-05 17:12:55 -070012887 wowlAddBcPtrnReq.ucPatternSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070012888 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize;
12889
12890 if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE)
12891 {
12892 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12893 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12894 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize);
12895 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12896 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12897 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize);
12898 }
12899 else
12900 {
12901 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12902 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12903 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12904 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12905 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12906 HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12907
12908 wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern,
12909 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern,
12910 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12911 wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask,
12912 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask,
12913 pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE);
12914 }
12915
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012916 wowlAddBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx;
12917
Jeff Johnson295189b2012-06-20 16:38:30 -070012918 wpalMemoryCopy( pSendBuffer+usDataOffset,
12919 &wowlAddBcPtrnReq,
12920 sizeof(wowlAddBcPtrnReq));
12921
12922 pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070012923 pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070012924
12925 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012926 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070012927 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012928 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
12929 wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070012930}/*WDI_ProcessWowlAddBcPtrnReq*/
12931
12932/**
Jeff Johnsone7245742012-09-05 17:12:55 -070012933 @brief Process Wowl delete bc ptrn Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070012934 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070012935
12936 @param pWDICtx: pointer to the WLAN DAL context
12937 pEventData: pointer to the event information structure
12938
Jeff Johnson295189b2012-06-20 16:38:30 -070012939 @see
12940 @return Result of the function call
12941*/
12942WDI_Status
12943WDI_ProcessWowlDelBcPtrnReq
Jeff Johnsone7245742012-09-05 17:12:55 -070012944(
Jeff Johnson295189b2012-06-20 16:38:30 -070012945 WDI_ControlBlockType* pWDICtx,
12946 WDI_EventInfoType* pEventData
12947)
12948{
12949 WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL;
12950 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070012951 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012952 wpt_uint16 usDataOffset = 0;
12953 wpt_uint16 usSendSize = 0;
12954 tHalWowlDelBcastPtrn wowlDelBcPtrnReq;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012955 wpt_uint8 ucCurrentBSSSesIdx = 0;
12956 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070012957 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
12958
12959 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070012960 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070012961 -------------------------------------------------------------------------*/
12962 if (( NULL == pEventData ) ||
12963 ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) ||
12964 ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc)))
12965 {
12966 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12967 "%s: Invalid parameters", __FUNCTION__);
12968 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012969 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012970 }
12971
12972 /*-----------------------------------------------------------------------
12973 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070012974 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070012975 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070012976 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070012977 sizeof(wowlDelBcPtrnReq),
12978 &pSendBuffer, &usDataOffset, &usSendSize))||
12979 ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) )))
12980 {
12981 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
12982 "Unable to get send buffer in Wowl del bc ptrn req %x %x %x",
12983 pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb);
12984 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070012985 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070012986 }
12987
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070012988 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
12989 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.bssId,
12990 &pBSSSes);
12991 if ( NULL == pBSSSes )
12992 {
12993 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
12994 " %s : Association for this BSSID does not exist",__FUNCTION__);
12995 return WDI_STATUS_E_FAILURE;
12996 }
12997
Jeff Johnsone7245742012-09-05 17:12:55 -070012998 wowlDelBcPtrnReq.ucPatternId =
Jeff Johnson295189b2012-06-20 16:38:30 -070012999 pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013000
13001 wowlDelBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx;
13002
Jeff Johnsone7245742012-09-05 17:12:55 -070013003 wpalMemoryCopy( pSendBuffer+usDataOffset,
13004 &wowlDelBcPtrnReq,
13005 sizeof(wowlDelBcPtrnReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013006
13007 pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013008 pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013009
13010 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013011 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013012 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013013 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13014 wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013015}/*WDI_ProcessWowlDelBcPtrnReq*/
13016
13017/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013018 @brief Process Wowl enter Request function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070013019 when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013020
13021 @param pWDICtx: pointer to the WLAN DAL context
13022 pEventData: pointer to the event information structure
13023
Jeff Johnson295189b2012-06-20 16:38:30 -070013024 @see
13025 @return Result of the function call
13026*/
13027WDI_Status
13028WDI_ProcessWowlEnterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013029(
Jeff Johnson295189b2012-06-20 16:38:30 -070013030 WDI_ControlBlockType* pWDICtx,
13031 WDI_EventInfoType* pEventData
13032)
13033{
13034 WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL;
13035 WDI_WowlEnterReqCb wdiWowlEnterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013036 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013037 wpt_uint16 usDataOffset = 0;
13038 wpt_uint16 usSendSize = 0;
13039 tHalWowlEnterParams wowlEnterReq;
13040 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13041
13042 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013043 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013044 -------------------------------------------------------------------------*/
13045 if (( NULL == pEventData ) ||
13046 ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) ||
13047 ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc)))
13048 {
13049 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13050 "%s: Invalid parameters", __FUNCTION__);
13051 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013052 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013053 }
13054
13055 /*-----------------------------------------------------------------------
13056 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013057 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013058 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013059 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013060 sizeof(wowlEnterReq),
13061 &pSendBuffer, &usDataOffset, &usSendSize))||
13062 ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) )))
13063 {
13064 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13065 "Unable to get send buffer in Wowl enter req %x %x %x",
13066 pEventData, pwdiWowlEnterParams, wdiWowlEnterCb);
13067 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013068 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013069 }
13070
Jeff Johnsone7245742012-09-05 17:12:55 -070013071 wowlEnterReq.ucMagicPktEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070013072 pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070013073 wowlEnterReq.ucPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070013074 pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070013075 wowlEnterReq.ucUcastPatternFilteringEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070013076 pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070013077 wowlEnterReq.ucWowChnlSwitchRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070013078 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070013079 wowlEnterReq.ucWowDeauthRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070013080 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070013081 wowlEnterReq.ucWowDisassocRcv =
Jeff Johnson295189b2012-06-20 16:38:30 -070013082 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv;
Jeff Johnsone7245742012-09-05 17:12:55 -070013083 wowlEnterReq.ucWowMaxMissedBeacons =
Jeff Johnson295189b2012-06-20 16:38:30 -070013084 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons;
Jeff Johnsone7245742012-09-05 17:12:55 -070013085 wowlEnterReq.ucWowMaxSleepUsec =
Jeff Johnson295189b2012-06-20 16:38:30 -070013086 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec;
13087
13088#ifdef WLAN_WAKEUP_EVENTS
13089 wowlEnterReq.ucWoWEAPIDRequestEnable =
13090 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable;
13091
13092 wowlEnterReq.ucWoWEAPOL4WayEnable =
13093 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable;
13094
13095 wowlEnterReq.ucWowNetScanOffloadMatch =
13096 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch;
13097
13098 wowlEnterReq.ucWowGTKRekeyError =
13099 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError;
13100
13101 wowlEnterReq.ucWoWBSSConnLoss =
13102 pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss;
13103#endif // WLAN_WAKEUP_EVENTS
13104
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013105 wowlEnterReq.bssIdx = pwdiWowlEnterParams->wdiWowlEnterInfo.bssIdx;
13106
Jeff Johnson295189b2012-06-20 16:38:30 -070013107 wpalMemoryCopy(wowlEnterReq.magicPtrn,
13108 pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn,
13109 sizeof(tSirMacAddr));
13110
Jeff Johnsone7245742012-09-05 17:12:55 -070013111 wpalMemoryCopy( pSendBuffer+usDataOffset,
13112 &wowlEnterReq,
13113 sizeof(wowlEnterReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013114
13115 pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013116 pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013117
13118 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013119 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013120 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013121 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13122 wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013123}/*WDI_ProcessWowlEnterReq*/
13124
13125/**
13126 @brief Process Wowl exit Request function (called when Main FSM
13127 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013128
13129 @param pWDICtx: pointer to the WLAN DAL context
13130 pEventData: pointer to the event information structure
13131
Jeff Johnson295189b2012-06-20 16:38:30 -070013132 @see
13133 @return Result of the function call
13134*/
13135WDI_Status
13136WDI_ProcessWowlExitReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013137(
Jeff Johnson295189b2012-06-20 16:38:30 -070013138 WDI_ControlBlockType* pWDICtx,
13139 WDI_EventInfoType* pEventData
13140)
13141{
13142 WDI_WowlExitReqCb wdiWowlExitCb = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013143 WDI_WowlExitReqParamsType* pwdiWowlExitParams = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013144 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013145 wpt_uint16 usDataOffset = 0;
13146 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013147 tHalWowlExitParams wowlExitparams;
Jeff Johnson295189b2012-06-20 16:38:30 -070013148 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13149
13150 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013151 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013152 -------------------------------------------------------------------------*/
13153 if (( NULL == pEventData ) ||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013154 ( NULL == (pwdiWowlExitParams = (WDI_WowlExitReqParamsType *)pEventData->pEventData)) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070013155 ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc)))
13156 {
13157 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13158 "%s: Invalid parameters", __FUNCTION__);
13159 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013160 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013161 }
13162
13163 /*-----------------------------------------------------------------------
13164 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013165 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013166 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013167 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013168 sizeof(wowlExitparams),
Jeff Johnson295189b2012-06-20 16:38:30 -070013169 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013170 ( usSendSize < (usDataOffset + sizeof(wowlExitparams))))
Jeff Johnson295189b2012-06-20 16:38:30 -070013171 {
13172 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13173 "Unable to get send buffer in Wowl Exit req %x %x",
13174 pEventData, wdiWowlExitCb);
13175 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013176 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013177 }
13178
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070013179 wowlExitparams.bssIdx = pwdiWowlExitParams->wdiWowlExitInfo.bssIdx;
13180
13181 wpalMemoryCopy( pSendBuffer+usDataOffset,
13182 &wowlExitparams,
13183 sizeof(wowlExitparams));
Jeff Johnson295189b2012-06-20 16:38:30 -070013184 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013185 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013186 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013187 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13188 wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013189}/*WDI_ProcessWowlExitReq*/
13190
13191/**
13192 @brief Process Configure Apps Cpu Wakeup State Request function
13193 (called when Main FSM allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013194
13195 @param pWDICtx: pointer to the WLAN DAL context
13196 pEventData: pointer to the event information structure
13197
Jeff Johnson295189b2012-06-20 16:38:30 -070013198 @see
13199 @return Result of the function call
13200*/
13201WDI_Status
13202WDI_ProcessConfigureAppsCpuWakeupStateReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013203(
Jeff Johnson295189b2012-06-20 16:38:30 -070013204 WDI_ControlBlockType* pWDICtx,
13205 WDI_EventInfoType* pEventData
13206)
13207{
13208 WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL;
13209 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013210 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013211 wpt_uint16 usDataOffset = 0;
13212 wpt_uint16 usSendSize = 0;
13213 tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams;
13214 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13215
13216 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013217 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013218 -------------------------------------------------------------------------*/
13219 if (( NULL == pEventData ) ||
13220 ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) ||
13221 ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc)))
13222 {
13223 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13224 "%s: Invalid parameters", __FUNCTION__);
13225 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013226 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013227 }
13228
13229 /*-----------------------------------------------------------------------
13230 Get message buffer
13231 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013232 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013233 sizeof(halCfgAppsCpuWakeupStateReqParams),
13234 &pSendBuffer, &usDataOffset, &usSendSize))||
13235 ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) )))
13236 {
13237 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13238 "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x",
13239 pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb);
13240 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013241 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013242 }
13243
Jeff Johnsone7245742012-09-05 17:12:55 -070013244 halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake =
Jeff Johnson295189b2012-06-20 16:38:30 -070013245 pwdiAppsCpuWakeupStateParams->bIsAppsAwake;
13246
Jeff Johnsone7245742012-09-05 17:12:55 -070013247 wpalMemoryCopy( pSendBuffer+usDataOffset,
13248 &halCfgAppsCpuWakeupStateReqParams,
13249 sizeof(halCfgAppsCpuWakeupStateReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070013250
13251 pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013252 pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013253
13254 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013255 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013256 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013257 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
13258 wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData,
13259 WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013260}/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/
13261
13262#ifdef WLAN_FEATURE_VOWIFI_11R
13263/**
13264 @brief Process Aggregated Add TSpec Request function (called when Main FSM
13265 allows it)
Jeff Johnsone7245742012-09-05 17:12:55 -070013266
13267 @param pWDICtx: pointer to the WLAN DAL context
13268 pEventData: pointer to the event information structure
13269
Jeff Johnson295189b2012-06-20 16:38:30 -070013270 @see
13271 @return Result of the function call
13272*/
13273WDI_Status
13274WDI_ProcessAggrAddTSpecReq
Jeff Johnsone7245742012-09-05 17:12:55 -070013275(
Jeff Johnson295189b2012-06-20 16:38:30 -070013276 WDI_ControlBlockType* pWDICtx,
13277 WDI_EventInfoType* pEventData
13278)
13279{
13280 WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams;
13281 WDI_AggrAddTsRspCb wdiAggrAddTSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013282 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070013283 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070013284 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070013285 wpt_uint16 usDataOffset = 0;
13286 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070013287 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013288 wpt_macAddr macBSSID;
13289 tAggrAddTsReq halAggrAddTsReq;
13290 int i;
13291 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13292
13293 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013294 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013295 -------------------------------------------------------------------------*/
13296 if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) ||
13297 ( NULL == pEventData->pCBfnc ))
13298 {
13299 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13300 "%s: Invalid parameters", __FUNCTION__);
13301 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013302 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013303 }
13304 wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 );
13305 pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData;
13306 wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc;
13307 /*-------------------------------------------------------------------------
13308 Check to see if we are in the middle of an association, if so queue, if
Jeff Johnsone7245742012-09-05 17:12:55 -070013309 not it means it is free to process request
Jeff Johnson295189b2012-06-20 16:38:30 -070013310 -------------------------------------------------------------------------*/
13311 wpalMutexAcquire(&pWDICtx->wptMutex);
13312
13313 /*------------------------------------------------------------------------
13314 Find the BSS for which the request is made and identify WDI session
13315 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013316 if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx,
13317 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx,
Jeff Johnson295189b2012-06-20 16:38:30 -070013318 &macBSSID))
13319 {
13320 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13321 "This station does not exist in the WDI Station Table %d");
13322 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013323 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013324 }
13325
Jeff Johnsone7245742012-09-05 17:12:55 -070013326 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes);
13327 if ( NULL == pBSSSes )
Jeff Johnson295189b2012-06-20 16:38:30 -070013328 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013329 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13330 "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR,
13331 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013332
13333 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013334 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070013335 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013336
Jeff Johnson295189b2012-06-20 16:38:30 -070013337 /*------------------------------------------------------------------------
13338 Check if this BSS is being currently processed or queued,
Jeff Johnsone7245742012-09-05 17:12:55 -070013339 if queued - queue the new request as well
Jeff Johnson295189b2012-06-20 16:38:30 -070013340 ------------------------------------------------------------------------*/
13341 if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued )
13342 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013343 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13344 "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR,
13345 __func__, MAC_ADDR_ARRAY(macBSSID));
Jeff Johnson295189b2012-06-20 16:38:30 -070013346
Jeff Johnsone7245742012-09-05 17:12:55 -070013347 wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData);
Jeff Johnson295189b2012-06-20 16:38:30 -070013348 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013349 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070013350 }
13351
13352 wpalMutexRelease(&pWDICtx->wptMutex);
13353 /*-----------------------------------------------------------------------
13354 Get message buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070013355 ! TO DO : proper conversion into the HAL Message Request Format
Jeff Johnson295189b2012-06-20 16:38:30 -070013356 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013357 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070013358 sizeof(tAggrAddTsParams),
13359 &pSendBuffer, &usDataOffset, &usSendSize))||
13360 ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) )))
13361 {
13362 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13363 "Unable to get send buffer in set bss key req %x %x %x",
13364 pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb);
13365 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013366 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013367 }
13368
Jeff Johnsone7245742012-09-05 17:12:55 -070013369 halAggrAddTsReq.aggrAddTsParam.staIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013370 pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070013371 halAggrAddTsReq.aggrAddTsParam.tspecIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070013372 pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx;
13373
13374 for( i = 0; i < WLAN_HAL_MAX_AC; i++ )
13375 {
Jeff Johnsone7245742012-09-05 17:12:55 -070013376 halAggrAddTsReq.aggrAddTsParam.tspec[i].type =
Jeff Johnson295189b2012-06-20 16:38:30 -070013377 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013378 halAggrAddTsReq.aggrAddTsParam.tspec[i].length =
Jeff Johnson295189b2012-06-20 16:38:30 -070013379 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength;
Jeff Johnsone7245742012-09-05 17:12:55 -070013380 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013381 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13382 ackPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013383 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy =
Jeff Johnson295189b2012-06-20 16:38:30 -070013384 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13385 accessPolicy;
Jeff Johnsone7245742012-09-05 17:12:55 -070013386 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio =
Jeff Johnson295189b2012-06-20 16:38:30 -070013387 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13388 userPrio;
Jeff Johnsone7245742012-09-05 17:12:55 -070013389 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb =
Jeff Johnson295189b2012-06-20 16:38:30 -070013390 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13391 psb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013392 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation =
Jeff Johnson295189b2012-06-20 16:38:30 -070013393 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13394 aggregation;
Jeff Johnsone7245742012-09-05 17:12:55 -070013395 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction =
Jeff Johnson295189b2012-06-20 16:38:30 -070013396 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13397 direction;
Jeff Johnsone7245742012-09-05 17:12:55 -070013398 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013399 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13400 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013401 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid =
Jeff Johnson295189b2012-06-20 16:38:30 -070013402 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.
13403 trafficType;
Jeff Johnsone7245742012-09-05 17:12:55 -070013404 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd =
Jeff Johnson295189b2012-06-20 16:38:30 -070013405 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd;
Jeff Johnsone7245742012-09-05 17:12:55 -070013406 halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule =
Jeff Johnson295189b2012-06-20 16:38:30 -070013407 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule;
Jeff Johnsone7245742012-09-05 17:12:55 -070013408
13409
13410 halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013411 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013412 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013413 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013414 halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013415 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013416 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013417 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013418 halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013419 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013420 halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval =
Jeff Johnson295189b2012-06-20 16:38:30 -070013421 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval;
Jeff Johnsone7245742012-09-05 17:12:55 -070013422 halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013423 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070013424 halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013425 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013426 halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013427 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013428 halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013429 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013430 halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz =
Jeff Johnson295189b2012-06-20 16:38:30 -070013431 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz;
Jeff Johnsone7245742012-09-05 17:12:55 -070013432 halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound =
Jeff Johnson295189b2012-06-20 16:38:30 -070013433 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound;
Jeff Johnsone7245742012-09-05 17:12:55 -070013434 halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate =
Jeff Johnson295189b2012-06-20 16:38:30 -070013435 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate;
Jeff Johnsone7245742012-09-05 17:12:55 -070013436 halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw =
Jeff Johnson295189b2012-06-20 16:38:30 -070013437 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw;
Jeff Johnsone7245742012-09-05 17:12:55 -070013438 halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime =
Jeff Johnson295189b2012-06-20 16:38:30 -070013439 pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime;
13440 }
13441
Jeff Johnsone7245742012-09-05 17:12:55 -070013442 wpalMemoryCopy( pSendBuffer+usDataOffset,
13443 &halAggrAddTsReq,
13444 sizeof(halAggrAddTsReq));
Jeff Johnson295189b2012-06-20 16:38:30 -070013445
13446 pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070013447 pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070013448
13449 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013450 Send Add TS Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070013451 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013452 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070013453 wdiAggrAddTSRspCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070013454 WDI_AGGR_ADD_TS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070013455}/*WDI_ProcessAggrAddTSpecReq*/
13456#endif /* WLAN_FEATURE_VOWIFI_11R */
13457
13458/**
13459 @brief Process Shutdown Request function (called when Main FSM
13460 allows it)
13461
13462 @param pWDICtx: pointer to the WLAN DAL context
13463 pEventData: pointer to the event information structure
13464
13465 @see
13466 @return Result of the function call
13467*/
13468WDI_Status
13469WDI_ProcessShutdownReq
13470(
13471 WDI_ControlBlockType* pWDICtx,
13472 WDI_EventInfoType* pEventData
13473 )
13474{
13475 wpt_status wptStatus;
13476
13477
13478 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13479
13480 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013481 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013482 -------------------------------------------------------------------------*/
13483 if ( NULL == pEventData )
13484 {
13485 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13486 "%s: Invalid parameters", __FUNCTION__);
13487 WDI_ASSERT(0);
13488 return WDI_STATUS_E_FAILURE;
13489 }
13490
13491 wpalMutexAcquire(&pWDICtx->wptMutex);
13492
13493
13494 gWDIInitialized = eWLAN_PAL_FALSE;
13495 /*! TO DO: stop the data services */
13496 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13497 {
13498 /*Stop the STA Table !UT- check this logic again
13499 It is safer to do it here than on the response - because a stop is imminent*/
13500 WDI_STATableStop(pWDICtx);
13501
13502 /* Stop Transport Driver, DXE */
13503 WDTS_Stop(pWDICtx);
13504 }
13505
13506 /*Clear all pending request*/
13507 WDI_ClearPendingRequests(pWDICtx);
13508 /* Close Data transport*/
13509 /* FTM mode does not open Data Path */
13510 if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode )
13511 {
13512 WDTS_Close(pWDICtx);
13513 }
13514 /*Close the STA Table !UT- check this logic again*/
13515 WDI_STATableClose(pWDICtx);
13516 /*close the PAL */
13517 wptStatus = wpalClose(pWDICtx->pPALContext);
13518 if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
13519 {
13520 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13521 "Failed to wpal Close %d", wptStatus);
13522 WDI_ASSERT(0);
13523 }
13524
13525 /*Transition back to init state*/
13526 WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST);
13527
13528 wpalMutexRelease(&pWDICtx->wptMutex);
13529
13530 /*Make sure the expected state is properly defaulted to Init*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013531 pWDICtx->ucExpectedStateTransition = WDI_INIT_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070013532
13533
Jeff Johnsone7245742012-09-05 17:12:55 -070013534 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013535}/*WDI_ProcessShutdownReq*/
13536
13537/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013538 Main DAL Control Path Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070013539========================================================================*/
13540
13541/**
13542 @brief Process Start Response function (called when a response
13543 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013544
13545 @param pWDICtx: pointer to the WLAN DAL context
13546 pEventData: pointer to the event information structure
13547
Jeff Johnson295189b2012-06-20 16:38:30 -070013548 @see
13549 @return Result of the function call
13550*/
13551WDI_Status
13552WDI_ProcessStartRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013553(
Jeff Johnson295189b2012-06-20 16:38:30 -070013554 WDI_ControlBlockType* pWDICtx,
13555 WDI_EventInfoType* pEventData
13556)
13557{
13558 WDI_StartRspParamsType wdiRspParams;
13559 WDI_StartRspCb wdiStartRspCb = NULL;
13560
13561 tHalMacStartRspParams* startRspParams;
13562
13563#ifndef HAL_SELF_STA_PER_BSS
13564 WDI_AddStaParams wdiAddSTAParam = {0};
13565#endif
13566 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13567
Jeff Johnsone7245742012-09-05 17:12:55 -070013568 wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013569 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013570 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013571 -------------------------------------------------------------------------*/
13572 if (( NULL == pEventData ) ||
13573 ( NULL == pEventData->pEventData) ||
13574 ( NULL == wdiStartRspCb ))
13575 {
13576 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13577 "%s: Invalid parameters", __FUNCTION__);
13578 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013579 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013580 }
13581
13582 /*-------------------------------------------------------------------------
13583 Extract response and send it to UMAC
13584 -------------------------------------------------------------------------*/
13585 if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize )
13586 {
13587 // not enough data was received
13588 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13589 "Invalid response length in Start Resp Expect %x Rcvd %x",
13590 sizeof(tHalMacStartRspParams), pEventData->uEventDataSize);
13591 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013592 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013593 }
13594
13595 /*-------------------------------------------------------------------------
13596 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013597 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013598 -------------------------------------------------------------------------*/
13599 startRspParams = (tHalMacStartRspParams *) pEventData->pEventData;
13600
13601 wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids;
13602 wdiRspParams.ucMaxStations = startRspParams->ucMaxStations;
13603 wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR;
13604 wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR;
13605 wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION;
13606 wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION;
13607 wdiRspParams.wlanReportedVersion.major =
13608 startRspParams->wcnssWlanVersion.major;
13609 wdiRspParams.wlanReportedVersion.minor =
13610 startRspParams->wcnssWlanVersion.minor;
13611 wdiRspParams.wlanReportedVersion.version =
13612 startRspParams->wcnssWlanVersion.version;
13613 wdiRspParams.wlanReportedVersion.revision =
13614 startRspParams->wcnssWlanVersion.revision;
13615 wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion,
13616 startRspParams->wcnssCrmVersionString,
13617 sizeof(wdiRspParams.wcnssSoftwareVersion));
13618 wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion,
13619 startRspParams->wcnssWlanVersionString,
13620 sizeof(wdiRspParams.wcnssHardwareVersion));
13621 wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status);
13622
13623 wpalMutexAcquire(&pWDICtx->wptMutex);
13624 if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus )
13625 {
13626 pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST;
13627
13628 /*Cache the start response for further use*/
13629 wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams ,
Jeff Johnsone7245742012-09-05 17:12:55 -070013630 &wdiRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070013631 sizeof(pWDICtx->wdiCachedStartRspParams));
13632
13633 }
13634 else
13635 {
13636 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13637 "Failed to start device with status %s(%d)",
13638 WDI_getHALStatusMsgString(startRspParams->status),
13639 startRspParams->status);
13640
13641 /*Set the expected state transition to stopped - because the start has
13642 failed*/
13643 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13644
13645 wpalMutexRelease(&pWDICtx->wptMutex);
13646
13647 /*Notify UMAC*/
13648 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
Jeff Johnsone7245742012-09-05 17:12:55 -070013649
Jeff Johnson295189b2012-06-20 16:38:30 -070013650 WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus);
13651
13652 /*Although the response is an error - it was processed by our function
13653 so as far as the caller is concerned this is a succesful reponse processing*/
13654 return WDI_STATUS_SUCCESS;
13655 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013656
Jeff Johnson295189b2012-06-20 16:38:30 -070013657 wpalMutexRelease(&pWDICtx->wptMutex);
13658
13659 if(eDRIVER_TYPE_MFG == pWDICtx->driverMode)
13660 {
13661 /* FTM mode does not need to execute below */
13662 /* Notify UMAC */
13663 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13664 return WDI_STATUS_SUCCESS;
13665 }
13666
13667 /* START the Data transport */
13668 WDTS_startTransport(pWDICtx);
13669
13670 /*Start the STA Table !- check this logic again*/
13671 WDI_STATableStart(pWDICtx);
13672
13673#ifndef HAL_SELF_STA_PER_BSS
13674 /* Store the Self STA Index */
13675 pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx;
13676
13677 pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId;
13678 wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta,
13679 WDI_MAC_ADDR_LEN);
13680
13681 /* At this point add the self-STA */
13682
13683 /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */
13684 /* !TO DO: wdiAddSTAParam.bcastDpuSignature */
13685 /*! TO DO: wdiAddSTAParam.dpuSig */
13686 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
13687 /*! TO DO: wdiAddSTAParam.ucHTCapable */
13688 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
13689
13690 //all DPU indices are the same for self STA
13691 wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId;
13692 wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId;
13693 wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;;
13694 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta,
13695 WDI_MAC_ADDR_LEN);
13696 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
13697 wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx;
13698
13699 /* Note: Since we don't get an explicit config STA request for self STA, we
13700 add the self STA upon receiving the Start response message. But the
13701 self STA entry in the table is deleted when WDI gets an explicit delete STA
13702 request */
13703 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
13704#endif
13705
13706 /*Notify UMAC*/
13707 wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData);
13708
Jeff Johnsone7245742012-09-05 17:12:55 -070013709 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013710}/*WDI_ProcessStartRsp*/
13711
13712
13713/**
13714 @brief Process Stop Response function (called when a response
13715 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013716
13717 @param pWDICtx: pointer to the WLAN DAL context
13718 pEventData: pointer to the event information structure
13719
Jeff Johnson295189b2012-06-20 16:38:30 -070013720 @see
13721 @return Result of the function call
13722*/
13723WDI_Status
13724WDI_ProcessStopRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013725(
Jeff Johnson295189b2012-06-20 16:38:30 -070013726 WDI_ControlBlockType* pWDICtx,
13727 WDI_EventInfoType* pEventData
13728)
13729{
13730 WDI_Status wdiStatus;
13731 WDI_StopRspCb wdiStopRspCb = NULL;
13732
Jeff Johnsone7245742012-09-05 17:12:55 -070013733 tHalMacStopRspMsg halMacStopRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013734 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13735
Jeff Johnsone7245742012-09-05 17:12:55 -070013736 wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070013737 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013738 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013739 -------------------------------------------------------------------------*/
13740 if (( NULL == pEventData ) ||
13741 ( NULL == pEventData->pEventData) ||
13742 ( NULL == wdiStopRspCb ))
13743 {
13744 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13745 "%s: Invalid parameters", __FUNCTION__);
13746 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013747 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013748 }
13749
13750 /*-------------------------------------------------------------------------
13751 Extract response and send it to UMAC
13752 -------------------------------------------------------------------------*/
13753 if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize )
13754 {
13755 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13756 "Invalid response length in Stop Resp %x %x",
13757 pEventData->uEventDataSize);
13758 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013759 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013760 }
13761
13762 /*-------------------------------------------------------------------------
13763 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013764 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013765 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013766 wpalMemoryCopy( &halMacStopRspMsg.stopRspParams,
13767 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013768 sizeof(halMacStopRspMsg.stopRspParams));
13769
Jeff Johnsone7245742012-09-05 17:12:55 -070013770 wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013771
13772 wpalMutexAcquire(&pWDICtx->wptMutex);
13773
13774 /*--------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013775 Check to see if the stop went OK
Jeff Johnson295189b2012-06-20 16:38:30 -070013776 --------------------------------------------------------------------------*/
13777 if ( WDI_STATUS_SUCCESS != wdiStatus )
13778 {
13779 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13780 "Failed to stop the device with status %s (%d)",
13781 WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status),
13782 halMacStopRspMsg.stopRspParams.status);
13783
Jeff Johnsone7245742012-09-05 17:12:55 -070013784 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
13785
Jeff Johnson295189b2012-06-20 16:38:30 -070013786 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070013787 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013788 }
Jeff Johnsone7245742012-09-05 17:12:55 -070013789
Jeff Johnson295189b2012-06-20 16:38:30 -070013790 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
13791
13792 /*Transition now as WDI may get preempted imediately after it sends
13793 up the Stop Response and it will not get to process the state transition
13794 from Main Rsp function*/
13795 WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition);
13796 wpalMutexRelease(&pWDICtx->wptMutex);
13797
13798 /*! TO DO: - STOP the Data transport */
13799
13800 /*Notify UMAC*/
13801 wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13802
Jeff Johnsone7245742012-09-05 17:12:55 -070013803 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013804}/*WDI_ProcessStopRsp*/
13805
13806/**
13807 @brief Process Close Rsp function (called when a response
13808 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013809
13810 @param pWDICtx: pointer to the WLAN DAL context
13811 pEventData: pointer to the event information structure
13812
Jeff Johnson295189b2012-06-20 16:38:30 -070013813 @see
13814 @return Result of the function call
13815*/
13816WDI_Status
13817WDI_ProcessCloseRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013818(
Jeff Johnson295189b2012-06-20 16:38:30 -070013819 WDI_ControlBlockType* pWDICtx,
13820 WDI_EventInfoType* pEventData
13821)
13822{
13823 /*There is no close response comming from HAL - function just kept for
13824 simmetry */
13825 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013826 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013827}/*WDI_ProcessCloseRsp*/
13828
13829
13830/*============================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070013831 SCAN RESPONSE PROCESSING API
Jeff Johnson295189b2012-06-20 16:38:30 -070013832============================================================================*/
13833
13834/**
13835 @brief Process Init Scan Rsp function (called when a response
13836 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013837
13838 @param pWDICtx: pointer to the WLAN DAL context
13839 pEventData: pointer to the event information structure
13840
Jeff Johnson295189b2012-06-20 16:38:30 -070013841 @see
13842 @return Result of the function call
13843*/
13844WDI_Status
13845WDI_ProcessInitScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013846(
Jeff Johnson295189b2012-06-20 16:38:30 -070013847 WDI_ControlBlockType* pWDICtx,
13848 WDI_EventInfoType* pEventData
13849)
13850{
13851 WDI_Status wdiStatus;
13852 WDI_InitScanRspCb wdiInitScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013853 tHalInitScanRspMsg halInitScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013854 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13855
13856 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013857 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013858 -------------------------------------------------------------------------*/
13859 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13860 ( NULL == pEventData->pEventData))
13861 {
13862 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13863 "%s: Invalid parameters", __FUNCTION__);
13864 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013865 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013866 }
13867
13868 wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB;
13869 if( NULL == wdiInitScanRspCb)
13870 {
13871 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13872 "%s: call back function is NULL", __FUNCTION__);
13873 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013874 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013875 }
13876
13877 /*-------------------------------------------------------------------------
13878 Unpack HAL Response Message - the header was already extracted by the
Jeff Johnsone7245742012-09-05 17:12:55 -070013879 main Response Handling procedure
Jeff Johnson295189b2012-06-20 16:38:30 -070013880 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013881 wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams,
13882 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013883 sizeof(halInitScanRspMsg.initScanRspParams));
13884
Jeff Johnsone7245742012-09-05 17:12:55 -070013885 wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070013886
13887 if ( pWDICtx->bInBmps )
13888 {
13889 // notify DTS that we are entering Full power
13890 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
13891 }
13892
13893 /*Notify UMAC*/
13894 wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
13895
Jeff Johnsone7245742012-09-05 17:12:55 -070013896 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013897}/*WDI_ProcessInitScanRsp*/
13898
13899
13900/**
13901 @brief Process Start Scan Rsp function (called when a response
13902 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013903
13904 @param pWDICtx: pointer to the WLAN DAL context
13905 pEventData: pointer to the event information structure
13906
Jeff Johnson295189b2012-06-20 16:38:30 -070013907 @see
13908 @return Result of the function call
13909*/
13910WDI_Status
13911WDI_ProcessStartScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013912(
Jeff Johnson295189b2012-06-20 16:38:30 -070013913 WDI_ControlBlockType* pWDICtx,
13914 WDI_EventInfoType* pEventData
13915)
13916{
13917 WDI_StartScanRspParamsType wdiStartScanParams;
13918 WDI_StartScanRspCb wdiStartScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070013919
13920 tHalStartScanRspMsg halStartScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070013921 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13922
13923 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070013924 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070013925 -------------------------------------------------------------------------*/
13926 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
13927 ( NULL == pEventData->pEventData))
13928 {
13929 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
13930 "%s: Invalid parameters", __FUNCTION__);
13931 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013932 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013933 }
13934
13935 wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB;
13936 if( NULL == wdiStartScanRspCb)
13937 {
13938 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
13939 "%s: call back function is NULL", __FUNCTION__);
13940 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070013941 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070013942 }
13943
13944 /*-------------------------------------------------------------------------
13945 Extract response and send it to UMAC
13946 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070013947 wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams,
13948 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070013949 sizeof(halStartScanRspMsg.startScanRspParams));
13950
13951 wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
13952 halStartScanRspMsg.startScanRspParams.status);
13953#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070013954 wdiStartScanParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070013955 halStartScanRspMsg.startScanRspParams.txMgmtPower;
Jeff Johnsone7245742012-09-05 17:12:55 -070013956 wpalMemoryCopy( wdiStartScanParams.aStartTSF,
Jeff Johnson295189b2012-06-20 16:38:30 -070013957 halStartScanRspMsg.startScanRspParams.startTSF,
13958 2);
Jeff Johnsone7245742012-09-05 17:12:55 -070013959#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070013960
13961 if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status )
13962 {
13963 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
13964 "Start scan failed with status %s (%d)",
13965 WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status),
13966 halStartScanRspMsg.startScanRspParams.status);
13967 /* send the status to UMAC, don't return from here*/
13968 }
13969
13970 /*Notify UMAC*/
13971 wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData);
13972
Jeff Johnsone7245742012-09-05 17:12:55 -070013973 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070013974
13975}/*WDI_ProcessStartScanRsp*/
13976
13977
13978/**
Jeff Johnsone7245742012-09-05 17:12:55 -070013979 @brief Process End Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070013980 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070013981
13982 @param pWDICtx: pointer to the WLAN DAL context
13983 pEventData: pointer to the event information structure
13984
Jeff Johnson295189b2012-06-20 16:38:30 -070013985 @see
13986 @return Result of the function call
13987*/
13988WDI_Status
13989WDI_ProcessEndScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070013990(
Jeff Johnson295189b2012-06-20 16:38:30 -070013991 WDI_ControlBlockType* pWDICtx,
13992 WDI_EventInfoType* pEventData
13993)
13994{
13995 WDI_Status wdiStatus;
13996 tHalEndScanRspMsg halEndScanRspMsg;
13997 WDI_EndScanRspCb wdiEndScanRspCb;
13998 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
13999
14000 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014001 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014002 -------------------------------------------------------------------------*/
14003 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14004 ( NULL == pEventData->pEventData))
14005 {
14006 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14007 "%s: Invalid parameters", __FUNCTION__);
14008 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014009 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014010 }
14011
14012 wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB;
14013
14014 /*-------------------------------------------------------------------------
14015 Extract response and send it to UMAC
14016 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014017 wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams,
14018 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014019 sizeof(halEndScanRspMsg.endScanRspParams));
14020
Jeff Johnsone7245742012-09-05 17:12:55 -070014021 wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014022
14023 if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status )
14024 {
14025 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14026 "End Scan failed with status %s (%d )",
14027 WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status),
14028 halEndScanRspMsg.endScanRspParams.status);
14029 /* send the status to UMAC, don't return from here*/
14030 }
14031
14032 /*Notify UMAC*/
14033 wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14034
Jeff Johnsone7245742012-09-05 17:12:55 -070014035 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014036}/*WDI_ProcessEndScanRsp*/
14037
14038
14039/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014040 @brief Process Finish Scan Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014041 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014042
14043 @param pWDICtx: pointer to the WLAN DAL context
14044 pEventData: pointer to the event information structure
14045
Jeff Johnson295189b2012-06-20 16:38:30 -070014046 @see
14047 @return Result of the function call
14048*/
14049WDI_Status
14050WDI_ProcessFinishScanRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014051(
Jeff Johnson295189b2012-06-20 16:38:30 -070014052 WDI_ControlBlockType* pWDICtx,
14053 WDI_EventInfoType* pEventData
Jeff Johnsone7245742012-09-05 17:12:55 -070014054)
Jeff Johnson295189b2012-06-20 16:38:30 -070014055{
14056 WDI_Status wdiStatus;
14057 WDI_FinishScanRspCb wdiFinishScanRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014058
14059 tHalFinishScanRspMsg halFinishScanRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014060 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14061
14062 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014063 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014064 -------------------------------------------------------------------------*/
14065 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14066 ( NULL == pEventData->pEventData))
14067 {
14068 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14069 "%s: Invalid parameters", __FUNCTION__);
14070 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014071 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014072 }
14073
14074 wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB;
14075
14076 /*-------------------------------------------------------------------------
14077 Extract response and send it to UMAC
14078 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014079 wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status,
14080 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014081 sizeof(halFinishScanRspMsg.finishScanRspParams.status));
14082
Jeff Johnsone7245742012-09-05 17:12:55 -070014083 wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014084
14085 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
Jeff Johnsone7245742012-09-05 17:12:55 -070014086 "Finish scan response reported status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070014087 halFinishScanRspMsg.finishScanRspParams.status);
14088
14089 if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&&
14090 ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status ))
14091 {
14092 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14093 "Finish Scan failed with status %s (%d)",
14094 WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status),
14095 halFinishScanRspMsg.finishScanRspParams.status);
14096 /* send the status to UMAC, don't return from here*/
14097 }
14098
14099 /*Notify UMAC*/
14100 wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14101
Jeff Johnsone7245742012-09-05 17:12:55 -070014102 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014103}/*WDI_ProcessFinishScanRsp*/
14104
14105/**
14106 @brief Process Join Response function (called when a response
14107 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014108
14109 @param pWDICtx: pointer to the WLAN DAL context
14110 pEventData: pointer to the event information structure
14111
Jeff Johnson295189b2012-06-20 16:38:30 -070014112 @see
14113 @return Result of the function call
14114*/
14115WDI_Status
14116WDI_ProcessJoinRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014117(
Jeff Johnson295189b2012-06-20 16:38:30 -070014118 WDI_ControlBlockType* pWDICtx,
14119 WDI_EventInfoType* pEventData
14120)
14121{
14122 WDI_Status wdiStatus;
14123 WDI_JoinRspCb wdiJoinRspCb;
14124 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014125
14126 tHalJoinRspMsg halJoinRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014127 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14128
14129 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014130 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014131 -------------------------------------------------------------------------*/
14132 if (( NULL == pWDICtx ) ||
14133 ( NULL == pWDICtx->pfncRspCB ) ||
14134 ( NULL == pEventData ) ||
14135 ( NULL == pEventData->pEventData))
14136 {
14137 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14138 "%s: Invalid parameters", __FUNCTION__);
14139 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014140 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014141 }
14142
14143 wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB;
14144
14145 /*-------------------------------------------------------------------------
14146 Extract response and send it to UMAC
14147 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014148 wpalMemoryCopy( &halJoinRspMsg.joinRspParams,
14149 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014150 sizeof(halJoinRspMsg.joinRspParams));
14151
Jeff Johnsone7245742012-09-05 17:12:55 -070014152 wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014153
14154 wpalMutexAcquire(&pWDICtx->wptMutex);
14155
14156 /*-----------------------------------------------------------------------
14157 Join response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014158 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014159 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014160 if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014161 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14162 {
14163 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070014164 "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or "
14165 "association no longer in progress %d - mysterious HAL response",
14166 __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress);
Jeff Johnson295189b2012-06-20 16:38:30 -070014167
Jeff Johnsone7245742012-09-05 17:12:55 -070014168 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
Jeff Johnson295189b2012-06-20 16:38:30 -070014169 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014170 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014171 }
14172
14173 pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx];
14174
14175 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014176 Join Response is only allowed in init state
Jeff Johnson295189b2012-06-20 16:38:30 -070014177 -----------------------------------------------------------------------*/
14178 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14179 {
14180 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14181 "Join only allowed in Joining state - failure state is %d "
14182 "strange HAL response", pBSSSes->wdiAssocState);
14183
Jeff Johnsone7245742012-09-05 17:12:55 -070014184 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14185
Jeff Johnson295189b2012-06-20 16:38:30 -070014186 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014187 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014188 }
14189
14190
14191 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014192 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014193 -----------------------------------------------------------------------*/
14194 if ( WDI_STATUS_SUCCESS != wdiStatus )
14195 {
14196 /*Association was failed by HAL - remove session*/
14197 WDI_DeleteSession(pWDICtx, pBSSSes);
14198
14199 /*Association no longer in progress */
14200 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14201
14202 /*Association no longer in progress - prepare pending assoc for processing*/
14203 WDI_DequeueAssocRequest(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014204
Jeff Johnson295189b2012-06-20 16:38:30 -070014205 }
14206 else
14207 {
14208 /*Transition to state Joining - this may be redundant as we are supposed
14209 to be in this state already - but just to be safe*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014210 pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014211 }
14212
14213 wpalMutexRelease(&pWDICtx->wptMutex);
14214
14215 /*Notify UMAC*/
14216 wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14217
Jeff Johnsone7245742012-09-05 17:12:55 -070014218 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014219}/*WDI_ProcessJoinRsp*/
14220
14221
14222/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014223 @brief Process Config BSS Response function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014224 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014225
14226 @param pWDICtx: pointer to the WLAN DAL context
14227 pEventData: pointer to the event information structure
14228
Jeff Johnson295189b2012-06-20 16:38:30 -070014229 @see
14230 @return Result of the function call
14231*/
14232WDI_Status
14233WDI_ProcessConfigBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014234(
Jeff Johnson295189b2012-06-20 16:38:30 -070014235 WDI_ControlBlockType* pWDICtx,
14236 WDI_EventInfoType* pEventData
14237)
14238{
14239 WDI_ConfigBSSRspParamsType wdiConfigBSSParams;
14240 WDI_ConfigBSSRspCb wdiConfigBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014241 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014242 WDI_BSSSessionType* pBSSSes = NULL;
14243
Jeff Johnsone7245742012-09-05 17:12:55 -070014244 tConfigBssRspMsg halConfigBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014245 WDI_AddStaParams wdiBcastAddSTAParam = {0};
14246 WDI_AddStaParams wdiAddSTAParam = {0};
Jeff Johnsone7245742012-09-05 17:12:55 -070014247
Jeff Johnson295189b2012-06-20 16:38:30 -070014248 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14249
14250 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014251 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014252 -------------------------------------------------------------------------*/
14253 if (( NULL == pEventData ) ||
14254 ( NULL == pEventData->pEventData))
14255 {
14256 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14257 "%s: Invalid parameters", __FUNCTION__);
14258 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014259 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014260 }
14261
14262 wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB;
14263
14264 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014265 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014266 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014267 wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams,
14268 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014269 sizeof(halConfigBssRspMsg.configBssRspParams));
14270
14271 wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
14272 halConfigBssRspMsg.configBssRspParams.status);
14273 if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus)
14274 {
Jeff Johnsone7245742012-09-05 17:12:55 -070014275 wpalMemoryCopy( wdiConfigBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014276 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID,
14277 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014278
Jeff Johnson295189b2012-06-20 16:38:30 -070014279 wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014280
14281 wdiConfigBSSParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014282 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014283
14284 wdiConfigBSSParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014285 halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014286
Jeff Johnson295189b2012-06-20 16:38:30 -070014287 wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014288
Jeff Johnson295189b2012-06-20 16:38:30 -070014289 #ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070014290 wdiConfigBSSParams.ucTxMgmtPower =
Jeff Johnson295189b2012-06-20 16:38:30 -070014291 halConfigBssRspMsg.configBssRspParams.txMgmtPower;
14292 #endif
14293 wpalMemoryCopy( wdiConfigBSSParams.macSTA,
14294 halConfigBssRspMsg.configBssRspParams.staMac,
14295 WDI_MAC_ADDR_LEN );
Jeff Johnsone7245742012-09-05 17:12:55 -070014296
Jeff Johnson295189b2012-06-20 16:38:30 -070014297 wpalMutexAcquire(&pWDICtx->wptMutex);
14298 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014299 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014300 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014301 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
14302 wdiConfigBSSParams.macBSSID,
14303 &pBSSSes);
14304
Jeff Johnson295189b2012-06-20 16:38:30 -070014305 /*-----------------------------------------------------------------------
14306 Config BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014307 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014308 -----------------------------------------------------------------------*/
14309 if ( NULL == pBSSSes )
14310 {
14311 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14312 "Association sequence for this BSS does not yet exist "
14313 "- mysterious HAL response");
Jeff Johnsone7245742012-09-05 17:12:55 -070014314
14315 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14316
Jeff Johnson295189b2012-06-20 16:38:30 -070014317 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014318 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014319 }
Jeff Johnsone7245742012-09-05 17:12:55 -070014320
Jeff Johnson295189b2012-06-20 16:38:30 -070014321 /*Save data for this BSS*/
14322 pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType;
14323 pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014324 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014325 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014326 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014327 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014328 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014329 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014330 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014331 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014332 pBSSSes->ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014333 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
14334 pBSSSes->bcastStaIdx =
14335 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014336
Jeff Johnson295189b2012-06-20 16:38:30 -070014337 /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */
Jeff Johnsone7245742012-09-05 17:12:55 -070014338
Jeff Johnson295189b2012-06-20 16:38:30 -070014339 /*-------------------------------------------------------------------------
14340 Add Peer STA
14341 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014342 wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070014343 wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx;
14344 wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014345
Jeff Johnson295189b2012-06-20 16:38:30 -070014346 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014347 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014348 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014349 wdiAddSTAParam.ucHTCapable =
14350 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable;
14351 wdiAddSTAParam.ucStaType =
14352 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType;
14353
Jeff Johnson295189b2012-06-20 16:38:30 -070014354 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070014355 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
14356 halConfigBssRspMsg.configBssRspParams.staMac,
Jeff Johnson295189b2012-06-20 16:38:30 -070014357 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070014358
14359 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
14360 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID ,
14361 WDI_MAC_ADDR_LEN);
14362
Jeff Johnson295189b2012-06-20 16:38:30 -070014363 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014364 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014365 halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014366 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014367 halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014368 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014369 halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014370 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014371 halConfigBssRspMsg.configBssRspParams.bcastDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014372 wdiAddSTAParam.ucRmfEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070014373 pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070014374 wdiAddSTAParam.ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014375 halConfigBssRspMsg.configBssRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014376
Jeff Johnson295189b2012-06-20 16:38:30 -070014377 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14378 "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014379
Jeff Johnson295189b2012-06-20 16:38:30 -070014380 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
14381 /*-------------------------------------------------------------------------
14382 Add Broadcast STA only in AP mode
14383 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014384 if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode ==
Jeff Johnson295189b2012-06-20 16:38:30 -070014385 WDI_BSS_OPERATIONAL_MODE_AP )
14386 {
14387 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
14388 "Add BCAST STA to table for index: %d",
14389 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
Jeff Johnsone7245742012-09-05 17:12:55 -070014390
14391 wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070014392 sizeof(WDI_AddStaParams) );
Jeff Johnsone7245742012-09-05 17:12:55 -070014393
Jeff Johnson295189b2012-06-20 16:38:30 -070014394 WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam,
14395 halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx );
14396 }
14397 wpalMutexRelease(&pWDICtx->wptMutex);
14398 }
14399 else
14400 {
14401 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14402 "Config BSS RSP failed with status : %s(%d)",
14403 WDI_getHALStatusMsgString(
Jeff Johnsone7245742012-09-05 17:12:55 -070014404 halConfigBssRspMsg.configBssRspParams.status),
Jeff Johnson295189b2012-06-20 16:38:30 -070014405 halConfigBssRspMsg.configBssRspParams.status);
14406
Jeff Johnsone7245742012-09-05 17:12:55 -070014407
Jeff Johnson295189b2012-06-20 16:38:30 -070014408 /*Association was failed by HAL - remove session*/
14409 WDI_DeleteSession(pWDICtx, pBSSSes);
14410
14411 /*Association no longer in progress */
14412 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14413
14414 /*Association no longer in progress - prepare pending assoc for processing*/
14415 WDI_DequeueAssocRequest(pWDICtx);
14416
14417 }
14418
14419 /*Notify UMAC*/
14420 wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData);
14421
Jeff Johnsone7245742012-09-05 17:12:55 -070014422 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014423}/*WDI_ProcessConfigBSSRsp*/
14424
14425
14426/**
14427 @brief Process Del BSS Response function (called when a response
14428 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014429
14430 @param pWDICtx: pointer to the WLAN DAL context
14431 pEventData: pointer to the event information structure
14432
Jeff Johnson295189b2012-06-20 16:38:30 -070014433 @see
14434 @return Result of the function call
14435*/
14436WDI_Status
14437WDI_ProcessDelBSSRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014438(
Jeff Johnson295189b2012-06-20 16:38:30 -070014439 WDI_ControlBlockType* pWDICtx,
14440 WDI_EventInfoType* pEventData
14441)
14442{
14443 WDI_DelBSSRspParamsType wdiDelBSSParams;
14444 WDI_DelBSSRspCb wdiDelBSSRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014445 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014446 WDI_BSSSessionType* pBSSSes = NULL;
14447
Jeff Johnsone7245742012-09-05 17:12:55 -070014448 tDeleteBssRspMsg halDelBssRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014449 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14450
14451 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014452 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014453 -------------------------------------------------------------------------*/
14454 if (( NULL == pEventData ) ||
14455 ( NULL == pEventData->pEventData))
14456 {
14457 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14458 "%s: Invalid parameters", __FUNCTION__);
14459 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014460 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014461 }
14462
14463 wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB;
14464
14465 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014466 Extract response and send it to UMAC
Jeff Johnson295189b2012-06-20 16:38:30 -070014467 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014468 wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams,
14469 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014470 sizeof(halDelBssRspMsg.deleteBssRspParams));
14471
14472
14473 wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
Jeff Johnsone7245742012-09-05 17:12:55 -070014474 halDelBssRspMsg.deleteBssRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014475
14476 wpalMutexAcquire(&pWDICtx->wptMutex);
14477
14478 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014479 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014480 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014481 ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx,
14482 halDelBssRspMsg.deleteBssRspParams.bssIdx,
14483 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014484
14485 /*-----------------------------------------------------------------------
14486 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014487 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014488 -----------------------------------------------------------------------*/
14489 if ( NULL == pBSSSes )
14490 {
14491 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14492 "Association sequence for this BSS does not yet exist or "
14493 "association no longer in progress - mysterious HAL response");
14494
Jeff Johnsone7245742012-09-05 17:12:55 -070014495 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14496
Jeff Johnson295189b2012-06-20 16:38:30 -070014497 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014498 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014499 }
14500
14501 /*Extract BSSID for the response to UMAC*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014502 wpalMemoryCopy(wdiDelBSSParams.macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070014503 pBSSSes->macBSSID, WDI_MAC_ADDR_LEN);
14504
14505 wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx;
14506
14507 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014508 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014509 -----------------------------------------------------------------------*/
14510 WDI_DeleteSession(pWDICtx, pBSSSes);
14511
Jeff Johnsone7245742012-09-05 17:12:55 -070014512
Jeff Johnson295189b2012-06-20 16:38:30 -070014513 /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */
14514 if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType)
14515 {
14516 (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx );
14517 }
14518
14519 /* Delete the STA's in this BSS */
14520 WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx);
Jeff Johnsone7245742012-09-05 17:12:55 -070014521
Jeff Johnson295189b2012-06-20 16:38:30 -070014522 wpalMutexRelease(&pWDICtx->wptMutex);
14523
14524 /*Notify UMAC*/
14525 wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData);
14526
Jeff Johnsone7245742012-09-05 17:12:55 -070014527 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014528}/*WDI_ProcessDelBSSRsp*/
14529
14530/**
14531 @brief Process Post Assoc Rsp function (called when a response
14532 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014533
14534 @param pWDICtx: pointer to the WLAN DAL context
14535 pEventData: pointer to the event information structure
14536
Jeff Johnson295189b2012-06-20 16:38:30 -070014537 @see
14538 @return Result of the function call
14539*/
14540WDI_Status
14541WDI_ProcessPostAssocRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014542(
Jeff Johnson295189b2012-06-20 16:38:30 -070014543 WDI_ControlBlockType* pWDICtx,
14544 WDI_EventInfoType* pEventData
14545)
14546{
14547 WDI_PostAssocRspParamsType wdiPostAssocParams;
14548 WDI_PostAssocRspCb wdiPostAssocRspCb;
Jeff Johnsone7245742012-09-05 17:12:55 -070014549 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070014550 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070014551 tPostAssocRspMsg halPostAssocRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014552 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14553
14554 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014555 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014556 -------------------------------------------------------------------------*/
14557 if (( NULL == pEventData ) ||
14558 ( NULL == pEventData->pEventData))
14559 {
14560 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14561 "%s: Invalid parameters", __FUNCTION__);
14562 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014563 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014564 }
14565
14566 wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB;
14567
14568 /*-------------------------------------------------------------------------
14569 Extract response and send it to UMAC
14570 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014571 wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams,
14572 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014573 sizeof(halPostAssocRspMsg.postAssocRspParams));
14574
14575 /*Extract the Post Assoc STA Params */
14576
Jeff Johnsone7245742012-09-05 17:12:55 -070014577 wdiPostAssocParams.staParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014578 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014579 wdiPostAssocParams.staParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014580 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070014581 wdiPostAssocParams.staParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014582 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14583
Jeff Johnsone7245742012-09-05 17:12:55 -070014584 wdiPostAssocParams.wdiStatus =
14585 WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014586
14587 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14588 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014589 wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA,
14590 pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014591 WDI_MAC_ADDR_LEN);
14592
14593 /* Extract Post Assoc BSS Params */
14594
Jeff Johnsone7245742012-09-05 17:12:55 -070014595 wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID,
14596 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID,
14597 WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070014598
14599 /*Copy the MAC addresses from the cached storage in the WDI CB as they are not
14600 included in the response */
Jeff Johnsone7245742012-09-05 17:12:55 -070014601 wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070014602 pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext
14603 .macSTA, WDI_MAC_ADDR_LEN);
14604
Jeff Johnsone7245742012-09-05 17:12:55 -070014605 wdiPostAssocParams.bssParams.ucBcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014606 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig;
14607
Jeff Johnsone7245742012-09-05 17:12:55 -070014608 wdiPostAssocParams.bssParams.ucUcastSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070014609 halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig;
14610
14611 wdiPostAssocParams.bssParams.ucBSSIdx =
14612 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14613
Jeff Johnsone7245742012-09-05 17:12:55 -070014614 wdiPostAssocParams.bssParams.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014615 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx;
14616
14617 wpalMutexAcquire(&pWDICtx->wptMutex);
14618
14619 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014620 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070014621 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014622 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070014623 wdiPostAssocParams.bssParams.
Jeff Johnsone7245742012-09-05 17:12:55 -070014624 macBSSID, &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070014625
14626 /*-----------------------------------------------------------------------
14627 Post assoc response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070014628 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070014629 -----------------------------------------------------------------------*/
14630 if (( NULL == pBSSSes ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070014631 ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070014632 ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress ))
14633 {
14634 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14635 "Association sequence for this BSS does not yet exist or "
14636 "association no longer in progress - mysterious HAL response");
14637
Jeff Johnsone7245742012-09-05 17:12:55 -070014638 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14639
Jeff Johnson295189b2012-06-20 16:38:30 -070014640 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014641 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014642 }
14643
14644 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014645 Post Assoc Request is only allowed in Joining state
Jeff Johnson295189b2012-06-20 16:38:30 -070014646 -----------------------------------------------------------------------*/
14647 if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState)
14648 {
14649 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14650 "Post Assoc not allowed before JOIN - failing request "
14651 "strange HAL response");
14652
Jeff Johnsone7245742012-09-05 17:12:55 -070014653 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
14654
Jeff Johnson295189b2012-06-20 16:38:30 -070014655 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070014656 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070014657 }
14658
14659 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014660 If assoc has failed the current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070014661 -----------------------------------------------------------------------*/
14662 if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus )
14663 {
14664 /*Association was failed by HAL - remove session*/
14665 WDI_DeleteSession(pWDICtx, pBSSSes);
14666 }
14667 else
14668 {
14669 /*Transition to state POST Assoc*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014670 pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070014671
14672 /*Save DPU Info*/
Jeff Johnsone7245742012-09-05 17:12:55 -070014673 pBSSSes->bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014674 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014675 pBSSSes->bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014676 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature;
Jeff Johnsone7245742012-09-05 17:12:55 -070014677 pBSSSes->bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070014678 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx;
Jeff Johnsone7245742012-09-05 17:12:55 -070014679 pBSSSes->bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070014680 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature;
14681
Jeff Johnsone7245742012-09-05 17:12:55 -070014682 pBSSSes->ucBSSIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070014683 halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx;
14684 }
14685
14686 /*Association no longer in progress */
14687 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
14688
14689 /*Association no longer in progress - prepare pending assoc for processing*/
14690 WDI_DequeueAssocRequest(pWDICtx);
14691
14692 wpalMutexRelease(&pWDICtx->wptMutex);
14693
14694 /*Notify UMAC*/
14695 wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData);
14696
Jeff Johnsone7245742012-09-05 17:12:55 -070014697 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014698}/*WDI_ProcessPostAssocRsp*/
14699
14700/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014701 @brief Process Del STA Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070014702 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014703
14704 @param pWDICtx: pointer to the WLAN DAL context
14705 pEventData: pointer to the event information structure
14706
Jeff Johnson295189b2012-06-20 16:38:30 -070014707 @see
14708 @return Result of the function call
14709*/
14710WDI_Status
14711WDI_ProcessDelSTARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014712(
Jeff Johnson295189b2012-06-20 16:38:30 -070014713 WDI_ControlBlockType* pWDICtx,
14714 WDI_EventInfoType* pEventData
14715)
14716{
14717 WDI_DelSTARspParamsType wdiDelSTARsp;
14718 WDI_DelSTARspCb wdiDelSTARspCb;
14719 wpt_uint8 staType;
Jeff Johnsone7245742012-09-05 17:12:55 -070014720 tDeleteStaRspMsg halDelStaRspMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070014721 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14722
14723 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014724 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014725 -------------------------------------------------------------------------*/
14726 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14727 ( NULL == pEventData->pEventData))
14728 {
14729 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14730 "%s: Invalid parameters", __FUNCTION__);
14731 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014732 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014733 }
14734
14735 wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB;
14736
14737 /*-------------------------------------------------------------------------
14738 Extract response and send it to UMAC
14739 -------------------------------------------------------------------------*/
14740 wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070014741 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070014742 sizeof(halDelStaRspMsg.delStaRspParams));
14743
14744 wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070014745 wdiDelSTARsp.wdiStatus =
14746 WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070014747
14748 WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType);
14749
14750 /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */
14751 if(staType == WDI_STA_ENTRY_SELF)
14752 {
14753 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
14754
14755 /* At this point add the self-STA */
14756
14757 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
14758 /*! TO DO: wdiAddSTAParam.ucHTCapable */
14759 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
14760
14761#define WDI_DPU_SELF_STA_DEFAULT_IDX 0
14762#define WDI_DPU_SELF_STA_DEFAULT_SIG 0
14763
14764 //all DPU indices are the same for self STA
14765 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14766 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14767 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX;
14768 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14769 pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG;
14770 pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG;
Madan Mohan Koyyalamudi15a48f02012-10-05 17:13:53 -070014771
14772 pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX;
Jeff Johnson295189b2012-06-20 16:38:30 -070014773 }
14774 else
14775 {
14776 //Delete the station in the table
14777 WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx);
14778 }
14779
14780 /*Notify UMAC*/
14781 wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData);
14782
Jeff Johnsone7245742012-09-05 17:12:55 -070014783 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014784}/*WDI_ProcessDelSTARsp*/
14785
14786
14787/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070014788 Security Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070014789==========================================================================*/
14790
14791/**
14792 @brief Process Set BSS Key Rsp function (called when a response
14793 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014794
14795 @param pWDICtx: pointer to the WLAN DAL context
14796 pEventData: pointer to the event information structure
14797
Jeff Johnson295189b2012-06-20 16:38:30 -070014798 @see
14799 @return Result of the function call
14800*/
14801WDI_Status
14802WDI_ProcessSetBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014803(
Jeff Johnson295189b2012-06-20 16:38:30 -070014804 WDI_ControlBlockType* pWDICtx,
14805 WDI_EventInfoType* pEventData
14806)
14807{
14808 WDI_Status wdiStatus;
14809 eHalStatus halStatus;
14810 WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb;
14811 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14812
14813 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014814 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014815 -------------------------------------------------------------------------*/
14816 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14817 ( NULL == pEventData->pEventData))
14818 {
14819 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14820 "%s: Invalid parameters", __FUNCTION__);
14821 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014822 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014823 }
14824
14825 wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB;
14826
14827 /*-------------------------------------------------------------------------
14828 Extract response and send it to UMAC
14829 -------------------------------------------------------------------------*/
14830 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014831 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014832
14833 if ( eHAL_STATUS_SUCCESS != halStatus )
14834 {
14835 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14836 "Set BSS Key failed with status %s (%d)",
14837 WDI_getHALStatusMsgString(halStatus),
14838 halStatus);
14839 /* send the status to UMAC, don't return from here*/
14840 }
14841
14842 /*Notify UMAC*/
14843 wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14844
Jeff Johnsone7245742012-09-05 17:12:55 -070014845 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014846}/*WDI_ProcessSetBssKeyRsp*/
14847
14848/**
14849 @brief Process Remove BSS Key Rsp function (called when a response
14850 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014851
14852 @param pWDICtx: pointer to the WLAN DAL context
14853 pEventData: pointer to the event information structure
14854
Jeff Johnson295189b2012-06-20 16:38:30 -070014855 @see
14856 @return Result of the function call
14857*/
14858WDI_Status
14859WDI_ProcessRemoveBssKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014860(
Jeff Johnson295189b2012-06-20 16:38:30 -070014861 WDI_ControlBlockType* pWDICtx,
14862 WDI_EventInfoType* pEventData
14863)
14864{
14865 WDI_Status wdiStatus;
14866 eHalStatus halStatus;
14867 WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb;
14868 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14869
14870 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014871 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014872 -------------------------------------------------------------------------*/
14873 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14874 ( NULL == pEventData->pEventData))
14875 {
14876 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14877 "%s: Invalid parameters", __FUNCTION__);
14878 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014879 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014880 }
14881
14882 wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB;
14883
14884 /*-------------------------------------------------------------------------
14885 Extract response and send it to UMAC
14886 -------------------------------------------------------------------------*/
14887 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014888 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014889
14890 if ( eHAL_STATUS_SUCCESS != halStatus )
14891 {
14892 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14893 "Remove BSS Key failed with status %s (%d )",
14894 WDI_getHALStatusMsgString(halStatus),
14895 halStatus);
14896 /* send the status to UMAC, don't return from here*/
14897 }
14898
14899 /*Notify UMAC*/
14900 wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14901
Jeff Johnsone7245742012-09-05 17:12:55 -070014902 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014903}/*WDI_ProcessSetBssKeyRsp*/
14904
14905
14906/**
14907 @brief Process Set STA Key Rsp function (called when a response
14908 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014909
14910 @param pWDICtx: pointer to the WLAN DAL context
14911 pEventData: pointer to the event information structure
14912
Jeff Johnson295189b2012-06-20 16:38:30 -070014913 @see
14914 @return Result of the function call
14915*/
14916WDI_Status
14917WDI_ProcessSetStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014918(
Jeff Johnson295189b2012-06-20 16:38:30 -070014919 WDI_ControlBlockType* pWDICtx,
14920 WDI_EventInfoType* pEventData
14921)
14922{
14923 WDI_Status wdiStatus;
14924 eHalStatus halStatus;
14925 WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb;
14926 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14927
14928 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014929 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014930 -------------------------------------------------------------------------*/
14931 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14932 ( NULL == pEventData->pEventData))
14933 {
14934 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14935 "%s: Invalid parameters", __FUNCTION__);
14936 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014937 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014938 }
14939
14940 wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
14941
14942 /*-------------------------------------------------------------------------
14943 Extract response and send it to UMAC
14944 -------------------------------------------------------------------------*/
14945 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070014946 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070014947
14948 if ( eHAL_STATUS_SUCCESS != halStatus )
14949 {
14950 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
14951 "Set STA Key failed with status %s (%d)",
14952 WDI_getHALStatusMsgString(halStatus),
14953 halStatus);
14954 /* send the status to UMAC, don't return from here*/
14955 }
14956
14957 /*Notify UMAC*/
14958 wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
14959
Jeff Johnsone7245742012-09-05 17:12:55 -070014960 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070014961}/*WDI_ProcessSetSTAKeyRsp*/
14962
14963/**
Jeff Johnsone7245742012-09-05 17:12:55 -070014964 @brief Process Remove STA Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070014965 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070014966
14967 @param pWDICtx: pointer to the WLAN DAL context
14968 pEventData: pointer to the event information structure
14969
Jeff Johnson295189b2012-06-20 16:38:30 -070014970 @see
14971 @return Result of the function call
14972*/
14973WDI_Status
14974WDI_ProcessRemoveStaKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070014975(
Jeff Johnson295189b2012-06-20 16:38:30 -070014976 WDI_ControlBlockType* pWDICtx,
14977 WDI_EventInfoType* pEventData
14978)
14979{
14980 WDI_Status wdiStatus;
14981 eHalStatus halStatus;
14982 WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb;
14983 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
14984
14985 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070014986 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070014987 -------------------------------------------------------------------------*/
14988 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
14989 ( NULL == pEventData->pEventData))
14990 {
14991 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
14992 "%s: Invalid parameters", __FUNCTION__);
14993 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070014994 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070014995 }
14996
14997 wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
14998
14999 /*-------------------------------------------------------------------------
15000 Extract response and send it to UMAC
15001 -------------------------------------------------------------------------*/
15002 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015003 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015004
15005 if ( eHAL_STATUS_SUCCESS != halStatus )
15006 {
15007 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15008 "Remove STA Key failed with status %s (%d)",
15009 WDI_getHALStatusMsgString(halStatus),
15010 halStatus);
15011 /* send the status to UMAC, don't return from here*/
15012 }
15013
15014 /*Notify UMAC*/
15015 wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15016
Jeff Johnsone7245742012-09-05 17:12:55 -070015017 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015018}/*WDI_ProcessRemoveStaKeyRsp*/
15019
15020/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015021 @brief Process Set STA Bcast Key Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015022 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015023
15024 @param pWDICtx: pointer to the WLAN DAL context
15025 pEventData: pointer to the event information structure
15026
Jeff Johnson295189b2012-06-20 16:38:30 -070015027 @see
15028 @return Result of the function call
15029*/
15030WDI_Status
15031WDI_ProcessSetStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015032(
Jeff Johnson295189b2012-06-20 16:38:30 -070015033 WDI_ControlBlockType* pWDICtx,
15034 WDI_EventInfoType* pEventData
15035)
15036{
15037 WDI_Status wdiStatus;
15038 eHalStatus halStatus;
15039 WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb;
15040 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15041
15042 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015043 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015044 -------------------------------------------------------------------------*/
15045 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15046 ( NULL == pEventData->pEventData))
15047 {
15048 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15049 "%s: Invalid parameters", __FUNCTION__);
15050 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015051 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015052 }
15053
15054 wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB;
15055
15056 /*-------------------------------------------------------------------------
15057 Extract response and send it to UMAC
15058 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015059 wpalMemoryCopy( &halStatus,
15060 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015061 sizeof(halStatus));
15062
Jeff Johnsone7245742012-09-05 17:12:55 -070015063 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015064
15065 if ( eHAL_STATUS_SUCCESS != halStatus )
15066 {
15067 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15068 "Set STA Key failed with status %s (%d)",
15069 WDI_getHALStatusMsgString(halStatus),
15070 halStatus);
15071 /* send the status to UMAC, don't return from here*/
15072 }
15073
15074 /*Notify UMAC*/
15075 wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15076
Jeff Johnsone7245742012-09-05 17:12:55 -070015077 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015078}/*WDI_ProcessSetSTABcastKeyRsp*/
15079
15080/**
15081 @brief Process Remove STA Bcast Key Rsp function (called when a
15082 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015083
15084 @param pWDICtx: pointer to the WLAN DAL context
15085 pEventData: pointer to the event information structure
15086
Jeff Johnson295189b2012-06-20 16:38:30 -070015087 @see
15088 @return Result of the function call
15089*/
15090WDI_Status
15091WDI_ProcessRemoveStaBcastKeyRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015092(
Jeff Johnson295189b2012-06-20 16:38:30 -070015093 WDI_ControlBlockType* pWDICtx,
15094 WDI_EventInfoType* pEventData
15095)
15096{
15097 WDI_Status wdiStatus;
15098 eHalStatus halStatus;
15099 WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb;
15100 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15101
15102 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015103 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015104 -------------------------------------------------------------------------*/
15105 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15106 ( NULL == pEventData->pEventData))
15107 {
15108 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15109 "%s: Invalid parameters", __FUNCTION__);
15110 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015111 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015112 }
15113
15114 wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB;
15115
15116 /*-------------------------------------------------------------------------
15117 Extract response and send it to UMAC
15118 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015119 wpalMemoryCopy( &halStatus,
15120 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015121 sizeof(halStatus));
15122
Jeff Johnsone7245742012-09-05 17:12:55 -070015123 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015124
15125 if ( eHAL_STATUS_SUCCESS != halStatus )
15126 {
15127 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15128 "Remove STA Key failed with status %s (%d)",
15129 WDI_getHALStatusMsgString(halStatus),
15130 halStatus);
15131 /* send the status to UMAC, don't return from here*/
15132 }
15133
15134 /*Notify UMAC*/
15135 wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15136
Jeff Johnsone7245742012-09-05 17:12:55 -070015137 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015138}/*WDI_ProcessRemoveStaBcastKeyRsp*/
15139
15140
15141/*==========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015142 QoS and BA Response Processing Functions
Jeff Johnson295189b2012-06-20 16:38:30 -070015143==========================================================================*/
15144
15145/**
15146 @brief Process Add TSpec Rsp function (called when a response
15147 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015148
15149 @param pWDICtx: pointer to the WLAN DAL context
15150 pEventData: pointer to the event information structure
15151
Jeff Johnson295189b2012-06-20 16:38:30 -070015152 @see
15153 @return Result of the function call
15154*/
15155WDI_Status
15156WDI_ProcessAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015157(
Jeff Johnson295189b2012-06-20 16:38:30 -070015158 WDI_ControlBlockType* pWDICtx,
15159 WDI_EventInfoType* pEventData
15160)
15161{
15162 WDI_Status wdiStatus;
15163 eHalStatus halStatus;
15164 WDI_AddTsRspCb wdiAddTsRspCb;
15165 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15166
15167 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015168 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015169 -------------------------------------------------------------------------*/
15170 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15171 ( NULL == pEventData->pEventData))
15172 {
15173 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15174 "%s: Invalid parameters", __FUNCTION__);
15175 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015176 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015177 }
15178
15179 wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
15180
15181 /*-------------------------------------------------------------------------
15182 Extract response and send it to UMAC
15183 -------------------------------------------------------------------------*/
15184 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015185 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015186
15187 /*Notify UMAC*/
15188 wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15189
Jeff Johnsone7245742012-09-05 17:12:55 -070015190 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015191}/*WDI_ProcessAddTSpecRsp*/
15192
15193
15194/**
15195 @brief Process Del TSpec Rsp function (called when a response
15196 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015197
15198 @param pWDICtx: pointer to the WLAN DAL context
15199 pEventData: pointer to the event information structure
15200
Jeff Johnson295189b2012-06-20 16:38:30 -070015201 @see
15202 @return Result of the function call
15203*/
15204WDI_Status
15205WDI_ProcessDelTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015206(
Jeff Johnson295189b2012-06-20 16:38:30 -070015207 WDI_ControlBlockType* pWDICtx,
15208 WDI_EventInfoType* pEventData
15209)
15210{
15211 WDI_Status wdiStatus;
15212 eHalStatus halStatus;
15213 WDI_DelTsRspCb wdiDelTsRspCb;
15214 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15215
15216 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015217 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015218 -------------------------------------------------------------------------*/
15219 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15220 ( NULL == pEventData->pEventData))
15221 {
15222 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15223 "%s: Invalid parameters", __FUNCTION__);
15224 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015225 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015226 }
15227
15228 wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB;
15229
15230 /*-------------------------------------------------------------------------
15231 Extract response and send it to UMAC
15232 -------------------------------------------------------------------------*/
15233 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015234 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015235
15236 /*Notify UMAC*/
15237 wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15238
Jeff Johnsone7245742012-09-05 17:12:55 -070015239 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015240}/*WDI_ProcessDelTSpecRsp*/
15241
15242/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015243 @brief Process Update EDCA Parameters Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015244 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015245
15246 @param pWDICtx: pointer to the WLAN DAL context
15247 pEventData: pointer to the event information structure
15248
Jeff Johnson295189b2012-06-20 16:38:30 -070015249 @see
15250 @return Result of the function call
15251*/
15252WDI_Status
15253WDI_ProcessUpdateEDCAParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015254(
Jeff Johnson295189b2012-06-20 16:38:30 -070015255 WDI_ControlBlockType* pWDICtx,
15256 WDI_EventInfoType* pEventData
15257)
15258{
15259 WDI_Status wdiStatus;
15260 eHalStatus halStatus;
15261 WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb;
15262 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15263
15264 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015265 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015266 -------------------------------------------------------------------------*/
15267 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15268 ( NULL == pEventData->pEventData))
15269 {
15270 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15271 "%s: Invalid parameters", __FUNCTION__);
15272 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015273 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015274 }
15275
15276 wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB;
15277
15278 /*-------------------------------------------------------------------------
15279 Extract response and send it to UMAC
15280 -------------------------------------------------------------------------*/
15281 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015282 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015283
15284 /*Notify UMAC*/
15285 wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15286
Jeff Johnsone7245742012-09-05 17:12:55 -070015287 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015288}/*WDI_ProcessUpdateEDCAParamsRsp*/
15289
15290
15291/**
15292 @brief Process Add BA Rsp function (called when a response
15293 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015294
15295 @param pWDICtx: pointer to the WLAN DAL context
15296 pEventData: pointer to the event information structure
15297
Jeff Johnson295189b2012-06-20 16:38:30 -070015298 @see
15299 @return Result of the function call
15300*/
15301WDI_Status
15302WDI_ProcessAddBASessionRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015303(
Jeff Johnson295189b2012-06-20 16:38:30 -070015304 WDI_ControlBlockType* pWDICtx,
15305 WDI_EventInfoType* pEventData
15306)
15307{
15308 WDI_AddBASessionRspCb wdiAddBASessionRspCb;
15309
15310 tAddBASessionRspParams halBASessionRsp;
15311 WDI_AddBASessionRspParamsType wdiBASessionRsp;
15312
Jeff Johnsone7245742012-09-05 17:12:55 -070015313
Jeff Johnson295189b2012-06-20 16:38:30 -070015314 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15315
15316 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015317 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015318 -------------------------------------------------------------------------*/
15319 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15320 ( NULL == pEventData->pEventData))
15321 {
15322 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15323 "%s: Invalid parameters", __FUNCTION__);
15324 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015325 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015326 }
15327
15328 wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB;
15329
15330 /*-------------------------------------------------------------------------
15331 Extract response and send it to UMAC
15332 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015333 wpalMemoryCopy( &halBASessionRsp,
15334 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015335 sizeof(halBASessionRsp));
15336
15337 wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
15338
Jeff Johnson43971f52012-07-17 12:26:56 -070015339 if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070015340 {
15341 wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
15342 wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
15343 wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize;
15344 wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID;
15345 wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize;
15346 wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID;
15347 wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN;
15348 }
15349
15350 /*Notify UMAC*/
15351 wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData);
15352
Jeff Johnsone7245742012-09-05 17:12:55 -070015353 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015354}/*WDI_ProcessAddSessionBARsp*/
15355
15356
15357/**
15358 @brief Process Del BA Rsp function (called when a response
15359 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015360
15361 @param pWDICtx: pointer to the WLAN DAL context
15362 pEventData: pointer to the event information structure
15363
Jeff Johnson295189b2012-06-20 16:38:30 -070015364 @see
15365 @return Result of the function call
15366*/
15367WDI_Status
15368WDI_ProcessDelBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015369(
Jeff Johnson295189b2012-06-20 16:38:30 -070015370 WDI_ControlBlockType* pWDICtx,
15371 WDI_EventInfoType* pEventData
15372)
15373{
15374 WDI_Status wdiStatus;
15375 eHalStatus halStatus;
15376 WDI_DelBARspCb wdiDelBARspCb;
15377 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15378
15379 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015380 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015381 -------------------------------------------------------------------------*/
15382 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15383 ( NULL == pEventData->pEventData))
15384 {
15385 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15386 "%s: Invalid parameters", __FUNCTION__);
15387 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015388 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015389 }
15390
15391 wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB;
15392
15393 /*-------------------------------------------------------------------------
15394 Extract response and send it to UMAC
15395 -------------------------------------------------------------------------*/
15396 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070015397 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015398
15399 if ( eHAL_STATUS_SUCCESS == halStatus )
15400 {
15401 /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/
15402 }
15403
15404 /*Notify UMAC*/
15405 wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData);
15406
Jeff Johnsone7245742012-09-05 17:12:55 -070015407 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015408}/*WDI_ProcessDelBARsp*/
15409
15410#ifdef FEATURE_WLAN_CCX
15411/**
15412 @brief Process TSM Stats Rsp function (called when a response
15413 is being received over the bus from HAL)
15414
15415 @param pWDICtx: pointer to the WLAN DAL context
15416 pEventData: pointer to the event information structure
15417
15418 @see
15419 @return Result of the function call
15420*/
15421WDI_Status
15422WDI_ProcessTsmStatsRsp
15423(
15424 WDI_ControlBlockType* pWDICtx,
15425 WDI_EventInfoType* pEventData
15426)
15427{
15428 WDI_TsmRspCb wdiTsmStatsRspCb;
15429 tTsmStatsRspMsg halTsmStatsRspMsg;
15430 WDI_TSMStatsRspParamsType wdiTsmStatsRspParams;
15431 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15432
15433 /*-------------------------------------------------------------------------
15434 Sanity check
15435 -------------------------------------------------------------------------*/
15436 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15437 ( NULL == pEventData->pEventData))
15438 {
15439 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15440 "%s: Invalid parameters", __FUNCTION__);
15441 WDI_ASSERT(0);
15442 return WDI_STATUS_E_FAILURE;
15443 }
15444
15445 wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB;
15446
15447 /*-------------------------------------------------------------------------
15448 Unpack HAL Response Message - the header was already extracted by the
15449 main Response Handling procedure
15450 -------------------------------------------------------------------------*/
15451 wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams,
15452 pEventData->pEventData,
15453 sizeof(halTsmStatsRspMsg.tsmStatsRspParams));
15454
15455 wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly;
15456 wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist,
15457 halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist,
15458 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/
15459 sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0]));
15460 wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly;
15461 wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss;
15462 wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount;
15463 wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount;
15464 wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly;
15465 wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(
15466 halTsmStatsRspMsg.tsmStatsRspParams.status);
15467
15468 /*Notify UMAC*/
15469 wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData);
15470
15471 return WDI_STATUS_SUCCESS;
15472}/*WDI_ProcessTsmStatsRsp*/
15473
15474#endif
15475
15476
15477
15478/**
15479 @brief Process Flush AC Rsp function (called when a response
15480 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015481
15482 @param pWDICtx: pointer to the WLAN DAL context
15483 pEventData: pointer to the event information structure
15484
Jeff Johnson295189b2012-06-20 16:38:30 -070015485 @see
15486 @return Result of the function call
15487*/
15488WDI_Status
15489WDI_ProcessFlushAcRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015490(
Jeff Johnson295189b2012-06-20 16:38:30 -070015491 WDI_ControlBlockType* pWDICtx,
15492 WDI_EventInfoType* pEventData
15493)
15494{
15495 WDI_Status wdiStatus;
15496 eHalStatus halStatus;
15497 WDI_FlushAcRspCb wdiFlushAcRspCb;
15498 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15499
15500 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015501 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015502 -------------------------------------------------------------------------*/
15503 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15504 ( NULL == pEventData->pEventData))
15505 {
15506 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15507 "%s: Invalid parameters", __FUNCTION__);
15508 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015509 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015510 }
15511
15512 wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB;
15513
15514 /*-------------------------------------------------------------------------
15515 Extract response and send it to UMAC
15516 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015517 wpalMemoryCopy( &halStatus,
15518 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015519 sizeof(halStatus));
15520
Jeff Johnsone7245742012-09-05 17:12:55 -070015521 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015522
15523 /*Notify UMAC*/
15524 wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15525
Jeff Johnsone7245742012-09-05 17:12:55 -070015526 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015527}/*WDI_ProcessFlushAcRsp*/
15528
15529/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015530 @brief Process BT AMP event Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015531 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015532
15533 @param pWDICtx: pointer to the WLAN DAL context
15534 pEventData: pointer to the event information structure
15535
Jeff Johnson295189b2012-06-20 16:38:30 -070015536 @see
15537 @return Result of the function call
15538*/
15539WDI_Status
15540WDI_ProcessBtAmpEventRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015541(
Jeff Johnson295189b2012-06-20 16:38:30 -070015542 WDI_ControlBlockType* pWDICtx,
15543 WDI_EventInfoType* pEventData
15544)
15545{
15546 WDI_Status wdiStatus;
15547 eHalStatus halStatus;
15548 WDI_BtAmpEventRspCb wdiBtAmpEventRspCb;
15549 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15550
15551 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015552 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015553 -------------------------------------------------------------------------*/
15554 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15555 ( NULL == pEventData->pEventData))
15556 {
15557 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15558 "%s: Invalid parameters", __FUNCTION__);
15559 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015560 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015561 }
15562
15563 wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB;
15564
15565 /*-------------------------------------------------------------------------
15566 Extract response and send it to UMAC
15567 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015568 wpalMemoryCopy( &halStatus,
15569 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015570 sizeof(halStatus));
15571
Jeff Johnsone7245742012-09-05 17:12:55 -070015572 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070015573
15574 /*Notify UMAC*/
15575 wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData);
15576
Jeff Johnsone7245742012-09-05 17:12:55 -070015577 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015578}/*WDI_ProcessBtAmpEventRsp*/
15579
15580
15581/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015582 @brief Process ADD STA SELF Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070015583 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015584
15585 @param pWDICtx: pointer to the WLAN DAL context
15586 pEventData: pointer to the event information structure
15587
Jeff Johnson295189b2012-06-20 16:38:30 -070015588 @see
15589 @return Result of the function call
15590*/
15591WDI_Status
15592WDI_ProcessAddSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015593(
Jeff Johnson295189b2012-06-20 16:38:30 -070015594 WDI_ControlBlockType* pWDICtx,
15595 WDI_EventInfoType* pEventData
15596)
15597{
15598 WDI_AddSTASelfRspParamsType wdiAddSTASelfParams;
15599 WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb;
15600 tAddStaSelfRspMsg halAddStaSelfRsp;
15601 WDI_AddStaParams wdiAddSTAParam = {0};
15602 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15603
15604 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015605 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015606 -------------------------------------------------------------------------*/
15607 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15608 ( NULL == pEventData->pEventData))
15609 {
15610 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15611 "%s: Invalid parameters", __FUNCTION__);
15612 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015613 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015614 }
15615
Jeff Johnsone7245742012-09-05 17:12:55 -070015616 wdiAddSTASelfReqParamsRspCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070015617 (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB;
15618
15619 /*-------------------------------------------------------------------------
15620 Extract response and send it to UMAC
15621 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015622 wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams,
15623 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015624 sizeof(halAddStaSelfRsp.addStaSelfRspParams));
15625
15626
Jeff Johnsone7245742012-09-05 17:12:55 -070015627 wdiAddSTASelfParams.wdiStatus =
15628 WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015629
Jeff Johnsone7245742012-09-05 17:12:55 -070015630 wdiAddSTASelfParams.ucSTASelfIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015631 halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015632 wdiAddSTASelfParams.dpuIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070015633 halAddStaSelfRsp.addStaSelfRspParams.dpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015634 wdiAddSTASelfParams.dpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015635 halAddStaSelfRsp.addStaSelfRspParams.dpuSignature;
15636
15637 wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta,
15638 pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr,
15639 WDI_MAC_ADDR_LEN);
15640
15641
15642#ifdef HAL_SELF_STA_PER_BSS
15643
15644 /* At this point add the self-STA */
15645
15646 /*! TO DO: wdiAddSTAParam.ucWmmEnabled */
15647 /*! TO DO: wdiAddSTAParam.ucHTCapable */
15648 /*! TO DO: wdiAddSTAParam.ucRmfEnabled */
15649
15650 //all DPU indices are the same for self STA
15651
15652 /*DPU Information*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015653 wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015654 wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature;
15655 wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature;
15656 wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature;
15657 wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx;
15658 wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx;
15659
15660 wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta,
15661 WDI_MAC_ADDR_LEN);
15662
15663 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */
15664 wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx;
15665
Jeff Johnsone7245742012-09-05 17:12:55 -070015666 if(halAddStaSelfRsp.addStaSelfRspParams.status
Jeff Johnson295189b2012-06-20 16:38:30 -070015667 != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO)
15668 {
15669 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
15670 }
15671#endif
15672
15673 /*Notify UMAC*/
15674 wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData);
15675
Jeff Johnsone7245742012-09-05 17:12:55 -070015676 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015677}/*WDI_ProcessAddSTASelfRsp*/
15678
15679
15680
15681/**
Jeff Johnsone7245742012-09-05 17:12:55 -070015682 @brief WDI_ProcessDelSTASelfRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070015683 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015684
15685 @param pWDICtx: pointer to the WLAN DAL context
15686 pEventData: pointer to the event information structure
15687
Jeff Johnson295189b2012-06-20 16:38:30 -070015688 @see
15689 @return Result of the function call
15690*/
15691WDI_Status
15692WDI_ProcessDelSTASelfRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015693(
Jeff Johnson295189b2012-06-20 16:38:30 -070015694 WDI_ControlBlockType* pWDICtx,
15695 WDI_EventInfoType* pEventData
15696)
15697{
15698 WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams;
15699 WDI_DelSTASelfRspCb wdiDelStaSelfRspCb;
15700 tDelStaSelfRspParams delStaSelfRspParams;
15701 wpt_uint8 ucStaIdx;
15702
15703 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15704
15705 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015706 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015707 -------------------------------------------------------------------------*/
15708 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15709 ( NULL == pEventData->pEventData))
15710 {
15711 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15712 "%s: Invalid parameters", __FUNCTION__);
15713 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015714 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015715 }
15716
15717 wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB;
15718
15719 /*-------------------------------------------------------------------------
15720 Extract response and send it to UMAC
15721 -------------------------------------------------------------------------*/
15722
Jeff Johnsone7245742012-09-05 17:12:55 -070015723 wpalMemoryCopy( &delStaSelfRspParams,
Jeff Johnson295189b2012-06-20 16:38:30 -070015724 (wpt_uint8*)pEventData->pEventData,
15725 sizeof(tDelStaSelfRspParams));
15726
Jeff Johnsone7245742012-09-05 17:12:55 -070015727 wdiDelStaSelfRspParams.wdiStatus =
15728 WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015729
Jeff Johnsone7245742012-09-05 17:12:55 -070015730 /* delStaSelfRspParams.status is not
Jeff Johnson295189b2012-06-20 16:38:30 -070015731 eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/
15732 if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status )
15733 {
15734 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070015735 wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx,
Jeff Johnson295189b2012-06-20 16:38:30 -070015736 delStaSelfRspParams.selfMacAddr,
15737 &ucStaIdx);
15738 if(WDI_STATUS_E_FAILURE == wdiStatus)
15739 {
15740 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15741 "%s: Unable to extract the STA Idx ", __FUNCTION__);
15742 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015743 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015744 }
15745 WDI_STATableDelSta(pWDICtx, ucStaIdx);
15746 }
15747
15748 /*Notify UMAC*/
15749 wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData);
15750
15751 return WDI_STATUS_SUCCESS;
15752}
15753
Jeff Johnsone7245742012-09-05 17:12:55 -070015754#ifdef FEATURE_OEM_DATA_SUPPORT
15755/**
15756 @brief Start Oem Data Rsp function (called when a
15757 response is being received over the bus from HAL)
Jeff Johnson295189b2012-06-20 16:38:30 -070015758
Jeff Johnsone7245742012-09-05 17:12:55 -070015759 @param pWDICtx: pointer to the WLAN DAL context
15760 pEventData: pointer to the event information structure
15761
15762 @see
15763 @return Result of the function call
15764*/
15765#define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName)
15766
15767WDI_Status
15768WDI_ProcessStartOemDataRsp
15769(
15770 WDI_ControlBlockType* pWDICtx,
15771 WDI_EventInfoType* pEventData
15772)
15773{
15774 WDI_oemDataRspCb wdiOemDataRspCb;
15775 WDI_oemDataRspParamsType* wdiOemDataRspParams;
15776 tStartOemDataRspParams* halStartOemDataRspParams;
15777
15778 /*-------------------------------------------------------------------------
15779 Sanity check
15780 -------------------------------------------------------------------------*/
15781 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15782 ( NULL == pEventData->pEventData))
15783 {
15784 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15785 "%s: Invalid parameters", __FUNCTION__);
15786 WDI_ASSERT(0);
15787 return WDI_STATUS_E_FAILURE;
15788 }
15789
15790 wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB;
15791
15792 /*-------------------------------------------------------------------------
15793 Extract response and send it to UMAC
15794 -------------------------------------------------------------------------*/
15795 halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData;
15796
15797
15798 //It is the responsibility of the application code to check for failure
15799 //conditions!
15800
15801 //Allocate memory for WDI OEM DATA RSP structure
15802 wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ;
15803
15804 if(NULL == wdiOemDataRspParams)
15805 {
15806 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15807 "Failed to allocate memory in OEM DATA Response %x %x %x ",
15808 pWDICtx, pEventData, pEventData->pEventData);
15809 WDI_ASSERT(0);
15810 return WDI_STATUS_E_FAILURE;
15811 }
15812
15813 /* Populate WDI structure members */
15814 wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE);
15815
15816 /*Notify UMAC*/
15817 wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData);
15818
15819 //Free memory allocated for WDI OEM_DATA MEAS RSP structure
15820 wpalMemoryFree(wdiOemDataRspParams);
15821
15822 return WDI_STATUS_SUCCESS;
15823}/*WDI_PrcoessStartOemDataRsp*/
15824#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070015825
15826/*===========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070015827 Miscellaneous Control Response Processing API
Jeff Johnson295189b2012-06-20 16:38:30 -070015828===========================================================================*/
15829
15830/**
15831 @brief Process Channel Switch Rsp function (called when a response
15832 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015833
15834 @param pWDICtx: pointer to the WLAN DAL context
15835 pEventData: pointer to the event information structure
15836
Jeff Johnson295189b2012-06-20 16:38:30 -070015837 @see
15838 @return Result of the function call
15839*/
15840WDI_Status
15841WDI_ProcessChannelSwitchRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015842(
Jeff Johnson295189b2012-06-20 16:38:30 -070015843 WDI_ControlBlockType* pWDICtx,
15844 WDI_EventInfoType* pEventData
15845)
15846{
15847 WDI_SwitchCHRspParamsType wdiSwitchChRsp;
15848 WDI_SwitchChRspCb wdiChSwitchRspCb;
15849 tSwitchChannelRspParams halSwitchChannelRsp;
15850 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15851
15852 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015853 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015854 -------------------------------------------------------------------------*/
15855 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15856 ( NULL == pEventData->pEventData))
15857 {
15858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15859 "%s: Invalid parameters", __FUNCTION__);
15860 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015861 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015862 }
15863
15864 wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB;
15865
15866 /*-------------------------------------------------------------------------
15867 Extract response and send it to UMAC
15868 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015869 wpalMemoryCopy( &halSwitchChannelRsp,
Jeff Johnson295189b2012-06-20 16:38:30 -070015870 (wpt_uint8*)pEventData->pEventData,
15871 sizeof(halSwitchChannelRsp));
15872
Jeff Johnsone7245742012-09-05 17:12:55 -070015873 wdiSwitchChRsp.wdiStatus =
15874 WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015875 wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber;
15876
15877#ifdef WLAN_FEATURE_VOWIFI
Jeff Johnsone7245742012-09-05 17:12:55 -070015878 wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower;
Jeff Johnson295189b2012-06-20 16:38:30 -070015879#endif
15880
15881 /*Notify UMAC*/
15882 wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData);
15883
Jeff Johnsone7245742012-09-05 17:12:55 -070015884 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070015885}/*WDI_ProcessChannelSwitchRsp*/
15886
15887
15888/**
15889 @brief Process Config STA Rsp function (called when a response
15890 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070015891
15892 @param pWDICtx: pointer to the WLAN DAL context
15893 pEventData: pointer to the event information structure
15894
Jeff Johnson295189b2012-06-20 16:38:30 -070015895 @see
15896 @return Result of the function call
15897*/
15898WDI_Status
15899WDI_ProcessConfigStaRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070015900(
Jeff Johnson295189b2012-06-20 16:38:30 -070015901 WDI_ControlBlockType* pWDICtx,
15902 WDI_EventInfoType* pEventData
15903)
15904{
15905 WDI_ConfigSTARspParamsType wdiCfgSTAParams;
15906 WDI_ConfigSTARspCb wdiConfigSTARspCb;
15907 WDI_AddStaParams wdiAddSTAParam;
15908
15909 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070015910 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070015911
Jeff Johnsone7245742012-09-05 17:12:55 -070015912 tConfigStaRspMsg halConfigStaRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070015913 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
15914
15915 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070015916 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070015917 -------------------------------------------------------------------------*/
15918 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
15919 ( NULL == pEventData->pEventData))
15920 {
15921 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
15922 "%s: Invalid parameters", __FUNCTION__);
15923 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015924 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070015925 }
15926
15927 wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB;
15928
15929 /*-------------------------------------------------------------------------
15930 Extract response and send it to UMAC
15931 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015932 wpalMemoryCopy( &halConfigStaRsp.configStaRspParams,
15933 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070015934 sizeof(halConfigStaRsp.configStaRspParams));
15935
15936
15937 wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
15938 wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx;
15939 wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15940 wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig;
15941 wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig;
15942
15943 /* MAC Address of STA - take from cache as it does not come back in the
15944 response*/
15945 wpalMemoryCopy( wdiCfgSTAParams.macSTA,
Jeff Johnsone7245742012-09-05 17:12:55 -070015946 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015947 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015948
15949 wdiCfgSTAParams.wdiStatus =
15950 WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070015951
15952 wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
15953 wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex;
15954 wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
15955
15956 if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus )
15957 {
15958 if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
15959 {
15960 /* ADD STA to table */
Jeff Johnsone7245742012-09-05 17:12:55 -070015961 wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070015962 wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig;
15963 wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070015964
Jeff Johnson295189b2012-06-20 16:38:30 -070015965 /*This info can be retrieved from the cached initial request*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015966 wdiAddSTAParam.ucWmmEnabled =
Jeff Johnson295189b2012-06-20 16:38:30 -070015967 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -070015968 wdiAddSTAParam.ucHTCapable =
15969 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable;
15970 wdiAddSTAParam.ucStaType =
15971 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType;
15972
Jeff Johnson295189b2012-06-20 16:38:30 -070015973 /* MAC Address of STA */
Jeff Johnsone7245742012-09-05 17:12:55 -070015974 wpalMemoryCopy(wdiAddSTAParam.staMacAddr,
15975 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070015976 WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070015977
15978 wpalMemoryCopy(wdiAddSTAParam.macBSSID,
15979 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID ,
15980 WDI_MAC_ADDR_LEN);
15981
15982 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
15983 pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID,
15984 &pBSSSes);
Jeff Johnson295189b2012-06-20 16:38:30 -070015985
15986 if ( NULL == pBSSSes )
15987 {
15988 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
15989 "Association for this BSSID is not in place");
Jeff Johnsone7245742012-09-05 17:12:55 -070015990
Jeff Johnson295189b2012-06-20 16:38:30 -070015991 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070015992 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070015993 }
15994
15995 /*Add BSS specific parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070015996 wdiAddSTAParam.bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070015997 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070015998 wdiAddSTAParam.bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070015999 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070016000 wdiAddSTAParam.bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016001 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016002 wdiAddSTAParam.bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070016003 halConfigStaRsp.configStaRspParams.ucBcastSig;
16004 wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled;
16005 wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070016006
Jeff Johnson295189b2012-06-20 16:38:30 -070016007 WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
16008 }
16009 if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction )
16010 {
16011 WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable;
16012
Jeff Johnsone7245742012-09-05 17:12:55 -070016013 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016014 halConfigStaRsp.configStaRspParams.bcastDpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016015 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070016016 halConfigStaRsp.configStaRspParams.ucBcastSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070016017 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016018 halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070016019 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature =
Jeff Johnson295189b2012-06-20 16:38:30 -070016020 halConfigStaRsp.configStaRspParams.ucMgmtSig;
Jeff Johnsone7245742012-09-05 17:12:55 -070016021 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070016022 halConfigStaRsp.configStaRspParams.bssIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070016023 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex =
Jeff Johnson295189b2012-06-20 16:38:30 -070016024 halConfigStaRsp.configStaRspParams.dpuIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016025 pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig =
Jeff Johnson295189b2012-06-20 16:38:30 -070016026 halConfigStaRsp.configStaRspParams.ucUcastSig;
16027 }
16028 }
16029
16030 /*Notify UMAC*/
16031 wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData);
16032
Jeff Johnsone7245742012-09-05 17:12:55 -070016033 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016034}/*WDI_ProcessConfigStaRsp*/
16035
16036
16037/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016038 @brief Process Set Link State Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070016039 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016040
16041 @param pWDICtx: pointer to the WLAN DAL context
16042 pEventData: pointer to the event information structure
16043
Jeff Johnson295189b2012-06-20 16:38:30 -070016044 @see
16045 @return Result of the function call
16046*/
16047WDI_Status
16048WDI_ProcessSetLinkStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016049(
Jeff Johnson295189b2012-06-20 16:38:30 -070016050 WDI_ControlBlockType* pWDICtx,
16051 WDI_EventInfoType* pEventData
16052)
16053{
16054 WDI_Status wdiStatus;
16055 eHalStatus halStatus;
16056 WDI_SetLinkStateRspCb wdiSetLinkStateRspCb;
16057
16058 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070016059 wpt_uint8 ucCurrentBSSSesIdx = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070016060 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16061
16062 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016063 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016064 -------------------------------------------------------------------------*/
16065 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16066 ( NULL == pEventData->pEventData))
16067 {
16068 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16069 "%s: Invalid parameters", __FUNCTION__);
16070 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016071 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016072 }
16073
16074 wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB;
16075
16076 wpalMutexAcquire(&pWDICtx->wptMutex);
16077
16078 /*If the link is being transitioned to idle - the BSS is to be deleted
16079 - this type of ending a session is possible when UMAC has failed an
16080 - association session during Join*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016081 if ( WDI_LINK_IDLE_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016082 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16083 {
16084 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016085 Find the BSS for which the request is made
Jeff Johnson295189b2012-06-20 16:38:30 -070016086 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016087 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
16088 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID,
16089 &pBSSSes);
16090
Jeff Johnson295189b2012-06-20 16:38:30 -070016091 /*-----------------------------------------------------------------------
16092 Del BSS response can only be received for an existing assoc that
Jeff Johnsone7245742012-09-05 17:12:55 -070016093 is current and in progress
Jeff Johnson295189b2012-06-20 16:38:30 -070016094 -----------------------------------------------------------------------*/
16095 if ( NULL == pBSSSes )
16096 {
16097 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
16098 "Set link response received outside association session");
16099 }
16100 else
16101 {
16102 /* For BT AMP roles no need to delete the sessions if assoc fails. There
16103 will be del BSS coming after this to stop the beaconing & cleaning up the
16104 sessions*/
16105 if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&&
16106 ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType ))
16107 {
16108 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016109 The current session will be deleted
Jeff Johnson295189b2012-06-20 16:38:30 -070016110 -----------------------------------------------------------------------*/
16111 WDI_DeleteSession(pWDICtx, pBSSSes);
16112
16113 /*-----------------------------------------------------------------------
16114 Check to see if this association is in progress - if so disable the
16115 flag as this has ended
16116 -----------------------------------------------------------------------*/
16117 if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx )
Jeff Johnsone7245742012-09-05 17:12:55 -070016118 {
Jeff Johnson295189b2012-06-20 16:38:30 -070016119 /*Association no longer in progress */
16120 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16121 /*Association no longer in progress - prepare pending assoc for processing*/
16122 WDI_DequeueAssocRequest(pWDICtx);
16123 }
16124 }
16125 }
16126 }
16127 /* If the link state has been set to POST ASSOC, reset the "association in
16128 progress" flag */
Jeff Johnsone7245742012-09-05 17:12:55 -070016129 if ( WDI_LINK_POSTASSOC_STATE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070016130 pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState )
16131 {
16132 pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE;
16133 WDI_DequeueAssocRequest(pWDICtx);
16134 }
16135
16136 wpalMutexRelease(&pWDICtx->wptMutex);
16137
16138 /*-------------------------------------------------------------------------
16139 Extract response and send it to UMAC
16140 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016141 wpalMemoryCopy( &halStatus,
16142 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016143 sizeof(halStatus));
16144
Jeff Johnsone7245742012-09-05 17:12:55 -070016145 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016146
16147 /*Notify UMAC*/
16148 wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16149
Jeff Johnsone7245742012-09-05 17:12:55 -070016150 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016151}/*WDI_ProcessSetLinkStateRsp*/
16152
16153/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016154 @brief Process Get Stats Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016155 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016156
16157 @param pWDICtx: pointer to the WLAN DAL context
16158 pEventData: pointer to the event information structure
16159
Jeff Johnson295189b2012-06-20 16:38:30 -070016160 @see
16161 @return Result of the function call
16162*/
16163WDI_Status
16164WDI_ProcessGetStatsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016165(
Jeff Johnson295189b2012-06-20 16:38:30 -070016166 WDI_ControlBlockType* pWDICtx,
16167 WDI_EventInfoType* pEventData
16168)
16169{
16170 WDI_GetStatsRspParamsType *wdiGetStatsRsp;
16171 WDI_GetStatsRspCb wdiGetStatsRspCb;
16172 tHalStatsRspParams* pHalStatsRspParams;
Jeff Johnsone7245742012-09-05 17:12:55 -070016173
Jeff Johnson295189b2012-06-20 16:38:30 -070016174 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16175
16176 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016177 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016178 -------------------------------------------------------------------------*/
16179 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16180 ( NULL == pEventData->pEventData))
16181 {
16182 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16183 "%s: Invalid parameters", __FUNCTION__);
16184 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016185 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016186 }
16187
16188 /*-------------------------------------------------------------------------
16189 Extract response and send it to UMAC
16190 -------------------------------------------------------------------------*/
16191 pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData;
16192
16193 /*allocate the stats response buffer */
16194 wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate(
16195 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)
16196 + sizeof(WDI_GetStatsRspParamsType));
16197
16198 if(NULL == wdiGetStatsRsp)
16199 {
16200 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16201 "Failed to allocate memory in Get Stats Response %x %x %x ",
16202 pWDICtx, pEventData, pEventData->pEventData);
16203 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016204 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016205 }
16206
16207 wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB;
16208
16209 wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen);
16210 wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType;
16211 wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen;
16212 wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status);
16213 wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId;
16214 wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask;
16215
16216 /* copy the stats from buffer at the end of the tHalStatsRspParams message */
16217 wpalMemoryCopy(wdiGetStatsRsp + 1,
16218 (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams),
16219 pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams));
16220
16221 /*Notify UMAC*/
16222 wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData);
16223
16224 wpalMemoryFree(wdiGetStatsRsp);
16225
Jeff Johnsone7245742012-09-05 17:12:55 -070016226 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016227}/*WDI_ProcessGetStatsRsp*/
16228
16229
16230/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016231 @brief Process Update Cfg Rsp function (called when a response is
Jeff Johnson295189b2012-06-20 16:38:30 -070016232 being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016233
16234 @param pWDICtx: pointer to the WLAN DAL context
16235 pEventData: pointer to the event information structure
16236
Jeff Johnson295189b2012-06-20 16:38:30 -070016237 @see
16238 @return Result of the function call
16239*/
16240WDI_Status
16241WDI_ProcessUpdateCfgRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016242(
Jeff Johnson295189b2012-06-20 16:38:30 -070016243 WDI_ControlBlockType* pWDICtx,
16244 WDI_EventInfoType* pEventData
16245)
16246{
16247 WDI_Status wdiStatus;
16248 eHalStatus halStatus;
16249 WDI_UpdateCfgRspCb wdiUpdateCfgRspCb;
16250 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16251
16252 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016253 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016254 -------------------------------------------------------------------------*/
16255 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16256 ( NULL == pEventData->pEventData))
16257 {
16258 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16259 "%s: Invalid parameters", __FUNCTION__);
16260 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016261 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016262 }
16263
16264 wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB;
16265
16266 /*-------------------------------------------------------------------------
16267 Extract response and send it to UMAC
16268 -------------------------------------------------------------------------*/
16269 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016270 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016271
16272 /*Notify UMAC*/
16273 wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16274
Jeff Johnsone7245742012-09-05 17:12:55 -070016275 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016276}/*WDI_ProcessUpdateCfgRsp*/
16277
16278
16279
16280/**
16281 @brief Process Add BA Rsp function (called when a response
16282 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016283
16284 @param pWDICtx: pointer to the WLAN DAL context
16285 pEventData: pointer to the event information structure
16286
Jeff Johnson295189b2012-06-20 16:38:30 -070016287 @see
16288 @return Result of the function call
16289*/
16290WDI_Status
16291WDI_ProcessAddBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016292(
Jeff Johnson295189b2012-06-20 16:38:30 -070016293 WDI_ControlBlockType* pWDICtx,
16294 WDI_EventInfoType* pEventData
16295)
16296{
16297 WDI_AddBARspCb wdiAddBARspCb;
16298
16299 tAddBARspParams halAddBARsp;
16300 WDI_AddBARspinfoType wdiAddBARsp;
16301
16302 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16303
16304 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016305 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016306 -------------------------------------------------------------------------*/
16307 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16308 ( NULL == pEventData->pEventData))
16309 {
16310 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16311 "%s: Invalid parameters", __FUNCTION__);
16312 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016313 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016314 }
16315
16316 wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB;
16317
16318 /*-------------------------------------------------------------------------
16319 Extract response and send it to UMAC
16320 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016321 wpalMemoryCopy( &halAddBARsp,
16322 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016323 sizeof(halAddBARsp));
16324
16325 wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
16326
Jeff Johnson43971f52012-07-17 12:26:56 -070016327 if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
Jeff Johnson295189b2012-06-20 16:38:30 -070016328 {
16329 wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
16330 }
16331
16332 /*Notify UMAC*/
16333 wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData);
16334
Jeff Johnsone7245742012-09-05 17:12:55 -070016335 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016336}/*WDI_ProcessAddSessionBARsp*/
16337
16338/**
16339 @brief Process Add BA Rsp function (called when a response
16340 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016341
16342 @param pWDICtx: pointer to the WLAN DAL context
16343 pEventData: pointer to the event information structure
16344
Jeff Johnson295189b2012-06-20 16:38:30 -070016345 @see
16346 @return Result of the function call
16347*/
16348WDI_Status
16349WDI_ProcessTriggerBARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016350(
Jeff Johnson295189b2012-06-20 16:38:30 -070016351 WDI_ControlBlockType* pWDICtx,
16352 WDI_EventInfoType* pEventData
16353)
16354{
16355 WDI_TriggerBARspCb wdiTriggerBARspCb;
16356
16357 tTriggerBARspParams* halTriggerBARsp;
16358 tTriggerBaRspCandidate* halBaCandidate;
16359 WDI_TriggerBARspParamsType* wdiTriggerBARsp;
16360 WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate;
16361 wpt_uint16 index;
16362 wpt_uint16 TidIndex;
Jeff Johnsone7245742012-09-05 17:12:55 -070016363
Jeff Johnson295189b2012-06-20 16:38:30 -070016364 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16365
16366 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016367 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016368 -------------------------------------------------------------------------*/
16369 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16370 ( NULL == pEventData->pEventData))
16371 {
16372 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16373 "%s: Invalid parameters", __FUNCTION__);
16374 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016375 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016376 }
16377
16378 wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB;
16379
16380 /*-------------------------------------------------------------------------
16381 Extract response and send it to UMAC
16382 -------------------------------------------------------------------------*/
16383 halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData;
16384
Jeff Johnsone7245742012-09-05 17:12:55 -070016385 wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) +
16386 halTriggerBARsp->baCandidateCnt *
Jeff Johnson295189b2012-06-20 16:38:30 -070016387 sizeof(WDI_TriggerBARspCandidateType));
16388 if(NULL == wdiTriggerBARsp)
16389 {
16390 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16391 "Failed to allocate memory in Trigger BA Response %x %x %x ",
16392 pWDICtx, pEventData, pEventData->pEventData);
16393 wpalMemoryFree(halTriggerBARsp);
16394 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016395 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016396 }
16397
16398 wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status);
16399
16400 if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus)
16401 {
16402 wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt;
Jeff Johnsone7245742012-09-05 17:12:55 -070016403 wpalMemoryCopy(wdiTriggerBARsp->macBSSID,
Jeff Johnson295189b2012-06-20 16:38:30 -070016404 halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN);
16405
16406 wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1);
16407 halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1);
16408
16409 for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++)
16410 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016411 wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA,
Jeff Johnson295189b2012-06-20 16:38:30 -070016412 halBaCandidate->staAddr, WDI_MAC_ADDR_LEN);
16413 for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++)
16414 {
Jeff Johnsone7245742012-09-05 17:12:55 -070016415 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable =
Jeff Johnson295189b2012-06-20 16:38:30 -070016416 halBaCandidate->baInfo[TidIndex].fBaEnable;
Jeff Johnsone7245742012-09-05 17:12:55 -070016417 wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum =
Jeff Johnson295189b2012-06-20 16:38:30 -070016418 halBaCandidate->baInfo[TidIndex].startingSeqNum;
16419 }
16420 wdiTriggerBARspCandidate++;
16421 halBaCandidate++;
16422 }
16423 }
16424
16425 /*Notify UMAC*/
16426 wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData);
16427
16428 wpalMemoryFree(wdiTriggerBARsp);
Jeff Johnsone7245742012-09-05 17:12:55 -070016429 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016430}/*WDI_ProcessAddSessionBARsp*/
16431
16432/**
16433 @brief Process Update Beacon Params Rsp function (called when a response
16434 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016435
16436 @param pWDICtx: pointer to the WLAN DAL context
16437 pEventData: pointer to the event information structure
16438
Jeff Johnson295189b2012-06-20 16:38:30 -070016439 @see
16440 @return Result of the function call
16441*/
16442WDI_Status
16443WDI_ProcessUpdateBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016444(
Jeff Johnson295189b2012-06-20 16:38:30 -070016445 WDI_ControlBlockType* pWDICtx,
16446 WDI_EventInfoType* pEventData
16447)
16448{
16449 WDI_Status wdiStatus;
16450 eHalStatus halStatus;
16451 WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb;
16452 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16453
16454 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016455 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016456 -------------------------------------------------------------------------*/
16457 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16458 ( NULL == pEventData->pEventData))
16459 {
16460 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16461 "%s: Invalid parameters", __FUNCTION__);
16462 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016463 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016464 }
16465
16466 wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB;
16467
16468 /*-------------------------------------------------------------------------
16469 Extract response and send it to UMAC
16470 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016471 wpalMemoryCopy( &halStatus,
16472 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016473 sizeof(halStatus));
16474
Jeff Johnsone7245742012-09-05 17:12:55 -070016475 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016476
16477 /*Notify UMAC*/
16478 wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16479
Jeff Johnsone7245742012-09-05 17:12:55 -070016480 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016481}/*WDI_ProcessUpdateBeaconParamsRsp*/
16482
16483/**
16484 @brief Process Send Beacon template Rsp function (called when a response
16485 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016486
16487 @param pWDICtx: pointer to the WLAN DAL context
16488 pEventData: pointer to the event information structure
16489
Jeff Johnson295189b2012-06-20 16:38:30 -070016490 @see
16491 @return Result of the function call
16492*/
16493WDI_Status
16494WDI_ProcessSendBeaconParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016495(
Jeff Johnson295189b2012-06-20 16:38:30 -070016496 WDI_ControlBlockType* pWDICtx,
16497 WDI_EventInfoType* pEventData
16498)
16499{
16500 WDI_Status wdiStatus;
16501 eHalStatus halStatus;
16502 WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb;
16503 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16504
16505 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016506 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016507 -------------------------------------------------------------------------*/
16508 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16509 ( NULL == pEventData->pEventData))
16510 {
16511 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16512 "%s: Invalid parameters", __FUNCTION__);
16513 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016514 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016515 }
16516
16517 wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB;
16518
16519 /*-------------------------------------------------------------------------
16520 Extract response and send it to UMAC
16521 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016522 wpalMemoryCopy( &halStatus,
16523 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016524 sizeof(halStatus));
16525
Jeff Johnsone7245742012-09-05 17:12:55 -070016526 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016527
16528 /*Notify UMAC*/
16529 wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16530
Jeff Johnsone7245742012-09-05 17:12:55 -070016531 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016532}/*WDI_ProcessSendBeaconParamsRsp*/
16533
Jeff Johnsone7245742012-09-05 17:12:55 -070016534
Jeff Johnson295189b2012-06-20 16:38:30 -070016535/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016536 @brief Process Update Probe Resp Template Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016537 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016538
16539 @param pWDICtx: pointer to the WLAN DAL context
16540 pEventData: pointer to the event information structure
16541
Jeff Johnson295189b2012-06-20 16:38:30 -070016542 @see
16543 @return Result of the function call
16544*/
16545WDI_Status
16546WDI_ProcessUpdateProbeRspTemplateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016547(
Jeff Johnson295189b2012-06-20 16:38:30 -070016548 WDI_ControlBlockType* pWDICtx,
16549 WDI_EventInfoType* pEventData
16550)
16551{
16552 WDI_Status wdiStatus;
16553 eHalStatus halStatus;
16554 WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb;
16555 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16556
16557 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016558 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016559 -------------------------------------------------------------------------*/
16560 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16561 ( NULL == pEventData->pEventData))
16562 {
16563 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16564 "%s: Invalid parameters", __FUNCTION__);
16565 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016566 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016567 }
16568
16569 wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB;
16570
16571 /*-------------------------------------------------------------------------
16572 Extract response and send it to UMAC
16573 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016574 wpalMemoryCopy( &halStatus,
16575 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016576 sizeof(halStatus));
16577
Jeff Johnsone7245742012-09-05 17:12:55 -070016578 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016579
16580 /*Notify UMAC*/
16581 wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16582
Jeff Johnsone7245742012-09-05 17:12:55 -070016583 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016584}/*WDI_ProcessUpdateProbeRspTemplateRsp*/
16585
16586 /**
16587 @brief Process Set Max Tx Power Rsp function (called when a response
16588 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016589
16590 @param pWDICtx: pointer to the WLAN DAL context
16591 pEventData: pointer to the event information structure
16592
Jeff Johnson295189b2012-06-20 16:38:30 -070016593 @see
16594 @return Result of the function call
16595*/
16596WDI_Status
16597WDI_ProcessSetMaxTxPowerRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016598(
Jeff Johnson295189b2012-06-20 16:38:30 -070016599 WDI_ControlBlockType* pWDICtx,
16600 WDI_EventInfoType* pEventData
16601)
16602{
16603 tSetMaxTxPwrRspMsg halTxpowerrsp;
Jeff Johnsone7245742012-09-05 17:12:55 -070016604
Jeff Johnson295189b2012-06-20 16:38:30 -070016605 WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070016606
Jeff Johnson295189b2012-06-20 16:38:30 -070016607 WDA_SetMaxTxPowerRspCb wdiReqStatusCb;
16608 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16609
16610 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016611 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016612 -------------------------------------------------------------------------*/
16613 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16614 ( NULL == pEventData->pEventData))
16615 {
16616 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16617 "%s: Invalid parameters", __FUNCTION__);
16618 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016619 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016620 }
16621
16622 wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB;
16623
16624 /*-------------------------------------------------------------------------
16625 Extract response and send it to UMAC
16626 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016627 wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams,
16628 pEventData->pEventData,
16629 sizeof(halTxpowerrsp.setMaxTxPwrRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070016630
16631 if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status )
16632 {
16633 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
16634 "Error status returned in Set Max Tx Power Response ");
Jeff Johnsone7245742012-09-05 17:12:55 -070016635 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
16636 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016637 }
16638
Jeff Johnsone7245742012-09-05 17:12:55 -070016639 wdiSetMaxTxPowerRspMsg.wdiStatus =
Jeff Johnson295189b2012-06-20 16:38:30 -070016640 WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status);
Jeff Johnsone7245742012-09-05 17:12:55 -070016641 wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power;
Jeff Johnson295189b2012-06-20 16:38:30 -070016642
16643 /*Notify UMAC*/
16644 wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData);
16645
Jeff Johnsone7245742012-09-05 17:12:55 -070016646 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016647}
16648
16649#ifdef WLAN_FEATURE_P2P
16650/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016651 @brief Process P2P Group Owner Notice Of Absense Rsp function (called
Jeff Johnson295189b2012-06-20 16:38:30 -070016652 when a response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016653
16654 @param pWDICtx: pointer to the WLAN DAL context
16655 pEventData: pointer to the event information structure
16656
Jeff Johnson295189b2012-06-20 16:38:30 -070016657 @see
16658 @return Result of the function call
16659*/
16660WDI_Status
16661WDI_ProcessP2PGONOARsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016662(
Jeff Johnson295189b2012-06-20 16:38:30 -070016663 WDI_ControlBlockType* pWDICtx,
16664 WDI_EventInfoType* pEventData
16665)
16666{
16667 WDI_Status wdiStatus;
16668 eHalStatus halStatus;
16669 WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb;
16670 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16671
16672 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016673 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016674 -------------------------------------------------------------------------*/
16675 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16676 ( NULL == pEventData->pEventData))
16677 {
16678 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16679 "%s: Invalid parameters", __FUNCTION__);
16680 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016681 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016682 }
16683
16684 wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB;
16685
16686 /*-------------------------------------------------------------------------
16687 Extract response and send it to UMAC
16688 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070016689 wpalMemoryCopy( &halStatus,
16690 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070016691 sizeof(halStatus));
16692
Jeff Johnsone7245742012-09-05 17:12:55 -070016693 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016694
16695 /*Notify UMAC*/
16696 wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16697
Jeff Johnsone7245742012-09-05 17:12:55 -070016698 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016699}/*WDI_ProcessP2PGONOARsp*/
16700#endif
16701/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016702 @brief Process Enter IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016703 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016704
16705 @param pWDICtx: pointer to the WLAN DAL context
16706 pEventData: pointer to the event information structure
16707
Jeff Johnson295189b2012-06-20 16:38:30 -070016708 @see
16709 @return Result of the function call
16710*/
16711WDI_Status
16712WDI_ProcessEnterImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016713(
Jeff Johnson295189b2012-06-20 16:38:30 -070016714 WDI_ControlBlockType* pWDICtx,
16715 WDI_EventInfoType* pEventData
16716)
16717{
16718 WDI_Status wdiStatus;
16719 eHalStatus halStatus;
16720 WDI_EnterImpsRspCb wdiEnterImpsRspCb;
16721 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16722
16723 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016724 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016725 -------------------------------------------------------------------------*/
16726 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16727 ( NULL == pEventData->pEventData))
16728 {
16729 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16730 "%s: Invalid parameters", __FUNCTION__);
16731 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016732 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016733 }
16734
16735 wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB;
16736
16737 /*-------------------------------------------------------------------------
16738 Extract response and send it to UMAC
16739 -------------------------------------------------------------------------*/
16740 halStatus = *((eHalStatus*)pEventData->pEventData);
16741
Jeff Johnsone7245742012-09-05 17:12:55 -070016742 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016743
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016744 /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state.
16745 * Other module states are taken care by PMC.
16746 * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails??
16747 */
16748 if (wdiStatus != WDI_STATUS_SUCCESS) {
16749
16750 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16751 "WDI PRocess Enter IMPS RSP failed With HAL Status Code: %d",halStatus);
16752 /* Call Back is not required as we are putting the DXE in FULL
16753 * and riva is already in full (IMPS RSP Failed)*/
16754 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16755 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016756 /*Notify UMAC*/
16757 wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16758
Jeff Johnsone7245742012-09-05 17:12:55 -070016759 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016760}/*WDI_ProcessEnterImpsRsp*/
16761
16762/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016763 @brief Process Exit IMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016764 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016765
16766 @param pWDICtx: pointer to the WLAN DAL context
16767 pEventData: pointer to the event information structure
16768
Jeff Johnson295189b2012-06-20 16:38:30 -070016769 @see
16770 @return Result of the function call
16771*/
16772WDI_Status
16773WDI_ProcessExitImpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016774(
Jeff Johnson295189b2012-06-20 16:38:30 -070016775 WDI_ControlBlockType* pWDICtx,
16776 WDI_EventInfoType* pEventData
16777)
16778{
16779 WDI_Status wdiStatus;
16780 eHalStatus halStatus;
16781 WDI_ExitImpsRspCb wdiExitImpsRspCb;
16782 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16783
16784 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016785 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016786 -------------------------------------------------------------------------*/
16787 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16788 ( NULL == pEventData->pEventData))
16789 {
16790 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16791 "%s: Invalid parameters", __FUNCTION__);
16792 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016793 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016794 }
16795
16796 wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB;
16797
16798 /*-------------------------------------------------------------------------
16799 Extract response and send it to UMAC
16800 -------------------------------------------------------------------------*/
16801 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070016802 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070016803
16804 // notify DTS that we are entering Full power
16805 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16806
16807 /*Notify UMAC*/
16808 wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
16809
Jeff Johnsone7245742012-09-05 17:12:55 -070016810 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016811}/*WDI_ProcessExitImpsRsp*/
16812
16813/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016814 @brief Process Enter BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016815 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016816
16817 @param pWDICtx: pointer to the WLAN DAL context
16818 pEventData: pointer to the event information structure
16819
Jeff Johnson295189b2012-06-20 16:38:30 -070016820 @see
16821 @return Result of the function call
16822*/
16823WDI_Status
16824WDI_ProcessEnterBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016825(
Jeff Johnson295189b2012-06-20 16:38:30 -070016826 WDI_ControlBlockType* pWDICtx,
16827 WDI_EventInfoType* pEventData
16828)
16829{
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016830 eHalStatus halStatus = eHAL_STATUS_FAILURE;
16831 tHalEnterBmpsRspParams halEnterBmpsRsp;
16832 WDI_EnterBmpsRspCb wdiEnterBmpsRspCb;
16833 WDI_EnterBmpsRspParamsType wdiEnterBmpsRspparams;
16834
Jeff Johnson295189b2012-06-20 16:38:30 -070016835 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16836
16837 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016838 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016839 -------------------------------------------------------------------------*/
16840 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16841 ( NULL == pEventData->pEventData))
16842 {
16843 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16844 "%s: Invalid parameters", __FUNCTION__);
16845 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016846 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016847 }
16848
Jeff Johnson295189b2012-06-20 16:38:30 -070016849 /*-------------------------------------------------------------------------
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016850 Extract response and send it to UMAC
16851 -------------------------------------------------------------------------*/
16852 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
16853 {
16854 wpalMemoryCopy( &halEnterBmpsRsp,
16855 pEventData->pEventData,
16856 sizeof(halEnterBmpsRsp));
16857
16858 //Used to print debug message
16859 halStatus = halEnterBmpsRsp.status;
16860 wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterBmpsRsp.status);
16861 wdiEnterBmpsRspparams.bssIdx = halEnterBmpsRsp.bssIdx;
16862 }
16863 else
16864 {
16865 halStatus = *((eHalStatus*)pEventData->pEventData);
16866 wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16867 }
16868
16869 wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070016870
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016871 /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state.
16872 * Other module states are taken care by PMC.
16873 * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails??
16874 */
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016875 if (wdiEnterBmpsRspparams.wdiStatus != WDI_STATUS_SUCCESS)
16876 {
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016877
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016878 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
16879 "WDI PRocess Enter BMPS RSP failed With HAL Status Code: %d",halStatus);
16880 /* Call Back is not required as we are putting the DXE in FULL
16881 * and riva is already in FULL (BMPS RSP Failed)*/
16882 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16883 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
Madan Mohan Koyyalamudi48e375a2012-09-24 13:19:17 -070016884 }
16885
Jeff Johnson295189b2012-06-20 16:38:30 -070016886 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016887 wdiEnterBmpsRspCb( &wdiEnterBmpsRspparams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070016888
Jeff Johnsone7245742012-09-05 17:12:55 -070016889 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016890}/*WDI_ProcessEnterBmpsRsp*/
16891
16892/**
Jeff Johnsone7245742012-09-05 17:12:55 -070016893 @brief Process Exit BMPS Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070016894 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016895
16896 @param pWDICtx: pointer to the WLAN DAL context
16897 pEventData: pointer to the event information structure
16898
Jeff Johnson295189b2012-06-20 16:38:30 -070016899 @see
16900 @return Result of the function call
16901*/
16902WDI_Status
16903WDI_ProcessExitBmpsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016904(
Jeff Johnson295189b2012-06-20 16:38:30 -070016905 WDI_ControlBlockType* pWDICtx,
16906 WDI_EventInfoType* pEventData
16907)
16908{
Jeff Johnson295189b2012-06-20 16:38:30 -070016909 eHalStatus halStatus;
16910 WDI_ExitBmpsRspCb wdiExitBmpsRspCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016911 tHalExitBmpsRspParams halExitBmpsRsp;
16912 WDI_ExitBmpsRspParamsType wdiExitBmpsRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070016913 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16914
16915 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016916 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016917 -------------------------------------------------------------------------*/
16918 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16919 ( NULL == pEventData->pEventData))
16920 {
16921 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16922 "%s: Invalid parameters", __FUNCTION__);
16923 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016924 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016925 }
16926
16927 wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB;
16928
16929 /*-------------------------------------------------------------------------
16930 Extract response and send it to UMAC
16931 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016932
16933 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
16934 {
16935 wpalMemoryCopy( &halExitBmpsRsp,
16936 pEventData->pEventData,
16937 sizeof(halExitBmpsRsp));
16938
16939 wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitBmpsRsp.status);
16940 wdiExitBmpsRspParams.bssIdx = halExitBmpsRsp.bssIdx;
16941 }
16942 else
16943 {
16944 halStatus = *((eHalStatus*)pEventData->pEventData);
16945 wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
16946 }
Jeff Johnson295189b2012-06-20 16:38:30 -070016947
16948 // notify DTS that we are entering Full power
16949 WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL);
16950
16951 pWDICtx->bInBmps = eWLAN_PAL_FALSE;
16952
16953 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016954 wdiExitBmpsRspCb( &wdiExitBmpsRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070016955
Jeff Johnsone7245742012-09-05 17:12:55 -070016956 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070016957}/*WDI_ProcessExitBmpsRsp*/
16958
16959/**
16960 @brief Process Enter UAPSD Rsp function (called when a response
16961 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070016962
16963 @param pWDICtx: pointer to the WLAN DAL context
16964 pEventData: pointer to the event information structure
16965
Jeff Johnson295189b2012-06-20 16:38:30 -070016966 @see
16967 @return Result of the function call
16968*/
16969WDI_Status
16970WDI_ProcessEnterUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070016971(
Jeff Johnson295189b2012-06-20 16:38:30 -070016972 WDI_ControlBlockType* pWDICtx,
16973 WDI_EventInfoType* pEventData
16974)
16975{
Jeff Johnson295189b2012-06-20 16:38:30 -070016976 eHalStatus halStatus;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016977 tUapsdRspParams halEnterUapsdRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070016978 WDI_EnterUapsdRspCb wdiEnterUapsdRspCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070016979 WDI_EnterUapsdRspParamsType wdiEnterUapsdRspParams;
16980
Jeff Johnson295189b2012-06-20 16:38:30 -070016981 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
16982
16983 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070016984 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070016985 -------------------------------------------------------------------------*/
16986 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
16987 ( NULL == pEventData->pEventData))
16988 {
16989 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
16990 "%s: Invalid parameters", __FUNCTION__);
16991 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070016992 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070016993 }
16994
16995 wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB;
16996
16997 /*-------------------------------------------------------------------------
16998 Extract response and send it to UMAC
16999 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017000 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17001 {
17002 wpalMemoryCopy( &halEnterUapsdRsp,
17003 pEventData->pEventData,
17004 sizeof(halEnterUapsdRsp));
Jeff Johnson295189b2012-06-20 16:38:30 -070017005
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017006 wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterUapsdRsp.status);
17007 wdiEnterUapsdRspParams.bssIdx = halEnterUapsdRsp.bssIdx;
17008 }
17009 else
17010 {
17011 halStatus = *((eHalStatus*)pEventData->pEventData);
17012 wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17013 }
17014
17015 if(WDI_STATUS_SUCCESS == wdiEnterUapsdRspParams.wdiStatus)
Jeff Johnson295189b2012-06-20 16:38:30 -070017016 {
17017 // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed
17018 // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring
17019 // the traffic to decide when to suspend the trigger frames when there is no traffic
17020 // activity on the trigger enabled ACs
17021 pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX;
17022
17023#ifdef WLAN_PERF
17024 // Increment the BD signature to refresh the fast path BD utilization
17025 pWDICtx->uBdSigSerialNum++;
17026#endif
17027 }
17028
17029 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017030 wdiEnterUapsdRspCb( &wdiEnterUapsdRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017031
Jeff Johnsone7245742012-09-05 17:12:55 -070017032 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017033}/*WDI_ProcessEnterUapsdRsp*/
17034
17035/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017036 @brief Process Exit UAPSD Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017037 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017038
17039 @param pWDICtx: pointer to the WLAN DAL context
17040 pEventData: pointer to the event information structure
17041
Jeff Johnson295189b2012-06-20 16:38:30 -070017042 @see
17043 @return Result of the function call
17044*/
17045WDI_Status
17046WDI_ProcessExitUapsdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017047(
Jeff Johnson295189b2012-06-20 16:38:30 -070017048 WDI_ControlBlockType* pWDICtx,
17049 WDI_EventInfoType* pEventData
17050)
17051{
Jeff Johnson295189b2012-06-20 16:38:30 -070017052 eHalStatus halStatus;
17053 WDI_ExitUapsdRspCb wdiExitUapsdRspCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017054 tHalExitUapsdRspParams halExitUapsdRsp;
17055 WDI_ExitUapsdRspParamsType wdiExitUapsdRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070017056 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17057
17058 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017059 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017060 -------------------------------------------------------------------------*/
17061 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17062 ( NULL == pEventData->pEventData))
17063 {
17064 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17065 "%s: Invalid parameters", __FUNCTION__);
17066 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017067 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017068 }
17069
17070 wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB;
17071
17072 /*-------------------------------------------------------------------------
17073 Extract response and send it to UMAC
17074 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017075 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17076 {
17077 wpalMemoryCopy( &halExitUapsdRsp,
17078 pEventData->pEventData,
17079 sizeof(halExitUapsdRsp));
17080
17081 wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitUapsdRsp.status);
17082 wdiExitUapsdRspParams.bssIdx = halExitUapsdRsp.bssIdx;
17083 }
17084 else
17085 {
17086 halStatus = *((eHalStatus*)pEventData->pEventData);
17087 wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17088 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017089 // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM
17090 // directly instead of the FW WQ.
17091 pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT;
17092
17093#ifdef WLAN_PERF
17094 // Increment the BD signature to refresh the fast path BD utilization
17095 pWDICtx->uBdSigSerialNum++;
17096#endif
17097
17098 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017099 wdiExitUapsdRspCb( &wdiExitUapsdRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017100
Jeff Johnsone7245742012-09-05 17:12:55 -070017101 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017102}/*WDI_ProcessExitUapsdRsp*/
17103
17104/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017105 @brief Process set UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017106 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017107
17108 @param pWDICtx: pointer to the WLAN DAL context
17109 pEventData: pointer to the event information structure
17110
Jeff Johnson295189b2012-06-20 16:38:30 -070017111 @see
17112 @return Result of the function call
17113*/
17114WDI_Status
17115WDI_ProcessSetUapsdAcParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017116(
Jeff Johnson295189b2012-06-20 16:38:30 -070017117 WDI_ControlBlockType* pWDICtx,
17118 WDI_EventInfoType* pEventData
17119)
17120{
17121 WDI_Status wdiStatus;
17122 eHalStatus halStatus;
17123 WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb;
17124 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17125
17126 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017127 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017128 -------------------------------------------------------------------------*/
17129 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17130 ( NULL == pEventData->pEventData))
17131 {
17132 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17133 "%s: Invalid parameters", __FUNCTION__);
17134 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017135 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017136 }
17137
17138 wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB;
17139
17140 /*-------------------------------------------------------------------------
17141 Extract response and send it to UMAC
17142 -------------------------------------------------------------------------*/
17143 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017144 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017145
17146 /*Notify UMAC*/
17147 wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17148
Jeff Johnsone7245742012-09-05 17:12:55 -070017149 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017150}/*WDI_ProcessSetUapsdAcParamsRsp*/
17151
17152/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017153 @brief Process update UAPSD params Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017154 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017155
17156 @param pWDICtx: pointer to the WLAN DAL context
17157 pEventData: pointer to the event information structure
17158
Jeff Johnson295189b2012-06-20 16:38:30 -070017159 @see
17160 @return Result of the function call
17161*/
17162WDI_Status
17163WDI_ProcessUpdateUapsdParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017164(
Jeff Johnson295189b2012-06-20 16:38:30 -070017165 WDI_ControlBlockType* pWDICtx,
17166 WDI_EventInfoType* pEventData
17167)
17168{
17169 WDI_Status wdiStatus;
17170 eHalStatus halStatus;
17171 WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb;
17172 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17173
17174 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017175 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017176 -------------------------------------------------------------------------*/
17177 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17178 ( NULL == pEventData->pEventData))
17179 {
17180 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17181 "%s: Invalid parameters", __FUNCTION__);
17182 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017183 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017184 }
17185
17186 wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB;
17187
17188 /*-------------------------------------------------------------------------
17189 Extract response and send it to UMAC
17190 -------------------------------------------------------------------------*/
17191 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017192 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017193
17194 /*Notify UMAC*/
17195 wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData);
17196
Jeff Johnsone7245742012-09-05 17:12:55 -070017197 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017198}/*WDI_ProcessUpdateUapsdParamsRsp*/
17199
17200/**
17201 @brief Process Configure RXP filter Rsp function (called when a
17202 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017203
17204 @param pWDICtx: pointer to the WLAN DAL context
17205 pEventData: pointer to the event information structure
17206
Jeff Johnson295189b2012-06-20 16:38:30 -070017207 @see
17208 @return Result of the function call
17209*/
17210WDI_Status
17211WDI_ProcessConfigureRxpFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017212(
Jeff Johnson295189b2012-06-20 16:38:30 -070017213 WDI_ControlBlockType* pWDICtx,
17214 WDI_EventInfoType* pEventData
17215)
17216{
17217 WDI_Status wdiStatus;
17218 eHalStatus halStatus;
17219 WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb;
17220 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17221
17222 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017223 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017224 -------------------------------------------------------------------------*/
17225 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17226 ( NULL == pEventData->pEventData))
17227 {
17228 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17229 "%s: Invalid parameters", __FUNCTION__);
17230 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017231 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017232 }
17233
17234 wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB;
17235
17236 /*-------------------------------------------------------------------------
17237 Extract response and send it to UMAC
17238 -------------------------------------------------------------------------*/
17239 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017240 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017241
17242 /*Notify UMAC*/
17243 wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17244
Jeff Johnsone7245742012-09-05 17:12:55 -070017245 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017246}/*WDI_ProcessConfigureRxpFilterRsp*/
17247
17248/**
17249 @brief Process Set beacon filter Rsp function (called when a
17250 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017251
17252 @param pWDICtx: pointer to the WLAN DAL context
17253 pEventData: pointer to the event information structure
17254
Jeff Johnson295189b2012-06-20 16:38:30 -070017255 @see
17256 @return Result of the function call
17257*/
17258WDI_Status
17259WDI_ProcessSetBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017260(
Jeff Johnson295189b2012-06-20 16:38:30 -070017261 WDI_ControlBlockType* pWDICtx,
17262 WDI_EventInfoType* pEventData
17263)
17264{
17265 WDI_Status wdiStatus;
17266 eHalStatus halStatus;
17267 WDI_SetBeaconFilterCb wdiBeaconFilterCb;
17268 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17269
17270 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017271 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017272 -------------------------------------------------------------------------*/
17273 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17274 ( NULL == pEventData->pEventData))
17275 {
17276 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17277 "%s: Invalid parameters", __FUNCTION__);
17278 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017279 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017280 }
17281
17282 wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB;
17283
17284 /*-------------------------------------------------------------------------
17285 Extract response and send it to UMAC
17286 -------------------------------------------------------------------------*/
17287 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017288 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017289
17290 /*Notify UMAC*/
17291 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17292
Jeff Johnsone7245742012-09-05 17:12:55 -070017293 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017294}/*WDI_ProcessSetBeaconFilterRsp*/
17295
17296/**
17297 @brief Process remove beacon filter Rsp function (called when a
17298 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017299
17300 @param pWDICtx: pointer to the WLAN DAL context
17301 pEventData: pointer to the event information structure
17302
Jeff Johnson295189b2012-06-20 16:38:30 -070017303 @see
17304 @return Result of the function call
17305*/
17306WDI_Status
17307WDI_ProcessRemBeaconFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017308(
Jeff Johnson295189b2012-06-20 16:38:30 -070017309 WDI_ControlBlockType* pWDICtx,
17310 WDI_EventInfoType* pEventData
17311)
17312{
17313 WDI_Status wdiStatus;
17314 eHalStatus halStatus;
17315 WDI_RemBeaconFilterCb wdiBeaconFilterCb;
17316 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17317
17318 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017319 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017320 -------------------------------------------------------------------------*/
17321 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17322 ( NULL == pEventData->pEventData))
17323 {
17324 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17325 "%s: Invalid parameters", __FUNCTION__);
17326 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017327 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017328 }
17329
17330 wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB;
17331
17332 /*-------------------------------------------------------------------------
17333 Extract response and send it to UMAC
17334 -------------------------------------------------------------------------*/
17335 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017336 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017337
17338 /*Notify UMAC*/
17339 wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData);
17340
Jeff Johnsone7245742012-09-05 17:12:55 -070017341 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017342}/*WDI_ProcessRemBeaconFilterRsp*/
17343
17344/**
17345 @brief Process set RSSI thresholds Rsp function (called when a
17346 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017347
17348 @param pWDICtx: pointer to the WLAN DAL context
17349 pEventData: pointer to the event information structure
17350
Jeff Johnson295189b2012-06-20 16:38:30 -070017351 @see
17352 @return Result of the function call
17353*/
17354WDI_Status
17355WDI_ProcessSetRSSIThresoldsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017356(
Jeff Johnson295189b2012-06-20 16:38:30 -070017357 WDI_ControlBlockType* pWDICtx,
17358 WDI_EventInfoType* pEventData
17359)
17360{
17361 WDI_Status wdiStatus;
17362 eHalStatus halStatus;
17363 WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb;
17364 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17365
17366 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017367 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017368 -------------------------------------------------------------------------*/
17369 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17370 ( NULL == pEventData->pEventData))
17371 {
17372 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17373 "%s: Invalid parameters", __FUNCTION__);
17374 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017375 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017376 }
17377
17378 wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB;
17379
17380 /*-------------------------------------------------------------------------
17381 Extract response and send it to UMAC
17382 -------------------------------------------------------------------------*/
17383 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017384 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017385
17386 /*Notify UMAC*/
17387 wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData);
17388
Jeff Johnsone7245742012-09-05 17:12:55 -070017389 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017390}/*WDI_ProcessSetRSSIThresoldsRsp*/
17391
17392/**
17393 @brief Process host offload Rsp function (called when a
17394 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017395
17396 @param pWDICtx: pointer to the WLAN DAL context
17397 pEventData: pointer to the event information structure
17398
Jeff Johnson295189b2012-06-20 16:38:30 -070017399 @see
17400 @return Result of the function call
17401*/
17402WDI_Status
17403WDI_ProcessHostOffloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017404(
Jeff Johnson295189b2012-06-20 16:38:30 -070017405 WDI_ControlBlockType* pWDICtx,
17406 WDI_EventInfoType* pEventData
17407)
17408{
17409 WDI_Status wdiStatus;
17410 eHalStatus halStatus;
17411 WDI_HostOffloadCb wdiHostOffloadCb;
17412 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17413
17414 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017415 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017416 -------------------------------------------------------------------------*/
17417 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17418 ( NULL == pEventData->pEventData))
17419 {
17420 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17421 "%s: Invalid parameters", __FUNCTION__);
17422 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017423 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017424 }
17425
17426 wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB;
17427
17428 /*-------------------------------------------------------------------------
17429 Extract response and send it to UMAC
17430 -------------------------------------------------------------------------*/
17431 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017432 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017433
17434 /*Notify UMAC*/
17435 wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData);
17436
Jeff Johnsone7245742012-09-05 17:12:55 -070017437 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017438}/*WDI_ProcessHostOffloadRsp*/
17439
17440/**
17441 @brief Process keep alive Rsp function (called when a
17442 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017443
17444 @param pWDICtx: pointer to the WLAN DAL context
17445 pEventData: pointer to the event information structure
17446
Jeff Johnson295189b2012-06-20 16:38:30 -070017447 @see
17448 @return Result of the function call
17449*/
17450WDI_Status
17451WDI_ProcessKeepAliveRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017452(
Jeff Johnson295189b2012-06-20 16:38:30 -070017453 WDI_ControlBlockType* pWDICtx,
17454 WDI_EventInfoType* pEventData
17455)
17456{
17457 WDI_Status wdiStatus;
17458 eHalStatus halStatus;
17459 WDI_KeepAliveCb wdiKeepAliveCb;
17460 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17461 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
17462 "Received WDI_ProcessKeepAliveRsp Callback from HAL");
17463
17464
17465 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017466 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017467 -------------------------------------------------------------------------*/
17468 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17469 ( NULL == pEventData->pEventData))
17470 {
17471 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17472 "%s: Invalid parameters", __FUNCTION__);
17473 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017474 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017475 }
17476
Jeff Johnsone7245742012-09-05 17:12:55 -070017477 wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB;
17478
Jeff Johnson295189b2012-06-20 16:38:30 -070017479 /*-------------------------------------------------------------------------
17480 Extract response and send it to UMAC
17481 -------------------------------------------------------------------------*/
17482 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017483 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017484
17485 /*Notify UMAC*/
17486 wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData);
17487
Jeff Johnsone7245742012-09-05 17:12:55 -070017488 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017489}/*WDI_ProcessKeepAliveRsp*/
17490
17491/**
17492 @brief Process wowl add ptrn Rsp function (called when a
17493 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017494
17495 @param pWDICtx: pointer to the WLAN DAL context
17496 pEventData: pointer to the event information structure
17497
Jeff Johnson295189b2012-06-20 16:38:30 -070017498 @see
17499 @return Result of the function call
17500*/
17501WDI_Status
17502WDI_ProcessWowlAddBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017503(
Jeff Johnson295189b2012-06-20 16:38:30 -070017504 WDI_ControlBlockType* pWDICtx,
17505 WDI_EventInfoType* pEventData
17506)
17507{
Jeff Johnson295189b2012-06-20 16:38:30 -070017508 eHalStatus halStatus;
17509 WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017510 tHalAddWowlBcastPtrnRspParams halAddWowlBcastPtrRsp;
17511 WDI_WowlAddBcPtrnRspParamsType wdiWowlAddBcPtrRsp;
17512
Jeff Johnson295189b2012-06-20 16:38:30 -070017513 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17514
17515 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017516 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017517 -------------------------------------------------------------------------*/
17518 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17519 ( NULL == pEventData->pEventData))
17520 {
17521 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17522 "%s: Invalid parameters", __FUNCTION__);
17523 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017524 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017525 }
17526
17527 wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB;
17528
17529 /*-------------------------------------------------------------------------
17530 Extract response and send it to UMAC
17531 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017532 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17533 {
17534 wpalMemoryCopy( &halAddWowlBcastPtrRsp,
17535 pEventData->pEventData,
17536 sizeof(halAddWowlBcastPtrRsp));
17537
17538 wdiWowlAddBcPtrRsp.wdiStatus =
17539 WDI_HAL_2_WDI_STATUS(halAddWowlBcastPtrRsp.status);
17540 }
17541 else
17542 {
17543 halStatus = *((eHalStatus*)pEventData->pEventData);
17544 wdiWowlAddBcPtrRsp.wdiStatus =
17545 WDI_HAL_2_WDI_STATUS(halStatus);
17546 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017547
17548 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017549 wdiWowlAddBcPtrnCb( &wdiWowlAddBcPtrRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017550
Jeff Johnsone7245742012-09-05 17:12:55 -070017551 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017552}/*WDI_ProcessWowlAddBcPtrnRsp*/
17553
17554/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017555 @brief Process wowl delete ptrn Rsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017556 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017557
17558 @param pWDICtx: pointer to the WLAN DAL context
17559 pEventData: pointer to the event information structure
17560
Jeff Johnson295189b2012-06-20 16:38:30 -070017561 @see
17562 @return Result of the function call
17563*/
17564WDI_Status
17565WDI_ProcessWowlDelBcPtrnRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017566(
Jeff Johnson295189b2012-06-20 16:38:30 -070017567 WDI_ControlBlockType* pWDICtx,
17568 WDI_EventInfoType* pEventData
17569)
17570{
Jeff Johnson295189b2012-06-20 16:38:30 -070017571 eHalStatus halStatus;
17572 WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017573 tHalDelWowlBcastPtrnRspParams halDelWowlBcastPtrRsp;
17574 WDI_WowlDelBcPtrnRspParamsType wdiWowlDelBcstPtrRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -070017575 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17576
17577 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017578 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017579 -------------------------------------------------------------------------*/
17580 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17581 ( NULL == pEventData->pEventData))
17582 {
17583 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17584 "%s: Invalid parameters", __FUNCTION__);
17585 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017586 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017587 }
17588
17589 wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB;
17590
17591 /*-------------------------------------------------------------------------
17592 Extract response and send it to UMAC
17593 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017594 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17595 {
17596 wpalMemoryCopy( &halDelWowlBcastPtrRsp,
17597 pEventData->pEventData,
17598 sizeof(halDelWowlBcastPtrRsp));
Jeff Johnson295189b2012-06-20 16:38:30 -070017599
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017600 wdiWowlDelBcstPtrRsp.wdiStatus =
17601 WDI_HAL_2_WDI_STATUS(halDelWowlBcastPtrRsp.status);
17602 }
17603 else
17604 {
17605 halStatus = *((eHalStatus*)pEventData->pEventData);
17606 wdiWowlDelBcstPtrRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
17607 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017608 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017609 wdiWowlDelBcPtrnCb( &wdiWowlDelBcstPtrRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017610
Jeff Johnsone7245742012-09-05 17:12:55 -070017611 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017612}/*WDI_ProcessWowlDelBcPtrnRsp*/
17613
17614/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017615 @brief Process wowl enter Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017616 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017617
17618 @param pWDICtx: pointer to the WLAN DAL context
17619 pEventData: pointer to the event information structure
17620
Jeff Johnson295189b2012-06-20 16:38:30 -070017621 @see
17622 @return Result of the function call
17623*/
17624WDI_Status
17625WDI_ProcessWowlEnterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017626(
Jeff Johnson295189b2012-06-20 16:38:30 -070017627 WDI_ControlBlockType* pWDICtx,
17628 WDI_EventInfoType* pEventData
17629)
17630{
Jeff Johnson295189b2012-06-20 16:38:30 -070017631 eHalStatus halStatus;
17632 WDI_WowlEnterReqCb wdiWowlEnterCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017633 WDI_WowlEnterRspParamsType wdiwowlEnterRsp;
17634 tHalEnterWowlRspParams halEnterWowlRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070017635 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17636
17637 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017638 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017639 -------------------------------------------------------------------------*/
17640 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17641 ( NULL == pEventData->pEventData))
17642 {
17643 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17644 "%s: Invalid parameters", __FUNCTION__);
17645 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017646 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017647 }
17648
17649 wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB;
17650
17651 /*-------------------------------------------------------------------------
17652 Extract response and send it to UMAC
17653 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017654 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17655 {
17656 wpalMemoryCopy( &halEnterWowlRspParams,
17657 (wpt_uint8*)pEventData->pEventData,
17658 sizeof(halEnterWowlRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070017659
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017660 wdiwowlEnterRsp.bssIdx = halEnterWowlRspParams.bssIdx;
17661 wdiwowlEnterRsp.status =
17662 WDI_HAL_2_WDI_STATUS(halEnterWowlRspParams.status);
17663 }
17664 else
17665 {
17666 halStatus = *((eHalStatus*)pEventData->pEventData);
17667 wdiwowlEnterRsp.status = WDI_HAL_2_WDI_STATUS(halStatus);
17668 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017669 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017670 wdiWowlEnterCb( &wdiwowlEnterRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017671
Jeff Johnsone7245742012-09-05 17:12:55 -070017672 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017673}/*WDI_ProcessWowlEnterRsp*/
17674
17675/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017676 @brief Process wowl exit Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017677 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017678
17679 @param pWDICtx: pointer to the WLAN DAL context
17680 pEventData: pointer to the event information structure
17681
Jeff Johnson295189b2012-06-20 16:38:30 -070017682 @see
17683 @return Result of the function call
17684*/
17685WDI_Status
17686WDI_ProcessWowlExitRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017687(
Jeff Johnson295189b2012-06-20 16:38:30 -070017688 WDI_ControlBlockType* pWDICtx,
17689 WDI_EventInfoType* pEventData
17690)
17691{
Jeff Johnson295189b2012-06-20 16:38:30 -070017692 eHalStatus halStatus;
17693 WDI_WowlExitReqCb wdiWowlExitCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017694 tHalExitWowlRspParams halExitWowlRspParams;
17695 WDI_WowlExitRspParamsType wdiWowlExitRsp;
17696
Jeff Johnson295189b2012-06-20 16:38:30 -070017697 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17698
17699 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017700 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017701 -------------------------------------------------------------------------*/
17702 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17703 ( NULL == pEventData->pEventData))
17704 {
17705 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17706 "%s: Invalid parameters", __FUNCTION__);
17707 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017708 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017709 }
17710
17711 wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB;
17712
17713 /*-------------------------------------------------------------------------
17714 Extract response and send it to UMAC
17715 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017716 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
17717 {
17718 wpalMemoryCopy( &halExitWowlRspParams,
17719 pEventData->pEventData,
17720 sizeof(halExitWowlRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070017721
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017722 wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halExitWowlRspParams.status);
17723 wdiWowlExitRsp.bssIdx = halExitWowlRspParams.bssIdx;
17724
17725 }
17726 else
17727 {
17728 halStatus = *((eHalStatus*)pEventData->pEventData);
17729 wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halStatus);
17730 }
Jeff Johnson295189b2012-06-20 16:38:30 -070017731 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070017732 wdiWowlExitCb( &wdiWowlExitRsp, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017733
Jeff Johnsone7245742012-09-05 17:12:55 -070017734 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017735}/*WDI_ProcessWowlExitRsp*/
17736
17737/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017738 @brief Process Configure Apps CPU wakeup State Rsp function
Jeff Johnson295189b2012-06-20 16:38:30 -070017739 (called when a response is being received over the bus
17740 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017741
17742 @param pWDICtx: pointer to the WLAN DAL context
17743 pEventData: pointer to the event information structure
17744
Jeff Johnson295189b2012-06-20 16:38:30 -070017745 @see
17746 @return Result of the function call
17747*/
17748WDI_Status
17749WDI_ProcessConfigureAppsCpuWakeupStateRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017750(
Jeff Johnson295189b2012-06-20 16:38:30 -070017751 WDI_ControlBlockType* pWDICtx,
17752 WDI_EventInfoType* pEventData
17753)
17754{
17755 WDI_Status wdiStatus;
17756 eHalStatus halStatus;
17757 WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb;
17758 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17759
17760 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017761 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017762 -------------------------------------------------------------------------*/
17763 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17764 ( NULL == pEventData->pEventData))
17765 {
17766 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17767 "%s: Invalid parameters", __FUNCTION__);
17768 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017769 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017770 }
17771
17772 wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB;
17773
17774 /*-------------------------------------------------------------------------
17775 Extract response and send it to UMAC
17776 -------------------------------------------------------------------------*/
17777 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017778 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017779
17780 /*Notify UMAC*/
17781 wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData);
17782
Jeff Johnsone7245742012-09-05 17:12:55 -070017783 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017784}/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/
17785
17786
17787/**
17788 @brief Process Nv download(called when a response
17789 is being received over the bus from HAL,will check if the responce is )
Jeff Johnsone7245742012-09-05 17:12:55 -070017790
17791 @param pWDICtx: pointer to the WLAN DAL context
17792 pEventData: pointer to the event information structure
17793
Jeff Johnson295189b2012-06-20 16:38:30 -070017794 @see
17795 @return Result of the function call
17796*/
17797WDI_Status
17798WDI_ProcessNvDownloadRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017799(
Jeff Johnson295189b2012-06-20 16:38:30 -070017800 WDI_ControlBlockType* pWDICtx,
17801 WDI_EventInfoType* pEventData
17802)
17803{
17804
17805 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
17806 tHalNvImgDownloadRspParams halNvDownloadRsp;
17807 WDI_NvDownloadRspInfoType wdiNvDownloadRsp;
17808
17809 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017810 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017811 -------------------------------------------------------------------------*/
17812 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17813 ( NULL == pEventData->pEventData))
17814 {
17815 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17816 "%s: Invalid parameters", __FUNCTION__);
17817 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017818 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017819 }
17820
17821 /*-------------------------------------------------------------------------
17822 Extract response and send it to UMAC
17823 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017824 wpalMemoryCopy( &halNvDownloadRsp,
17825 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017826 sizeof(halNvDownloadRsp));
17827
17828 wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status);
17829
17830 if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
Jeff Johnsone7245742012-09-05 17:12:55 -070017831 (pWDICtx->wdiNvBlobInfo.usCurrentFragment !=
17832 pWDICtx->wdiNvBlobInfo.usTotalFragment ))
Jeff Johnson295189b2012-06-20 16:38:30 -070017833 {
17834 WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq,
Jeff Johnsone7245742012-09-05 17:12:55 -070017835 (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070017836 }
17837 else
17838 {
17839 /*Reset the Nv related global information in WDI context information */
17840 pWDICtx->wdiNvBlobInfo.usTotalFragment = 0;
17841 pWDICtx->wdiNvBlobInfo.usFragmentSize = 0;
17842 pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0;
17843 /*call WDA callback function for last fragment */
17844 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB;
17845 wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData);
17846 }
17847
Jeff Johnsone7245742012-09-05 17:12:55 -070017848 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017849}
17850#ifdef WLAN_FEATURE_VOWIFI_11R
17851/**
17852 @brief Process Add TSpec Rsp function (called when a response
17853 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017854
17855 @param pWDICtx: pointer to the WLAN DAL context
17856 pEventData: pointer to the event information structure
17857
Jeff Johnson295189b2012-06-20 16:38:30 -070017858 @see
17859 @return Result of the function call
17860*/
17861WDI_Status
17862WDI_ProcessAggrAddTSpecRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017863(
Jeff Johnson295189b2012-06-20 16:38:30 -070017864 WDI_ControlBlockType* pWDICtx,
17865 WDI_EventInfoType* pEventData
17866)
17867{
17868 WDI_Status wdiStatus;
17869 tAggrAddTsRspParams aggrAddTsRsp;
17870 WDI_AggrAddTsRspCb wdiAggrAddTsRspCb;
17871 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17872
17873 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017874 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017875 -------------------------------------------------------------------------*/
17876 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17877 ( NULL == pEventData->pEventData))
17878 {
17879 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17880 "%s: Invalid parameters", __FUNCTION__);
17881 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017882 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017883 }
17884
17885 wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB;
17886
17887 /*-------------------------------------------------------------------------
17888 Extract response and send it to UMAC
17889 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070017890 wpalMemoryCopy( &aggrAddTsRsp,
17891 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070017892 sizeof(aggrAddTsRsp));
17893
17894 /* What is the difference between status0 and status1? */
Jeff Johnsone7245742012-09-05 17:12:55 -070017895 wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0);
Jeff Johnson295189b2012-06-20 16:38:30 -070017896
17897 /*Notify UMAC*/
17898 wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData);
17899
Jeff Johnsone7245742012-09-05 17:12:55 -070017900 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070017901}/*WDI_ProcessAddTSpecRsp*/
17902#endif /* WLAN_FEATURE_VOWIFI_11R */
17903
17904/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017905 @brief WDI_ProcessHostResumeRsp function (called when a
Jeff Johnson295189b2012-06-20 16:38:30 -070017906 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017907
17908 @param pWDICtx: pointer to the WLAN DAL context
17909 pEventData: pointer to the event information structure
17910
Jeff Johnson295189b2012-06-20 16:38:30 -070017911 @see
17912 @return Result of the function call
17913*/
17914WDI_Status
17915WDI_ProcessHostResumeRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017916(
Jeff Johnson295189b2012-06-20 16:38:30 -070017917 WDI_ControlBlockType* pWDICtx,
17918 WDI_EventInfoType* pEventData
17919)
17920{
17921 WDI_SuspendResumeRspParamsType wdiResumeRspParams;
17922 WDI_HostResumeEventRspCb wdiHostResumeRspCb;
17923 tHalHostResumeRspParams hostResumeRspMsg;
17924 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17925
17926 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017927 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017928 -------------------------------------------------------------------------*/
17929 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17930 ( NULL == pEventData->pEventData))
17931 {
17932 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17933 "%s: Invalid parameters", __FUNCTION__);
17934 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017935 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017936 }
17937
17938 wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB;
17939
17940 /*-------------------------------------------------------------------------
17941 Extract response and send it to UMAC
17942 -------------------------------------------------------------------------*/
17943
Jeff Johnsone7245742012-09-05 17:12:55 -070017944 wpalMemoryCopy( &hostResumeRspMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -070017945 (wpt_uint8*)pEventData->pEventData,
17946 sizeof(hostResumeRspMsg));
17947
Jeff Johnsone7245742012-09-05 17:12:55 -070017948 wdiResumeRspParams.wdiStatus =
17949 WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status);
Jeff Johnson295189b2012-06-20 16:38:30 -070017950
17951 /*Notify UMAC*/
17952 wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData);
17953
17954 return WDI_STATUS_SUCCESS;
17955}
17956
17957/**
Jeff Johnsone7245742012-09-05 17:12:55 -070017958 @brief Process Set Tx PER Rsp function (called when a response
Jeff Johnson295189b2012-06-20 16:38:30 -070017959 is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070017960
17961 @param pWDICtx: pointer to the WLAN DAL context
17962 pEventData: pointer to the event information structure
17963
Jeff Johnson295189b2012-06-20 16:38:30 -070017964 @see
17965 @return Result of the function call
17966*/
17967WDI_Status
17968WDI_ProcessSetTxPerTrackingRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070017969(
Jeff Johnson295189b2012-06-20 16:38:30 -070017970 WDI_ControlBlockType* pWDICtx,
17971 WDI_EventInfoType* pEventData
17972)
17973{
17974 WDI_Status wdiStatus;
17975 eHalStatus halStatus;
17976 WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb;
17977 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
17978
17979 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070017980 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070017981 -------------------------------------------------------------------------*/
17982 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
17983 ( NULL == pEventData->pEventData))
17984 {
17985 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
17986 "%s: Invalid parameters", __FUNCTION__);
17987 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070017988 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070017989 }
Jeff Johnsone7245742012-09-05 17:12:55 -070017990
17991 pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070017992
17993 /*-------------------------------------------------------------------------
17994 Extract response and send it to UMAC
17995 -------------------------------------------------------------------------*/
17996 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070017997 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070017998
17999 /*Notify UMAC*/
18000 pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData);
18001
Jeff Johnsone7245742012-09-05 17:12:55 -070018002 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018003}/*WDI_ProcessSetTxPerTrackingRsp*/
18004
18005/*==========================================================================
18006 Indications from HAL
18007 ==========================================================================*/
18008/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018009 @brief Process Low RSSI Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070018010 indication of this kind is being received over the bus
18011 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018012
18013 @param pWDICtx: pointer to the WLAN DAL context
18014 pEventData: pointer to the event information structure
18015
Jeff Johnson295189b2012-06-20 16:38:30 -070018016 @see
18017 @return Result of the function call
18018*/
18019WDI_Status
18020WDI_ProcessLowRSSIInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018021(
Jeff Johnson295189b2012-06-20 16:38:30 -070018022 WDI_ControlBlockType* pWDICtx,
18023 WDI_EventInfoType* pEventData
18024)
18025{
18026 WDI_LowLevelIndType wdiInd;
18027 tHalRSSINotificationIndMsg halRSSINotificationIndMsg;
18028 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18029
18030 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018031 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018032 -------------------------------------------------------------------------*/
18033 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18034 ( NULL == pEventData->pEventData))
18035 {
18036 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18037 "%s: Invalid parameters", __FUNCTION__);
18038 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018039 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018040 }
18041
18042 /*-------------------------------------------------------------------------
18043 Extract indication and send it to UMAC
18044 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018045 wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams,
18046 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018047 sizeof(tHalRSSINotification));
18048
18049 /*Fill in the indication parameters*/
18050 wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND;
18051 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross =
18052 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross;
18053 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross =
18054 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross;
18055 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross =
18056 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross;
18057 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross =
18058 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross;
18059 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross =
18060 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross;
18061 wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross =
18062 halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross;
18063
18064 /*Notify UMAC*/
18065 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018066
18067 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018068}/*WDI_ProcessLowRSSIInd*/
18069
18070
18071/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018072 @brief Process Missed Beacon Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018073 an indication of this kind is being received over the
18074 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018075
18076 @param pWDICtx: pointer to the WLAN DAL context
18077 pEventData: pointer to the event information structure
18078
Jeff Johnson295189b2012-06-20 16:38:30 -070018079 @see
18080 @return Result of the function call
18081*/
18082WDI_Status
18083WDI_ProcessMissedBeaconInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018084(
Jeff Johnson295189b2012-06-20 16:38:30 -070018085 WDI_ControlBlockType* pWDICtx,
18086 WDI_EventInfoType* pEventData
18087)
18088{
18089 WDI_Status wdiStatus;
18090 eHalStatus halStatus;
18091 WDI_LowLevelIndType wdiInd;
18092 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18093
18094 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018095 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018096 -------------------------------------------------------------------------*/
18097 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18098 ( NULL == pEventData->pEventData))
18099 {
18100 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18101 "%s: Invalid parameters", __FUNCTION__);
18102 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018103 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018104 }
18105
18106 /*-------------------------------------------------------------------------
18107 Extract indication and send it to UMAC
18108 -------------------------------------------------------------------------*/
18109 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18110 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018111 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018112
18113 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018114 wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND;
18115
Jeff Johnson295189b2012-06-20 16:38:30 -070018116 /*Notify UMAC*/
18117 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018118
18119 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018120}/*WDI_ProcessMissedBeaconInd*/
18121
18122
18123/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018124 @brief Process Unk Addr Frame Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018125 an indication of this kind is being received over the
18126 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018127
18128 @param pWDICtx: pointer to the WLAN DAL context
18129 pEventData: pointer to the event information structure
18130
Jeff Johnson295189b2012-06-20 16:38:30 -070018131 @see
18132 @return Result of the function call
18133*/
18134WDI_Status
18135WDI_ProcessUnkAddrFrameInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018136(
Jeff Johnson295189b2012-06-20 16:38:30 -070018137 WDI_ControlBlockType* pWDICtx,
18138 WDI_EventInfoType* pEventData
18139)
18140{
18141 WDI_Status wdiStatus;
18142 eHalStatus halStatus;
18143 WDI_LowLevelIndType wdiInd;
18144 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18145
18146 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018147 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018148 -------------------------------------------------------------------------*/
18149 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18150 ( NULL == pEventData->pEventData))
18151 {
18152 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18153 "%s: Invalid parameters", __FUNCTION__);
18154 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018155 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018156 }
18157
18158 /*-------------------------------------------------------------------------
18159 Extract indication and send it to UMAC
18160 -------------------------------------------------------------------------*/
18161 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18162 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018163 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018164
18165 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018166 wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018167 /* ! TO DO - fill in from HAL struct:
18168 wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/
18169
18170 /*Notify UMAC*/
18171 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018172
18173 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018174}/*WDI_ProcessUnkAddrFrameInd*/
18175
18176
18177/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018178 @brief Process MIC Failure Indication function (called when an
Jeff Johnson295189b2012-06-20 16:38:30 -070018179 indication of this kind is being received over the bus
18180 from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018181
18182 @param pWDICtx: pointer to the WLAN DAL context
18183 pEventData: pointer to the event information structure
18184
Jeff Johnson295189b2012-06-20 16:38:30 -070018185 @see
18186 @return Result of the function call
18187*/
18188WDI_Status
18189WDI_ProcessMicFailureInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018190(
Jeff Johnson295189b2012-06-20 16:38:30 -070018191 WDI_ControlBlockType* pWDICtx,
18192 WDI_EventInfoType* pEventData
18193)
18194{
18195 WDI_LowLevelIndType wdiInd;
18196 tpSirMicFailureInd pHalMicFailureInd;
18197
18198 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18199
18200 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018201 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018202 -------------------------------------------------------------------------*/
18203 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18204 ( NULL == pEventData->pEventData))
18205 {
18206 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18207 "%s: Invalid parameters", __FUNCTION__);
18208 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018209 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018210 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018211
Jeff Johnson295189b2012-06-20 16:38:30 -070018212 pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData;
18213 /*-------------------------------------------------------------------------
18214 Extract indication and send it to UMAC
18215 -------------------------------------------------------------------------*/
18216
18217 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018218 wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018219 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId,
18220 pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN);
18221 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr,
18222 pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN);
18223 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr,
18224 pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN);
18225 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr,
18226 pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070018227 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast =
Jeff Johnson295189b2012-06-20 16:38:30 -070018228 pHalMicFailureInd->info.multicast;
Jeff Johnsone7245742012-09-05 17:12:55 -070018229 wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018230 pHalMicFailureInd->info.IV1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018231 wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId=
Jeff Johnson295189b2012-06-20 16:38:30 -070018232 pHalMicFailureInd->info.keyId;
18233 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC,
18234 pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE);
18235 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr,
18236 pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN);
18237 /*Notify UMAC*/
18238 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018239
18240 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018241}/*WDI_ProcessMicFailureInd*/
18242
18243
18244/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018245 @brief Process Fatal Failure Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018246 an indication of this kind is being received over the
18247 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018248
18249 @param pWDICtx: pointer to the WLAN DAL context
18250 pEventData: pointer to the event information structure
18251
Jeff Johnson295189b2012-06-20 16:38:30 -070018252 @see
18253 @return Result of the function call
18254*/
18255WDI_Status
18256WDI_ProcessFatalErrorInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018257(
Jeff Johnson295189b2012-06-20 16:38:30 -070018258 WDI_ControlBlockType* pWDICtx,
18259 WDI_EventInfoType* pEventData
18260)
18261{
18262 WDI_Status wdiStatus;
18263 eHalStatus halStatus;
18264 WDI_LowLevelIndType wdiInd;
18265 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18266
18267 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018268 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018269 -------------------------------------------------------------------------*/
18270 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18271 ( NULL == pEventData->pEventData))
18272 {
18273 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18274 "%s: Invalid parameters", __FUNCTION__);
18275 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018276 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018277 }
18278
18279 /*-------------------------------------------------------------------------
18280 Extract indication and send it to UMAC
18281 -------------------------------------------------------------------------*/
18282
18283 /*! TO DO: Parameters need to be unpacked according to HAL struct*/
18284 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070018285 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070018286
18287 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18288 "Fatal failure received from device %d ", halStatus );
Jeff Johnsone7245742012-09-05 17:12:55 -070018289
Jeff Johnson295189b2012-06-20 16:38:30 -070018290 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018291 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
18292 wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018293
18294 /*Notify UMAC*/
18295 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018296
18297 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018298}/*WDI_ProcessFatalErrorInd*/
18299
18300/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018301 @brief Process Delete STA Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018302 an indication of this kind is being received over the
18303 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018304
18305 @param pWDICtx: pointer to the WLAN DAL context
18306 pEventData: pointer to the event information structure
18307
Jeff Johnson295189b2012-06-20 16:38:30 -070018308 @see
18309 @return Result of the function call
18310*/
18311WDI_Status
18312WDI_ProcessDelSTAInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018313(
Jeff Johnson295189b2012-06-20 16:38:30 -070018314 WDI_ControlBlockType* pWDICtx,
18315 WDI_EventInfoType* pEventData
18316)
18317{
18318 tDeleteStaContextParams halDelSTACtx;
18319 WDI_LowLevelIndType wdiInd;
18320 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18321
18322 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018323 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018324 -------------------------------------------------------------------------*/
18325 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18326 ( NULL == pEventData->pEventData))
18327 {
18328 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18329 "%s: Invalid parameters", __FUNCTION__);
18330 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018331 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018332 }
18333
18334 /*-------------------------------------------------------------------------
18335 Extract indication and send it to UMAC
18336 -------------------------------------------------------------------------*/
18337
18338 /* Parameters need to be unpacked according to HAL struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018339 wpalMemoryCopy( &halDelSTACtx,
18340 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018341 sizeof(halDelSTACtx));
18342
18343 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018344 wdiInd.wdiIndicationType = WDI_DEL_STA_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070018345
18346 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2,
18347 halDelSTACtx.addr2, WDI_MAC_ADDR_LEN);
18348 wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID,
18349 halDelSTACtx.bssId, WDI_MAC_ADDR_LEN);
18350
Jeff Johnsone7245742012-09-05 17:12:55 -070018351 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId =
Jeff Johnson295189b2012-06-20 16:38:30 -070018352 halDelSTACtx.assocId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018353 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx =
Jeff Johnson295189b2012-06-20 16:38:30 -070018354 halDelSTACtx.staId;
Jeff Johnsone7245742012-09-05 17:12:55 -070018355 wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode =
18356 halDelSTACtx.reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070018357
18358 /*Notify UMAC*/
18359 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018360
18361 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018362}/*WDI_ProcessDelSTAInd*/
18363
18364/**
18365*@brief Process Coex Indication function (called when
18366 an indication of this kind is being received over the
18367 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018368
18369 @param pWDICtx: pointer to the WLAN DAL context
18370 pEventData: pointer to the event information structure
18371
Jeff Johnson295189b2012-06-20 16:38:30 -070018372 @see
18373 @return Result of the function call
18374*/
18375WDI_Status
18376WDI_ProcessCoexInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018377(
Jeff Johnson295189b2012-06-20 16:38:30 -070018378 WDI_ControlBlockType* pWDICtx,
18379 WDI_EventInfoType* pEventData
18380)
18381{
18382 WDI_LowLevelIndType wdiInd;
18383 tCoexIndMsg halCoexIndMsg;
18384 wpt_uint32 index;
18385 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18386
18387 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018388 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018389 -------------------------------------------------------------------------*/
18390 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18391 ( NULL == pEventData->pEventData ))
18392 {
18393 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18394 "%s: Invalid parameters", __FUNCTION__);
18395 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070018396 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018397 }
18398
18399 /*-------------------------------------------------------------------------
18400 Extract indication and send it to UMAC
18401 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018402 wpalMemoryCopy( &halCoexIndMsg.coexIndParams,
18403 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018404 sizeof(halCoexIndMsg.coexIndParams) );
18405
18406 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018407 wdiInd.wdiIndicationType = WDI_COEX_IND;
18408 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType;
Jeff Johnson295189b2012-06-20 16:38:30 -070018409 for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++)
18410 {
Jeff Johnsone7245742012-09-05 17:12:55 -070018411 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index];
Jeff Johnson295189b2012-06-20 16:38:30 -070018412 }
18413
18414 // DEBUG
18415 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
18416 "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)",
Jeff Johnsone7245742012-09-05 17:12:55 -070018417 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType,
18418 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0],
18419 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1],
18420 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2],
18421 wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -070018422
18423 /*Notify UMAC*/
18424 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018425
18426 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018427}/*WDI_ProcessCoexInd*/
18428
18429/**
18430*@brief Process Tx Complete Indication function (called when
18431 an indication of this kind is being received over the
18432 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018433
18434 @param pWDICtx: pointer to the WLAN DAL context
18435 pEventData: pointer to the event information structure
18436
Jeff Johnson295189b2012-06-20 16:38:30 -070018437 @see
18438 @return Result of the function call
18439*/
18440WDI_Status
18441WDI_ProcessTxCompleteInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018442(
Jeff Johnson295189b2012-06-20 16:38:30 -070018443 WDI_ControlBlockType* pWDICtx,
18444 WDI_EventInfoType* pEventData
18445)
18446{
18447 WDI_LowLevelIndType wdiInd;
18448 tTxComplIndMsg halTxComplIndMsg;
18449 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18450
18451 /*-------------------------------------------------------------------------
18452 Sanity check
18453 -------------------------------------------------------------------------*/
18454 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18455 ( NULL == pEventData->pEventData ))
18456 {
18457 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18458 "%s: Invalid parameters", __FUNCTION__);
18459 WDI_ASSERT( 0 );
18460 return WDI_STATUS_E_FAILURE;
18461 }
18462
18463 /*-------------------------------------------------------------------------
18464 Extract indication and send it to UMAC
18465 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018466 wpalMemoryCopy( &halTxComplIndMsg.txComplParams,
18467 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070018468 sizeof(halTxComplIndMsg.txComplParams) );
18469
18470 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018471 wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND;
18472 wdiInd.wdiIndicationData.tx_complete_status
18473 = halTxComplIndMsg.txComplParams.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070018474
18475 /*Notify UMAC*/
18476 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070018477
18478 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018479}/*WDI_ProcessTxCompleteInd*/
18480
18481#ifdef WLAN_FEATURE_P2P
18482/**
18483*@brief Process Noa Attr Indication function (called when
18484 an indication of this kind is being received over the
18485 bus from HAL)
18486
18487 @param pWDICtx: pointer to the WLAN DAL context
18488 pEventData: pointer to the event information structure
18489
18490 @see
18491 @return Result of the function call
18492*/
18493WDI_Status
18494WDI_ProcessP2pNoaAttrInd
18495(
18496 WDI_ControlBlockType* pWDICtx,
18497 WDI_EventInfoType* pEventData
18498)
18499{
18500 WDI_LowLevelIndType wdiInd;
18501 tNoaAttrIndMsg halNoaAttrIndMsg;
18502 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18503
18504 /*-------------------------------------------------------------------------
18505 Sanity check
18506 -------------------------------------------------------------------------*/
18507 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18508 ( NULL == pEventData->pEventData ))
18509 {
18510 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18511 "%s: Invalid parameters", __FUNCTION__);
18512 WDI_ASSERT( 0 );
18513 return WDI_STATUS_E_FAILURE;
18514 }
18515
18516 /*-------------------------------------------------------------------------
18517 Extract indication and send it to UMAC
18518 -------------------------------------------------------------------------*/
18519 wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams,
18520 pEventData->pEventData,
18521 sizeof(halNoaAttrIndMsg.noaAttrIndParams) );
18522
18523 /*Fill in the indication parameters*/
18524 wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND;
Jeff Johnsone7245742012-09-05 17:12:55 -070018525
Jeff Johnson295189b2012-06-20 16:38:30 -070018526 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status
18527 = halNoaAttrIndMsg.noaAttrIndParams.status;
Jeff Johnsone7245742012-09-05 17:12:55 -070018528
Jeff Johnson295189b2012-06-20 16:38:30 -070018529 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex
18530 = halNoaAttrIndMsg.noaAttrIndParams.index;
18531 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag
18532 = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag;
18533 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin
18534 = halNoaAttrIndMsg.noaAttrIndParams.ctWin;
Jeff Johnsone7245742012-09-05 17:12:55 -070018535
Jeff Johnson295189b2012-06-20 16:38:30 -070018536 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt
18537 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt;
18538 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration
18539 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration;
18540 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval
18541 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval;
18542 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime
18543 = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime;
Jeff Johnsone7245742012-09-05 17:12:55 -070018544
Jeff Johnson295189b2012-06-20 16:38:30 -070018545 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt
18546 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt;
18547 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration
18548 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration;
18549 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval
18550 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval;
18551 wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime
18552 = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime;
18553
18554 /*Notify UMAC*/
18555 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18556
18557 return WDI_STATUS_SUCCESS;
18558}/*WDI_ProcessNoaAttrInd*/
18559#endif
18560
18561/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018562 @brief Process Tx PER Hit Indication function (called when
Jeff Johnson295189b2012-06-20 16:38:30 -070018563 an indication of this kind is being received over the
18564 bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070018565
18566 @param pWDICtx: pointer to the WLAN DAL context
18567 pEventData: pointer to the event information structure
18568
Jeff Johnson295189b2012-06-20 16:38:30 -070018569 @see
18570 @return Result of the function call
18571*/
18572WDI_Status
18573WDI_ProcessTxPerHitInd
Jeff Johnsone7245742012-09-05 17:12:55 -070018574(
Jeff Johnson295189b2012-06-20 16:38:30 -070018575 WDI_ControlBlockType* pWDICtx,
18576 WDI_EventInfoType* pEventData
18577)
18578{
18579 WDI_LowLevelIndType wdiInd;
18580 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070018581
Jeff Johnson295189b2012-06-20 16:38:30 -070018582 /*-------------------------------------------------------------------------
18583 Extract indication and send it to UMAC
18584 -------------------------------------------------------------------------*/
18585 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018586 wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND;
18587
Jeff Johnson295189b2012-06-20 16:38:30 -070018588 /*Notify UMAC*/
18589 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
18590
Jeff Johnsone7245742012-09-05 17:12:55 -070018591 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018592}/*WDI_ProcessTxPerHitInd*/
18593
18594#ifdef ANI_MANF_DIAG
18595/**
18596 @brief WDI_ProcessFTMCommandReq
18597 Process FTM Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018598
18599 @param pWDICtx: pointer to the WLAN DAL context
18600 pEventData: pointer to the event information structure
18601
Jeff Johnson295189b2012-06-20 16:38:30 -070018602 @see
18603 @return Result of the function call
18604*/
18605WDI_Status
18606WDI_ProcessFTMCommandReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018607(
Jeff Johnson295189b2012-06-20 16:38:30 -070018608 WDI_ControlBlockType* pWDICtx,
18609 WDI_EventInfoType* pEventData
18610)
18611{
18612 WDI_FTMCommandReqType *ftmCommandReq = NULL;
18613 wpt_uint8 *ftmCommandBuffer = NULL;
18614 wpt_uint16 dataOffset;
18615 wpt_uint16 bufferSize;
18616 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018617 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018618 -------------------------------------------------------------------------*/
18619 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18620 ( NULL == pEventData->pEventData))
18621
18622 {
18623 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18624 "%s: Invalid parameters", __FUNCTION__);
18625 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018626 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018627 }
18628
18629 ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData;
18630
18631 /* Get MSG Buffer */
18632 WDI_GetMessageBuffer(pWDICtx,
18633 WDI_FTM_CMD_REQ,
18634 ftmCommandReq->bodyLength,
18635 &ftmCommandBuffer,
18636 &dataOffset,
18637 &bufferSize);
18638
18639 wpalMemoryCopy(ftmCommandBuffer + dataOffset,
18640 ftmCommandReq->FTMCommandBody,
18641 ftmCommandReq->bodyLength);
18642
18643 /* Send MSG */
18644 return WDI_SendMsg(pWDICtx,
18645 ftmCommandBuffer,
18646 bufferSize,
18647 pEventData->pCBfnc,
18648 pEventData->pUserData,
18649 WDI_FTM_CMD_RESP);
18650}
18651
18652/**
18653 @brief WDI_ProcessFTMCommandRsp
18654 Process FTM Command Response from HAL, simply route to HDD FTM
Jeff Johnsone7245742012-09-05 17:12:55 -070018655
18656 @param pWDICtx: pointer to the WLAN DAL context
18657 pEventData: pointer to the event information structure
18658
Jeff Johnson295189b2012-06-20 16:38:30 -070018659 @see
18660 @return Result of the function call
18661*/
18662WDI_Status
18663WDI_ProcessFTMCommandRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018664(
Jeff Johnson295189b2012-06-20 16:38:30 -070018665 WDI_ControlBlockType* pWDICtx,
18666 WDI_EventInfoType* pEventData
18667)
18668{
18669 WDI_FTMCommandRspCb ftmCMDRspCb;
18670 tProcessPttRspParams *ftmCMDRspData = NULL;
18671 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18672
18673 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018674 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018675 -------------------------------------------------------------------------*/
18676 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18677 ( NULL == pEventData->pEventData))
18678 {
18679 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18680 "%s: Invalid parameters", __FUNCTION__);
18681 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018682 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018683 }
18684
18685 ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB;
18686
18687 ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData;
18688
Jeff Johnsone7245742012-09-05 17:12:55 -070018689 wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer,
18690 (void *)&ftmCMDRspData->pttMsgBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018691 ftmCMDRspData->pttMsgBuffer.msgBodyLength);
18692
18693 /*Notify UMAC*/
18694 ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData);
18695
Jeff Johnsone7245742012-09-05 17:12:55 -070018696 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070018697}
18698#endif /* ANI_MANF_DIAG */
18699/**
18700 @brief WDI_ProcessHalDumpCmdReq
18701 Process hal dump Command, simply route to HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070018702
18703 @param pWDICtx: pointer to the WLAN DAL context
18704 pEventData: pointer to the event information structure
18705
Jeff Johnson295189b2012-06-20 16:38:30 -070018706 @see
18707 @return Result of the function call
18708*/
18709WDI_Status
18710WDI_ProcessHALDumpCmdReq
Jeff Johnsone7245742012-09-05 17:12:55 -070018711(
Jeff Johnson295189b2012-06-20 16:38:30 -070018712 WDI_ControlBlockType* pWDICtx,
18713 WDI_EventInfoType* pEventData
18714)
18715{
18716 WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL;
18717 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL;
18718 wpt_uint16 usDataOffset = 0;
18719 wpt_uint16 usSendSize = 0;
18720 tHalDumpCmdReqMsg halDumpCmdReqMsg;
Jeff Johnsone7245742012-09-05 17:12:55 -070018721 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070018722
18723 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018724 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018725 -------------------------------------------------------------------------*/
18726 if (( NULL == pEventData ) ||
18727 ( NULL == pEventData->pEventData) ||
18728 ( NULL == pEventData->pCBfnc ))
18729 {
18730 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18731 "%s: Invalid parameters", __FUNCTION__);
18732 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018733 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018734 }
18735
18736 pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData;
18737 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc;
18738
18739 /* Copying the HAL DUMP Command Information HAL Structure*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018740 halDumpCmdReqMsg.dumpCmdReqParams.argument1 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018741 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command;
Jeff Johnsone7245742012-09-05 17:12:55 -070018742 halDumpCmdReqMsg.dumpCmdReqParams.argument2 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018743 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1;
Jeff Johnsone7245742012-09-05 17:12:55 -070018744 halDumpCmdReqMsg.dumpCmdReqParams.argument3 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018745 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2;
Jeff Johnsone7245742012-09-05 17:12:55 -070018746 halDumpCmdReqMsg.dumpCmdReqParams.argument4 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018747 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3;
Jeff Johnsone7245742012-09-05 17:12:55 -070018748 halDumpCmdReqMsg.dumpCmdReqParams.argument5 =
Jeff Johnson295189b2012-06-20 16:38:30 -070018749 pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4;
Jeff Johnsone7245742012-09-05 17:12:55 -070018750
Jeff Johnson295189b2012-06-20 16:38:30 -070018751 /*-----------------------------------------------------------------------
18752 Get message buffer
18753 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018754 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070018755 sizeof(halDumpCmdReqMsg.dumpCmdReqParams),
18756 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070018757 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070018758 (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) )))
18759 {
18760 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18761 "Unable to get send buffer in HAL Dump Command req %x %x %x",
18762 pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb);
18763 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018764 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018765 }
18766
Jeff Johnsone7245742012-09-05 17:12:55 -070018767 wpalMemoryCopy( pSendBuffer+usDataOffset,
18768 &halDumpCmdReqMsg.dumpCmdReqParams,
18769 sizeof(halDumpCmdReqMsg.dumpCmdReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070018770
18771 pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070018772 pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018773
18774 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018775 Send Start Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070018776 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018777 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
18778 wdiHALDumpCmdRspCb, pEventData->pUserData,
18779 WDI_HAL_DUMP_CMD_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070018780}
18781
18782/**
18783 @brief WDI_ProcessHalDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018784 Process hal Dump Command Response from HAL, simply route to HDD
18785
18786 @param pWDICtx: pointer to the WLAN DAL context
18787 pEventData: pointer to the event information structure
18788
Jeff Johnson295189b2012-06-20 16:38:30 -070018789 @see
18790 @return Result of the function call
18791*/
18792WDI_Status
18793WDI_ProcessHALDumpCmdRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070018794(
Jeff Johnson295189b2012-06-20 16:38:30 -070018795 WDI_ControlBlockType* pWDICtx,
18796 WDI_EventInfoType* pEventData
18797)
18798{
18799 WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb;
18800 tpHalDumpCmdRspParams halDumpCmdRspParams;
18801 WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp;
18802
18803 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018804 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018805 -------------------------------------------------------------------------*/
18806 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
18807 ( NULL == pEventData->pEventData))
18808 {
18809 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18810 "%s: Invalid parameters", __FUNCTION__);
18811 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018812 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018813 }
18814
Jeff Johnsone7245742012-09-05 17:12:55 -070018815 wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070018816
18817 /*Initialize the WDI Response structure */
18818 wdiHALDumpCmdRsp.usBufferLen = 0;
18819 wdiHALDumpCmdRsp.pBuffer = NULL;
18820
18821 halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070018822
18823 wdiHALDumpCmdRsp.wdiStatus =
18824 WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status);
Jeff Johnson295189b2012-06-20 16:38:30 -070018825
18826 if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) &&
18827 (halDumpCmdRspParams->rspLength != 0))
18828 {
18829 /* Copy the response data */
18830 wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength;
18831 wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength);
Jeff Johnsone7245742012-09-05 17:12:55 -070018832 wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer,
18833 wdiHALDumpCmdRsp.pBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070018834 sizeof(wdiHALDumpCmdRsp.usBufferLen));
18835 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018836
Jeff Johnson295189b2012-06-20 16:38:30 -070018837 /*Notify UMAC*/
18838 wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData);
18839
18840 if(wdiHALDumpCmdRsp.pBuffer != NULL)
18841 {
18842 /* Free the allocated buffer */
18843 wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer);
18844 }
18845 return WDI_STATUS_SUCCESS;
18846}
18847
18848/*==========================================================================
18849 CONTRL TRANSPORT INTERACTION
Jeff Johnsone7245742012-09-05 17:12:55 -070018850
Jeff Johnson295189b2012-06-20 16:38:30 -070018851 Callback function registered with the control transport - for receiving
Jeff Johnsone7245742012-09-05 17:12:55 -070018852 notifications and packets
Jeff Johnson295189b2012-06-20 16:38:30 -070018853==========================================================================*/
18854/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018855 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018856 when it wishes to send up a notification like the ones
18857 mentioned above.
Jeff Johnsone7245742012-09-05 17:12:55 -070018858
Jeff Johnson295189b2012-06-20 16:38:30 -070018859 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018860
18861 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018862 wctsEvent: the event being notified
Jeff Johnsone7245742012-09-05 17:12:55 -070018863 wctsNotifyCBData: the callback data of the user
18864
Jeff Johnson295189b2012-06-20 16:38:30 -070018865 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018866
18867 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018868*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018869void
Jeff Johnson295189b2012-06-20 16:38:30 -070018870WDI_NotifyMsgCTSCB
18871(
Jeff Johnsone7245742012-09-05 17:12:55 -070018872 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018873 WCTS_NotifyEventType wctsEvent,
18874 void* wctsNotifyCBData
18875)
18876{
Jeff Johnsone7245742012-09-05 17:12:55 -070018877 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018878 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
18879
18880 if (NULL == pWDICtx )
18881 {
18882 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18883 "%s: Invalid parameters", __FUNCTION__);
18884 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018885 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018886 }
18887
18888 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18889 {
18890 /* callback presumably occurred after close */
18891 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18892 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018893 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018894 }
18895
18896 if ( WCTS_EVENT_OPEN == wctsEvent )
18897 {
18898 /*Flag must be set atomically as it is checked from incoming request
18899 functions*/
18900 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018901 pWDICtx->bCTOpened = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018902
18903 /*Nothing to do - so try to dequeue any pending request that may have
18904 occurred while we were trying to establish this*/
18905 WDI_DequeuePendingReq(pWDICtx);
Jeff Johnsone7245742012-09-05 17:12:55 -070018906 wpalMutexRelease(&pWDICtx->wptMutex);
Jeff Johnson295189b2012-06-20 16:38:30 -070018907 }
Jeff Johnsone7245742012-09-05 17:12:55 -070018908 else if ( WCTS_EVENT_CLOSE == wctsEvent )
Jeff Johnson295189b2012-06-20 16:38:30 -070018909 {
18910 /*Flag must be set atomically as it is checked from incoming request
18911 functions*/
18912 wpalMutexAcquire(&pWDICtx->wptMutex);
Jeff Johnsone7245742012-09-05 17:12:55 -070018913 pWDICtx->bCTOpened = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070018914
18915 /*No other request will be processed from now on - fail all*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018916 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070018917 wpalMutexRelease(&pWDICtx->wptMutex);
18918
18919 /*Notify that the Control Channel is closed */
18920 wpalEventSet(&pWDICtx->wctsActionEvent);
18921 }
18922
18923}/*WDI_NotifyMsgCTSCB*/
18924
18925
18926/**
Jeff Johnsone7245742012-09-05 17:12:55 -070018927 @brief This callback is invoked by the control transport
Jeff Johnson295189b2012-06-20 16:38:30 -070018928 when it wishes to send up a packet received over the
18929 bus.
Jeff Johnsone7245742012-09-05 17:12:55 -070018930
Jeff Johnson295189b2012-06-20 16:38:30 -070018931 @param
Jeff Johnsone7245742012-09-05 17:12:55 -070018932
18933 wctsHandle: handle to the control transport service
Jeff Johnson295189b2012-06-20 16:38:30 -070018934 pMsg: the packet
18935 uLen: the packet length
Jeff Johnsone7245742012-09-05 17:12:55 -070018936 wctsRxMsgCBData: the callback data of the user
18937
Jeff Johnson295189b2012-06-20 16:38:30 -070018938 @see WCTS_OpenTransport
Jeff Johnsone7245742012-09-05 17:12:55 -070018939
18940 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070018941*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018942void
18943WDI_RXMsgCTSCB
Jeff Johnson295189b2012-06-20 16:38:30 -070018944(
Jeff Johnsone7245742012-09-05 17:12:55 -070018945 WCTS_HandleType wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070018946 void* pMsg,
18947 wpt_uint32 uLen,
18948 void* wctsRxMsgCBData
18949)
18950{
Jeff Johnsone7245742012-09-05 17:12:55 -070018951 tHalMsgHeader *pHalMsgHeader;
18952 WDI_EventInfoType wdiEventData;
Jeff Johnson295189b2012-06-20 16:38:30 -070018953 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData;
18954 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
18955
18956 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070018957 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070018958 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070018959 if ((NULL == pWDICtx ) || ( NULL == pMsg ) ||
Jeff Johnson295189b2012-06-20 16:38:30 -070018960 ( uLen < sizeof(tHalMsgHeader)))
18961 {
18962 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18963 "%s: Invalid parameters", __FUNCTION__);
18964 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070018965 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018966 }
18967
18968 if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic)
18969 {
18970 /* callback presumably occurred after close */
18971 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
18972 "%s: Invalid control block", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070018973 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018974 }
18975
Jeff Johnsone7245742012-09-05 17:12:55 -070018976 /*The RX Callback is expected to be serialized in the proper control thread
Jeff Johnson295189b2012-06-20 16:38:30 -070018977 context - so no serialization is necessary here
18978 ! - revisit this assumption */
18979
18980 pHalMsgHeader = (tHalMsgHeader *)pMsg;
18981
18982 if ( uLen != pHalMsgHeader->msgLen )
18983 {
18984 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
18985 "Invalid packet received from HAL - catastrophic failure");
Jeff Johnsone7245742012-09-05 17:12:55 -070018986 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT);
18987 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070018988 }
18989
18990 wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType );
18991
18992 /*The message itself starts after the header*/
18993 wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader);
18994 wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader);
18995 wdiEventData.pCBfnc = gWDICb.pfncRspCB;
18996 wdiEventData.pUserData = gWDICb.pRspCBUserData;
18997
18998
18999 if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse )
19000 {
19001 /*Stop the timer as the response was received */
19002 /*!UT - check for potential race conditions between stop and response */
19003 wpalTimerStop(&pWDICtx->wptResponseTimer);
19004 }
19005 /* Check if we receive a response message which is not expected */
19006 else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN )
19007 {
19008 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
19009 "Received response %s (%d) when expecting %s (%d) - catastrophic failure",
19010 WDI_getRespMsgString(wdiEventData.wdiResponse),
Jeff Johnsone7245742012-09-05 17:12:55 -070019011 wdiEventData.wdiResponse,
Jeff Johnson295189b2012-06-20 16:38:30 -070019012 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19013 pWDICtx->wdiExpectedResponse);
19014 /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */
19015 return;
19016 }
19017
19018 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19019 "Rx smth from HAL: %d", wdiEventData.wdiResponse);
19020
19021 /*Post response event to the state machine*/
19022 WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData);
19023
19024}/*WDI_RXMsgCTSCB*/
19025
19026
19027/*========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019028 Internal Helper Routines
Jeff Johnson295189b2012-06-20 16:38:30 -070019029========================================================================*/
19030
19031/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019032 @brief WDI_CleanCB - internal helper routine used to clean the
Jeff Johnson295189b2012-06-20 16:38:30 -070019033 WDI Main Control Block
Jeff Johnsone7245742012-09-05 17:12:55 -070019034
Jeff Johnson295189b2012-06-20 16:38:30 -070019035 @param pWDICtx - pointer to the control block
19036
19037 @return Result of the function call
19038*/
19039WPT_INLINE WDI_Status
19040WDI_CleanCB
19041(
19042 WDI_ControlBlockType* pWDICtx
19043)
19044{
19045 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19046
19047 /*Clean the WDI Control Block*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019048 wpalMemoryZero( pWDICtx, sizeof(*pWDICtx));
Jeff Johnson295189b2012-06-20 16:38:30 -070019049
Jeff Johnsone7245742012-09-05 17:12:55 -070019050 pWDICtx->uGlobalState = WDI_MAX_ST;
Jeff Johnson295189b2012-06-20 16:38:30 -070019051 pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS;
19052 pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS;
19053
19054 WDI_ResetAssocSessions( pWDICtx );
19055
19056 return WDI_STATUS_SUCCESS;
19057}/*WDI_CleanCB*/
19058
19059
19060/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019061 @brief Process request helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019062
Jeff Johnsone7245742012-09-05 17:12:55 -070019063
19064 @param pWDICtx: pointer to the WLAN DAL context
19065 pEventData: pointer to the event information structure
19066
Jeff Johnson295189b2012-06-20 16:38:30 -070019067 @see
19068 @return Result of the function call
19069*/
19070WPT_INLINE WDI_Status
19071WDI_ProcessRequest
19072(
19073 WDI_ControlBlockType* pWDICtx,
19074 WDI_EventInfoType* pEventData
19075)
19076{
19077 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19078
Jeff Johnsone7245742012-09-05 17:12:55 -070019079 /*!! Skip sanity check as this is called from the FSM functionss which
Jeff Johnson295189b2012-06-20 16:38:30 -070019080 already checked these pointers*/
19081
19082 if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) &&
19083 ( NULL != pfnReqProcTbl[pEventData->wdiRequest] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019084 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019085 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19086 "Calling request processing function for req %s (%d) %x",
19087 WDI_getReqMsgString(pEventData->wdiRequest),
19088 pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]);
19089 return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData);
19090 }
19091 else
19092 {
19093 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019094 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019095 pEventData->wdiRequest);
19096 return WDI_STATUS_E_NOT_IMPLEMENT;
19097 }
19098}/*WDI_ProcessRequest*/
19099
19100
19101/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019102 @brief Get message helper function - it allocates memory for a
Jeff Johnson295189b2012-06-20 16:38:30 -070019103 message that is to be sent to HAL accross the bus and
Jeff Johnsone7245742012-09-05 17:12:55 -070019104 prefixes it with a send message header
19105
19106 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019107 wdiReqType: type of the request being sent
19108 uBufferLen: message buffer len
19109 pMsgBuffer: resulting allocated buffer
19110 pusDataOffset: offset in the buffer where the caller
19111 can start copying its message data
19112 puBufferSize: the resulting buffer size (offset+buff
19113 len)
Jeff Johnsone7245742012-09-05 17:12:55 -070019114
Jeff Johnson295189b2012-06-20 16:38:30 -070019115 @see
19116 @return Result of the function call
19117*/
19118WDI_Status
19119WDI_GetMessageBuffer
Jeff Johnsone7245742012-09-05 17:12:55 -070019120(
19121 WDI_ControlBlockType* pWDICtx,
19122 WDI_RequestEnumType wdiReqType,
Jeff Johnson295189b2012-06-20 16:38:30 -070019123 wpt_uint16 usBufferLen,
Jeff Johnsone7245742012-09-05 17:12:55 -070019124 wpt_uint8** pMsgBuffer,
19125 wpt_uint16* pusDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070019126 wpt_uint16* pusBufferSize
19127)
19128{
19129 tHalMsgHeader halMsgHeader;
19130 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19131
Jeff Johnsone7245742012-09-05 17:12:55 -070019132 /*!! No sanity check here as we trust the called - ! check this assumption
Jeff Johnson295189b2012-06-20 16:38:30 -070019133 again*/
19134
19135 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019136 Try to allocate message buffer from PAL
Jeff Johnson295189b2012-06-20 16:38:30 -070019137 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019138 *pusBufferSize = sizeof(halMsgHeader) + usBufferLen;
Jeff Johnson295189b2012-06-20 16:38:30 -070019139 *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize);
19140 if ( NULL == *pMsgBuffer )
19141 {
19142 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19143 "Unable to allocate message buffer for req %s (%d)",
19144 WDI_getReqMsgString(wdiReqType),
Jeff Johnsone7245742012-09-05 17:12:55 -070019145 wdiReqType);
Jeff Johnson295189b2012-06-20 16:38:30 -070019146 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019147 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019148 }
19149
19150 /*-------------------------------------------------------------------------
19151 Fill in the message header
19152 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019153 halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType);
19154 /* Fill msgVersion */
19155#ifdef WLAN_FEATURE_11AC
19156 if (WDI_getFwWlanFeatCaps(DOT11AC))
19157 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1;
19158 else
19159#endif
19160 halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0;
Jeff Johnson295189b2012-06-20 16:38:30 -070019161
Jeff Johnsone7245742012-09-05 17:12:55 -070019162 halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen;
19163 *pusDataOffset = sizeof(halMsgHeader);
19164 wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader));
19165
19166 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019167}/*WDI_GetMessageBuffer*/
19168
19169
19170/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019171 @brief Send message helper function - sends a message over the
Jeff Johnson295189b2012-06-20 16:38:30 -070019172 bus using the control tranport and saves some info in
Jeff Johnsone7245742012-09-05 17:12:55 -070019173 the CB
19174
19175 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019176 pSendBuffer: buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019177
Jeff Johnson295189b2012-06-20 16:38:30 -070019178 usSendSize size of the buffer to be sent
19179 pRspCb: response callback - save in the WDI
19180 CB
19181 pUserData: user data associated with the
19182 callback
19183 wdiExpectedResponse: the code of the response that is
19184 expected to be rx-ed for this request
Jeff Johnsone7245742012-09-05 17:12:55 -070019185
Jeff Johnson295189b2012-06-20 16:38:30 -070019186 @see
19187 @return Result of the function call
19188*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019189WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019190WDI_SendMsg
Jeff Johnsone7245742012-09-05 17:12:55 -070019191(
19192 WDI_ControlBlockType* pWDICtx,
19193 wpt_uint8* pSendBuffer,
19194 wpt_uint32 usSendSize,
19195 void* pRspCb,
Jeff Johnson295189b2012-06-20 16:38:30 -070019196 void* pUserData,
19197 WDI_ResponseEnumType wdiExpectedResponse
19198)
19199{
Jeff Johnsond13512a2012-07-17 11:42:19 -070019200 WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019201 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19202
19203 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019204 Save needed info in the CB
Jeff Johnson295189b2012-06-20 16:38:30 -070019205 ------------------------------------------------------------------------*/
19206 pWDICtx->pRspCBUserData = pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019207 pWDICtx->pfncRspCB = pRspCb;
19208 pWDICtx->wdiExpectedResponse = wdiExpectedResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019209
19210 /*-----------------------------------------------------------------------
19211 Call the CTS to send this message over - free message afterwards
19212 - notify transport failure
19213 Note: CTS is reponsible for freeing the message buffer.
19214 -----------------------------------------------------------------------*/
19215 if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize ))
19216 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019217 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnson295189b2012-06-20 16:38:30 -070019218 "Failed to send message over the bus - catastrophic failure");
19219
Jeff Johnsond13512a2012-07-17 11:42:19 -070019220 wdiStatus = WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019221 }
19222
Jeff Johnsond13512a2012-07-17 11:42:19 -070019223 /*Check if originator provided a request status callback*/
Jeff Johnson295189b2012-06-20 16:38:30 -070019224 if ( NULL != pWDICtx->wdiReqStatusCB )
19225 {
Jeff Johnsond13512a2012-07-17 11:42:19 -070019226 /*Inform originator whether request went through or not*/
19227 WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB;
19228 void *callbackContext = pWDICtx->pReqStatusUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070019229 pWDICtx->wdiReqStatusCB = NULL;
19230 pWDICtx->pReqStatusUserData = NULL;
Jeff Johnsond13512a2012-07-17 11:42:19 -070019231 callback(wdiStatus, callbackContext);
19232
19233 /*For WDI requests which have registered a request callback,
19234 inform the WDA caller of the same via setting the return value
19235 (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt
19236 end up repeating the functonality in the req callback for the
19237 WDI_STATUS_E_FAILURE case*/
19238 if (wdiStatus == WDI_STATUS_E_FAILURE)
19239 wdiStatus = WDI_STATUS_PENDING;
Jeff Johnson295189b2012-06-20 16:38:30 -070019240 }
19241
Jeff Johnsond13512a2012-07-17 11:42:19 -070019242 if ( wdiStatus == WDI_STATUS_SUCCESS )
19243 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019244 /*Start timer for the expected response */
19245 wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT);
Jeff Johnsond13512a2012-07-17 11:42:19 -070019246 }
19247 else
19248 {
19249 /*Inform upper stack layers that a transport fatal error occured*/
19250 WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19251 }
Jeff Johnson295189b2012-06-20 16:38:30 -070019252
Jeff Johnsond13512a2012-07-17 11:42:19 -070019253 return wdiStatus;
19254
Jeff Johnson295189b2012-06-20 16:38:30 -070019255}/*WDI_SendMsg*/
19256
19257
19258
19259/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019260 @brief Send indication helper function - sends a message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019261 the bus using the control transport and saves some info
19262 in the CB
Jeff Johnsone7245742012-09-05 17:12:55 -070019263
19264 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019265 pSendBuffer: buffer to be sent
19266 usSendSize: size of the buffer to be sent
Jeff Johnsone7245742012-09-05 17:12:55 -070019267
Jeff Johnson295189b2012-06-20 16:38:30 -070019268 @see
19269 @return Result of the function call
19270*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019271WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070019272WDI_SendIndication
Jeff Johnsone7245742012-09-05 17:12:55 -070019273(
19274 WDI_ControlBlockType* pWDICtx,
19275 wpt_uint8* pSendBuffer,
Jeff Johnson295189b2012-06-20 16:38:30 -070019276 wpt_uint32 usSendSize
19277)
19278{
19279 wpt_uint32 uStatus ;
19280 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19281
19282 /*-----------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019283 Call the CTS to send this message over
Jeff Johnson295189b2012-06-20 16:38:30 -070019284 Note: CTS is reponsible for freeing the message buffer.
19285 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019286 uStatus = WCTS_SendMessage( pWDICtx->wctsHandle,
Jeff Johnson295189b2012-06-20 16:38:30 -070019287 (void*)pSendBuffer, usSendSize );
19288
19289 /*Inform Upper MAC about the outcome of the request*/
19290 if ( NULL != pWDICtx->wdiReqStatusCB )
19291 {
19292 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19293 "Send indication status : %d", uStatus);
19294
19295 pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE:
Jeff Johnsone7245742012-09-05 17:12:55 -070019296 WDI_STATUS_SUCCESS,
19297 pWDICtx->pReqStatusUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070019298 }
19299
19300 /*If sending of the message failed - it is considered catastrophic and
19301 indicates an error with the device*/
19302 if ( 0 != uStatus)
19303 {
19304 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019305 "Failed to send indication over the bus - catastrophic failure");
Jeff Johnson295189b2012-06-20 16:38:30 -070019306
19307 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE);
19308 return WDI_STATUS_E_FAILURE;
19309 }
19310
Jeff Johnsone7245742012-09-05 17:12:55 -070019311 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070019312}/*WDI_SendIndication*/
19313
19314
19315/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019316 @brief WDI_DetectedDeviceError - called internally by DAL when
19317 it has detected a failure in the device
19318
19319 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070019320 usErrorCode: error code detected by WDI or received
19321 from HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070019322
Jeff Johnson295189b2012-06-20 16:38:30 -070019323 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070019324 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019325*/
19326void
19327WDI_DetectedDeviceError
19328(
19329 WDI_ControlBlockType* pWDICtx,
19330 wpt_uint16 usErrorCode
19331)
19332{
19333 WDI_LowLevelIndType wdiInd;
19334 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
19335
19336 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19337 "Device Error detected code: %d - transitioning to stopped state",
19338 usErrorCode);
19339
19340 wpalMutexAcquire(&pWDICtx->wptMutex);
19341
19342 WDI_STATableStop(pWDICtx);
19343
19344 WDI_ResetAssocSessions(pWDICtx);
19345
19346 /*Set the expected state transition to stopped - because the device
19347 experienced a failure*/
19348 pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST;
19349
19350 /*Transition to stopped to fail all incomming requests from this point on*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019351 WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST);
Jeff Johnson295189b2012-06-20 16:38:30 -070019352
Jeff Johnsone7245742012-09-05 17:12:55 -070019353 WDI_ClearPendingRequests(pWDICtx);
Jeff Johnson295189b2012-06-20 16:38:30 -070019354
19355 /*TO DO: - there should be an attempt to reset the device here*/
19356
19357 wpalMutexRelease(&pWDICtx->wptMutex);
19358
19359 /*------------------------------------------------------------------------
19360 Notify UMAC if a handler is registered
19361 ------------------------------------------------------------------------*/
19362 if (pWDICtx->wdiLowLevelIndCB)
19363 {
Jeff Johnsone7245742012-09-05 17:12:55 -070019364 wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND;
19365 wdiInd.wdiIndicationData.usErrorCode = usErrorCode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019366
19367 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData);
19368 }
19369}/*WDI_DetectedDeviceError*/
19370
19371/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019372 @brief This callback is invoked by the wpt when a timer that
Jeff Johnson295189b2012-06-20 16:38:30 -070019373 we started on send message has expire - this should
19374 never happen - it means device is stuck and cannot
Jeff Johnsone7245742012-09-05 17:12:55 -070019375 reply - trigger catastrophic failure
19376 @param
19377
Jeff Johnson295189b2012-06-20 16:38:30 -070019378 pUserData: the callback data of the user (ptr to WDI CB)
Jeff Johnsone7245742012-09-05 17:12:55 -070019379
19380 @see
19381 @return None
Jeff Johnson295189b2012-06-20 16:38:30 -070019382*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019383void
Jeff Johnson295189b2012-06-20 16:38:30 -070019384WDI_ResponseTimerCB
19385(
19386 void *pUserData
19387)
19388{
19389 WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData;
19390 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19391
19392 if (NULL == pWDICtx )
19393 {
19394 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19395 "%s: Invalid parameters", __FUNCTION__);
19396 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019397 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019398 }
19399
19400 if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse )
19401 {
19402
19403 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19404 "Timeout occurred while waiting for %s (%d) message from device "
Jeff Johnsone7245742012-09-05 17:12:55 -070019405 " - catastrophic failure",
Jeff Johnson295189b2012-06-20 16:38:30 -070019406 WDI_getRespMsgString(pWDICtx->wdiExpectedResponse),
19407 pWDICtx->wdiExpectedResponse);
19408 /* WDI timeout means Riva is not responding or SMD communication to Riva
19409 * is not happening. The only possible way to recover from this error
Madan Mohan Koyyalamudia2fc6412012-10-21 12:06:12 -070019410 * is to initiate SSR from APPS
19411 * There is also an option to re-enable wifi, which will eventually
19412 * trigger SSR
19413 */
19414#ifndef WDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT
Jeff Johnson295189b2012-06-20 16:38:30 -070019415 wpalRivaSubystemRestart();
Madan Mohan Koyyalamudia2fc6412012-10-21 12:06:12 -070019416#else
19417 WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE);
19418 wpalWlanReload();
19419#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070019420 }
19421 else
19422 {
19423 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19424 "Timeout occurred but not waiting for any response %d",
19425 pWDICtx->wdiExpectedResponse);
19426 }
19427
19428 return;
19429
19430}/*WDI_ResponseTimerCB*/
19431
19432
19433/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019434 @brief Process response helper function
Jeff Johnson295189b2012-06-20 16:38:30 -070019435
Jeff Johnsone7245742012-09-05 17:12:55 -070019436
19437 @param pWDICtx: pointer to the WLAN DAL context
19438 pEventData: pointer to the event information structure
19439
Jeff Johnson295189b2012-06-20 16:38:30 -070019440 @see
19441 @return Result of the function call
19442*/
19443WPT_INLINE WDI_Status
19444WDI_ProcessResponse
19445(
19446 WDI_ControlBlockType* pWDICtx,
19447 WDI_EventInfoType* pEventData
19448)
19449{
19450 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19451
Jeff Johnsone7245742012-09-05 17:12:55 -070019452 /* Skip sanity check as this is called from the FSM functions which
Jeff Johnson295189b2012-06-20 16:38:30 -070019453 already checked these pointers
19454 ! - revisit this assumption */
19455 if (( pEventData->wdiResponse < WDI_MAX_RESP ) &&
19456 ( NULL != pfnRspProcTbl[pEventData->wdiResponse] ))
Jeff Johnsone7245742012-09-05 17:12:55 -070019457 {
Jeff Johnson295189b2012-06-20 16:38:30 -070019458 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070019459 "Calling response processing function for resp %s (%d) %x",
Jeff Johnson295189b2012-06-20 16:38:30 -070019460 WDI_getRespMsgString(pEventData->wdiResponse),
19461 pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]);
19462 return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData);
19463 }
19464 else
19465 {
19466 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019467 "Operation %d is not yet implemented ",
Jeff Johnson295189b2012-06-20 16:38:30 -070019468 pEventData->wdiResponse);
19469 return WDI_STATUS_E_NOT_IMPLEMENT;
19470 }
19471}/*WDI_ProcessResponse*/
19472
19473
19474/*=========================================================================
Jeff Johnsone7245742012-09-05 17:12:55 -070019475 QUEUE SUPPORT UTILITY FUNCTIONS
Jeff Johnson295189b2012-06-20 16:38:30 -070019476=========================================================================*/
19477
19478/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019479 @brief Utility function used by the DAL Core to help queue a
19480 request that cannot be processed right away.
19481 @param
19482
Jeff Johnson295189b2012-06-20 16:38:30 -070019483 pWDICtx: - pointer to the WDI control block
19484 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019485 queued
19486
19487 @see
19488 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019489*/
19490WDI_Status
19491WDI_QueuePendingReq
19492(
19493 WDI_ControlBlockType* pWDICtx,
19494 WDI_EventInfoType* pEventData
19495)
19496{
Jeff Johnsone7245742012-09-05 17:12:55 -070019497 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019498 WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData));
Jeff Johnsone7245742012-09-05 17:12:55 -070019499 void* pEventInfo = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019500 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19501
19502 if ( NULL == pEventDataQueue )
19503 {
19504 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019505 "Cannot allocate memory for queueing");
Jeff Johnson295189b2012-06-20 16:38:30 -070019506 WDI_ASSERT(0);
19507 return WDI_STATUS_MEM_FAILURE;
19508 }
19509
19510 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19511 pEventDataQueue->pUserData = pEventData->pUserData;
19512 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19513 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019514 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019515
19516 if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL )
19517 {
19518 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070019519
Jeff Johnson295189b2012-06-20 16:38:30 -070019520 if ( NULL == pEventInfo )
19521 {
19522 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019523 "Cannot allocate memory for queueing event data info");
Jeff Johnson295189b2012-06-20 16:38:30 -070019524 WDI_ASSERT(0);
19525 wpalMemoryFree(pEventDataQueue);
19526 return WDI_STATUS_MEM_FAILURE;
19527 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019528
Jeff Johnson295189b2012-06-20 16:38:30 -070019529 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19530
19531 }
19532 pEventDataQueue->pEventData = pEventInfo;
19533
19534 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019535 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019536
Jeff Johnsone7245742012-09-05 17:12:55 -070019537 wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019538
19539 return WDI_STATUS_SUCCESS;
19540}/*WDI_QueuePendingReq*/
19541
19542/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019543 @brief Callback function for serializing queued message
Jeff Johnson295189b2012-06-20 16:38:30 -070019544 processing in the control context
Jeff Johnsone7245742012-09-05 17:12:55 -070019545 @param
19546
19547 pMsg - pointer to the message
19548
19549 @see
19550 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019551*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019552void
Jeff Johnson295189b2012-06-20 16:38:30 -070019553WDI_PALCtrlMsgCB
19554(
19555 wpt_msg *pMsg
19556)
19557{
19558 WDI_EventInfoType* pEventData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070019559 WDI_ControlBlockType* pWDICtx = NULL;
19560 WDI_Status wdiStatus;
19561 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070019562 void* pUserData;
19563 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19564
19565 if (( NULL == pMsg )||
19566 ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) ||
19567 ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext )))
19568 {
19569 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019570 "Invalid message received on serialize ctrl context API");
Jeff Johnson295189b2012-06-20 16:38:30 -070019571 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019572 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070019573 }
19574
19575 /*Transition back to the state that we had before serialization
19576 - serialization transitions us to BUSY to stop any incomming requests
19577 ! TO DO L: possible race condition here if a request comes in between the
19578 state transition and the post function*/
19579
Jeff Johnsone7245742012-09-05 17:12:55 -070019580 WDI_STATE_TRANSITION( pWDICtx, pMsg->val);
Jeff Johnson295189b2012-06-20 16:38:30 -070019581
19582 /*-----------------------------------------------------------------------
19583 Check to see what type of event we are serializing
Jeff Johnsone7245742012-09-05 17:12:55 -070019584 - responses are never expected to come through here
Jeff Johnson295189b2012-06-20 16:38:30 -070019585 -----------------------------------------------------------------------*/
19586 switch ( pEventData->wdiRequest )
19587 {
19588
Jeff Johnsone7245742012-09-05 17:12:55 -070019589 case WDI_STOP_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -070019590 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData);
19591 break;
19592
Jeff Johnson295189b2012-06-20 16:38:30 -070019593 case WDI_NV_DOWNLOAD_REQ:
19594 // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT.
19595 // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly.
19596 if (pWDICtx->uGlobalState == WDI_STARTED_ST)
19597 {
19598 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19599 "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__);
19600 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19601 }
19602 else
19603 {
19604 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData);
19605 }
19606
19607 break;
19608
19609 default:
19610 wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData);
19611 break;
19612 }/*switch ( pEventData->wdiRequest )*/
19613
19614 if ( WDI_STATUS_SUCCESS != wdiStatus )
19615 {
19616 WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData);
19617
19618 if ( NULL != pfnReqStatusCB )
19619 {
19620 /*Fail the request*/
19621 pfnReqStatusCB( wdiStatus, pUserData);
19622 }
19623 }
19624
19625 /* Free data - that was allocated when queueing*/
19626 if( pEventData != NULL )
19627 {
19628 if( pEventData->pEventData != NULL )
19629 {
19630 wpalMemoryFree(pEventData->pEventData);
19631 }
19632 wpalMemoryFree(pEventData);
19633 }
19634
19635 if( pMsg != NULL )
19636 {
19637 wpalMemoryFree(pMsg);
19638 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019639
Jeff Johnson295189b2012-06-20 16:38:30 -070019640}/*WDI_PALCtrlMsgCB*/
19641
19642/**
19643 @brief Utility function used by the DAL Core to help dequeue
Jeff Johnsone7245742012-09-05 17:12:55 -070019644 and schedule for execution a pending request
19645 @param
19646
Jeff Johnson295189b2012-06-20 16:38:30 -070019647 pWDICtx: - pointer to the WDI control block
19648 pEventData: - pointer to the evnt info that needs to be
Jeff Johnsone7245742012-09-05 17:12:55 -070019649 queued
19650
19651 @see
19652 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019653*/
19654WDI_Status
19655WDI_DequeuePendingReq
19656(
19657 WDI_ControlBlockType* pWDICtx
19658)
19659{
Jeff Johnsone7245742012-09-05 17:12:55 -070019660 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070019661 WDI_EventInfoType* pEventData;
Jeff Johnsone7245742012-09-05 17:12:55 -070019662 wpt_msg* palMsg;
Jeff Johnson295189b2012-06-20 16:38:30 -070019663 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
19664
Jeff Johnsone7245742012-09-05 17:12:55 -070019665 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019666
19667 if ( NULL == pNode )
19668 {
19669 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019670 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019671 return WDI_STATUS_SUCCESS;
19672 }
19673
19674 /*The node actually points to the 1st element inside the Event Data struct -
19675 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019676 pEventData = (WDI_EventInfoType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019677
19678 /*Serialize processing in the control thread
19679 !TO DO: - check to see if these are all the messages params that need
19680 to be filled in*/
19681 palMsg = wpalMemoryAllocate(sizeof(wpt_msg));
19682
19683 if ( NULL == palMsg )
19684 {
19685 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019686 "WDI_DequeuePendingReq: Cannot allocate memory for palMsg.");
Jeff Johnson295189b2012-06-20 16:38:30 -070019687 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070019688 return WDI_STATUS_MEM_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019689 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019690 palMsg->pContext = pWDICtx;
Jeff Johnson295189b2012-06-20 16:38:30 -070019691 palMsg->callback = WDI_PALCtrlMsgCB;
19692 palMsg->ptr = pEventData;
19693
19694 /*Save the global state as we need it on the other side*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019695 palMsg->val = pWDICtx->uGlobalState;
19696
Jeff Johnson295189b2012-06-20 16:38:30 -070019697 /*Transition back to BUSY as we need to handle a queued request*/
19698 WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST);
Jeff Johnsone7245742012-09-05 17:12:55 -070019699
Jeff Johnson295189b2012-06-20 16:38:30 -070019700 wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg);
19701
19702 return WDI_STATUS_PENDING;
19703}/*WDI_DequeuePendingReq*/
19704
19705
19706/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019707 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019708 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019709 away.- The assoc requests will be queued by BSSID
19710 @param
19711
Jeff Johnson295189b2012-06-20 16:38:30 -070019712 pWDICtx: - pointer to the WDI control block
19713 pEventData: pointer to the evnt info that needs to be queued
19714 macBSSID: bssid
Jeff Johnsone7245742012-09-05 17:12:55 -070019715
19716 @see
19717 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019718*/
19719WDI_Status
19720WDI_QueueNewAssocRequest
19721(
19722 WDI_ControlBlockType* pWDICtx,
19723 WDI_EventInfoType* pEventData,
19724 wpt_macAddr macBSSID
19725)
19726{
Jeff Johnsone7245742012-09-05 17:12:55 -070019727 wpt_uint8 i;
19728 WDI_BSSSessionType* pSession = NULL;
19729 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019730 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019731 void* pEventInfo;
19732 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019733 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnson295189b2012-06-20 16:38:30 -070019734
Jeff Johnsone7245742012-09-05 17:12:55 -070019735
19736 /*------------------------------------------------------------------------
19737 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070019738 ------------------------------------------------------------------------*/
19739 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
19740 {
19741 if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse )
19742 {
19743 /*Found an empty session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019744 pSession = &pWDICtx->aBSSSessions[i];
19745 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070019746 }
19747 }
19748
19749 if ( i >= WDI_MAX_BSS_SESSIONS )
19750 {
19751 /*Cannot find any empty sessions*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019752 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019753 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019754
Jeff Johnson295189b2012-06-20 16:38:30 -070019755 /*------------------------------------------------------------------------
19756 Fill in the BSSID for this session and set the usage flag
19757 ------------------------------------------------------------------------*/
19758 wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070019759 pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019760
19761 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019762 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019763 ------------------------------------------------------------------------*/
19764 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19765 if ( NULL == pEventDataQueue )
19766 {
19767 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19768 "%s: Cannot allocate memory for queue node", __FUNCTION__);
19769 WDI_ASSERT(0);
19770 return WDI_STATUS_MEM_FAILURE;
19771 }
19772
19773 pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType));
19774 if ( NULL == pSessionIdElement )
19775 {
19776 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19777 "%s: Cannot allocate memory for session ID", __FUNCTION__);
19778 WDI_ASSERT(0);
19779 wpalMemoryFree(pEventDataQueue);
19780 return WDI_STATUS_MEM_FAILURE;
19781 }
19782
19783 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19784 if ( NULL == pEventInfo )
19785 {
19786 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19787 "%s: Cannot allocate memory for event data info", __FUNCTION__);
19788 WDI_ASSERT(0);
19789 wpalMemoryFree(pSessionIdElement);
19790 wpalMemoryFree(pEventDataQueue);
19791 return WDI_STATUS_MEM_FAILURE;
19792 }
19793
19794 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19795 pEventDataQueue->pUserData = pEventData->pUserData;
19796 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19797 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019798 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019799
19800 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19801 pEventDataQueue->pEventData = pEventInfo;
19802
19803 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019804 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019805
19806 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019807 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019808
Jeff Johnsone7245742012-09-05 17:12:55 -070019809 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019810
19811 /*We need to maintain a separate list that keeps track of the order in which
19812 the new assoc requests are being queued such that we can start processing
19813 them in the order that they had arrived*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019814 pSessionIdElement->ucIndex = i;
19815 pNode = (wpt_list_node*)pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019816
19817 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19818 "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex);
Jeff Johnsone7245742012-09-05 17:12:55 -070019819 wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019820
19821 /*Return pending as this is what the status of the request is since it has
19822 been queued*/
19823 return WDI_STATUS_PENDING;
19824}/*WDI_QueueNewAssocRequest*/
19825
19826/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019827 @brief Utility function used by the DAL Core to help queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019828 an association request that cannot be processed right
Jeff Johnsone7245742012-09-05 17:12:55 -070019829 away.- The assoc requests will be queued by BSSID
19830 @param
19831
Jeff Johnson295189b2012-06-20 16:38:30 -070019832 pWDICtx: - pointer to the WDI control block
19833 pSession: - session in which to queue
19834 pEventData: pointer to the event info that needs to be
19835 queued
Jeff Johnsone7245742012-09-05 17:12:55 -070019836
19837 @see
19838 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019839*/
19840WDI_Status
19841WDI_QueueAssocRequest
19842(
19843 WDI_ControlBlockType* pWDICtx,
19844 WDI_BSSSessionType* pSession,
19845 WDI_EventInfoType* pEventData
19846)
19847{
Jeff Johnsone7245742012-09-05 17:12:55 -070019848 wpt_list_node* pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019849 WDI_EventInfoType* pEventDataQueue;
Jeff Johnsone7245742012-09-05 17:12:55 -070019850 void* pEventInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070019851 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019852
19853 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019854 Sanity check
19855 ------------------------------------------------------------------------*/
19856 if (( NULL == pSession ) || ( NULL == pWDICtx ))
19857 {
19858 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19859 "%s: Invalid parameters", __FUNCTION__);
19860
Jeff Johnsone7245742012-09-05 17:12:55 -070019861 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019862 }
19863
19864 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070019865 Allocate memory for this and place it in the queue
Jeff Johnson295189b2012-06-20 16:38:30 -070019866 ------------------------------------------------------------------------*/
19867 pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType));
19868 if ( NULL == pEventDataQueue )
19869 {
19870 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070019871 "%s: Cannot allocate memory for queueing", __FUNCTION__);
Jeff Johnson295189b2012-06-20 16:38:30 -070019872 WDI_ASSERT(0);
19873 return WDI_STATUS_MEM_FAILURE;
19874 }
19875
19876 pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize);
19877 if ( NULL == pEventInfo )
19878 {
19879 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
19880 "%s: Cannot allocate memory for queueing event data info",
19881 __FUNCTION__);
19882 WDI_ASSERT(0);
19883 wpalMemoryFree(pEventDataQueue);
19884 return WDI_STATUS_MEM_FAILURE;
19885 }
19886
19887 pEventDataQueue->pCBfnc = pEventData->pCBfnc;
19888 pEventDataQueue->pUserData = pEventData->pUserData;
19889 pEventDataQueue->uEventDataSize = pEventData->uEventDataSize;
19890 pEventDataQueue->wdiRequest = pEventData->wdiRequest;
Jeff Johnsone7245742012-09-05 17:12:55 -070019891 pEventDataQueue->wdiResponse = pEventData->wdiResponse;
Jeff Johnson295189b2012-06-20 16:38:30 -070019892 pEventDataQueue->pEventData = pEventInfo;
19893
19894 wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize);
19895
19896 /*Send wpt a pointer to the node (this is the 1st element in the event data)*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019897 pNode = (wpt_list_node*)pEventDataQueue;
Jeff Johnson295189b2012-06-20 16:38:30 -070019898
19899 /*This association is currently being queued*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019900 pSession->bAssocReqQueued = eWLAN_PAL_TRUE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019901
Jeff Johnsone7245742012-09-05 17:12:55 -070019902 wpal_list_insert_back(&(pSession->wptPendingQueue), pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019903
19904 /*The result of this operation is pending because the request has been
19905 queued and it will be processed at a later moment in time */
19906 return WDI_STATUS_PENDING;
19907}/*WDI_QueueAssocRequest*/
19908
19909/**
19910 @brief Utility function used by the DAL Core to help dequeue
19911 an association request that was pending
19912 The request will be queued up in front of the main
19913 pending queue for imediate processing
Jeff Johnsone7245742012-09-05 17:12:55 -070019914 @param
19915
Jeff Johnson295189b2012-06-20 16:38:30 -070019916 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070019917
19918
19919 @see
19920 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070019921*/
19922WDI_Status
19923WDI_DequeueAssocRequest
19924(
19925 WDI_ControlBlockType* pWDICtx
19926)
19927{
Jeff Johnsone7245742012-09-05 17:12:55 -070019928 wpt_list_node* pNode = NULL;
19929 WDI_NextSessionIdType* pSessionIdElement;
Jeff Johnson295189b2012-06-20 16:38:30 -070019930 WDI_BSSSessionType* pSession;
19931 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Jeff Johnsone7245742012-09-05 17:12:55 -070019932
19933 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070019934 Sanity check
19935 ------------------------------------------------------------------------*/
19936 if ( NULL == pWDICtx )
19937 {
19938 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
19939 "%s: Invalid parameters", __FUNCTION__);
19940
Jeff Johnsone7245742012-09-05 17:12:55 -070019941 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019942 }
19943
19944 /*------------------------------------------------------------------------
19945 An association has been completed => a new association can occur
19946 Check to see if there are any pending associations ->
19947 If so , transfer all the pending requests into the busy queue for
19948 processing
19949 These requests have arrived prior to the requests in the busy queue
19950 (bc they needed to be processed in order to be placed in this queue)
19951 => they will be placed at the front of the busy queue
19952 ------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019953 wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019954
19955 if ( NULL == pNode )
19956 {
19957 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnsone7245742012-09-05 17:12:55 -070019958 "List is empty - return");
Jeff Johnson295189b2012-06-20 16:38:30 -070019959 return WDI_STATUS_SUCCESS;
19960 }
19961
19962 /*The node actually points to the 1st element inside the Session Id struct -
19963 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019964 pSessionIdElement = (WDI_NextSessionIdType*)pNode;
Jeff Johnson295189b2012-06-20 16:38:30 -070019965
19966 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
19967 "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex);
19968
19969 if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS )
19970 {
19971 pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex];
Jeff Johnsone7245742012-09-05 17:12:55 -070019972
Jeff Johnson295189b2012-06-20 16:38:30 -070019973 /*Transfer all the pending requests in this assoc queue to
Jeff Johnsone7245742012-09-05 17:12:55 -070019974 the front of the main waiting queue for subsequent execution*/
19975 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019976 while ( NULL != pNode )
19977 {
19978 /*Place it in front of the main pending list*/
Jeff Johnsone7245742012-09-05 17:12:55 -070019979 wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode);
19980 wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070019981 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019982 pSession->bAssocReqQueued = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019983 }
19984 else
19985 {
19986 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
Jeff Johnsone7245742012-09-05 17:12:55 -070019987 "Invalid session id queued up for assoc");
Jeff Johnson295189b2012-06-20 16:38:30 -070019988 WPAL_ASSERT(0);
19989 wpalMemoryFree(pSessionIdElement);
Jeff Johnsone7245742012-09-05 17:12:55 -070019990 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070019991 }
Jeff Johnsone7245742012-09-05 17:12:55 -070019992
Jeff Johnson295189b2012-06-20 16:38:30 -070019993 /*Clean this up as it is no longer needed in order to prevent memory leak*/
19994 wpalMemoryFree(pSessionIdElement);
19995 return WDI_STATUS_SUCCESS;
19996}/*WDI_DequeueAssocRequest*/
19997
19998/**
Jeff Johnsone7245742012-09-05 17:12:55 -070019999 @brief Utility function used by the DAL Core to clear any
Jeff Johnson295189b2012-06-20 16:38:30 -070020000 pending requests - all req cb will be called with
20001 failure and the queue will be emptied.
Jeff Johnsone7245742012-09-05 17:12:55 -070020002 @param
20003
Jeff Johnson295189b2012-06-20 16:38:30 -070020004 pWDICtx: - pointer to the WDI control block
Jeff Johnsone7245742012-09-05 17:12:55 -070020005
20006 @see
20007 @return Result of the operation
Jeff Johnson295189b2012-06-20 16:38:30 -070020008*/
20009WDI_Status
20010WDI_ClearPendingRequests
Jeff Johnsone7245742012-09-05 17:12:55 -070020011(
Jeff Johnson295189b2012-06-20 16:38:30 -070020012 WDI_ControlBlockType* pWDICtx
20013)
20014{
Jeff Johnsone7245742012-09-05 17:12:55 -070020015 wpt_list_node* pNode = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020016 WDI_EventInfoType* pEventDataQueue = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070020017 WDI_ReqStatusCb pfnReqStatusCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070020018 void* pUserData;
20019 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
20020
Jeff Johnsone7245742012-09-05 17:12:55 -070020021 wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode);
Jeff Johnson295189b2012-06-20 16:38:30 -070020022
20023 /*------------------------------------------------------------------------
20024 Go through all the requests and fail them - this will only be called
20025 when device is being stopped or an error was detected - either case the
Jeff Johnsone7245742012-09-05 17:12:55 -070020026 pending requests can no longer be sent down to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070020027 ------------------------------------------------------------------------*/
20028 while( pNode )
20029 {
20030 /*The node actually points to the 1st element inside the Event Data struct -
20031 just cast it back to the struct*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020032 pEventDataQueue = (WDI_EventInfoType*)pNode;
20033
Jeff Johnson295189b2012-06-20 16:38:30 -070020034 WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData);
20035 if ( NULL != pfnReqStatusCB )
20036 {
20037 /*Fail the request*/
20038 pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData);
20039 }
20040 /* Free data - that was allocated when queueing */
20041 if ( pEventDataQueue->pEventData != NULL )
20042 {
20043 wpalMemoryFree(pEventDataQueue->pEventData);
20044 }
20045 wpalMemoryFree(pEventDataQueue);
20046
20047 if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS)
20048 {
20049 break;
20050 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020051 }
20052
Jeff Johnson295189b2012-06-20 16:38:30 -070020053 return WDI_STATUS_SUCCESS;
20054}/*WDI_ClearPendingRequests*/
20055
20056/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020057 @brief Helper routine used to init the BSS Sessions in the WDI control block
20058
20059
20060 @param pWDICtx: pointer to the WLAN DAL context
20061
Jeff Johnson295189b2012-06-20 16:38:30 -070020062 @see
20063*/
20064void
20065WDI_ResetAssocSessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020066(
Jeff Johnson295189b2012-06-20 16:38:30 -070020067 WDI_ControlBlockType* pWDICtx
20068)
20069{
Jeff Johnsone7245742012-09-05 17:12:55 -070020070 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020071 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20072
20073 /*-------------------------------------------------------------------------
20074 No Sanity check
20075 -------------------------------------------------------------------------*/
20076 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20077 {
Jeff Johnsone7245742012-09-05 17:12:55 -070020078 wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) );
Jeff Johnson295189b2012-06-20 16:38:30 -070020079 pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST;
20080 pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX;
20081 pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX;
20082 }
20083}/*WDI_ResetAssocSessions*/
20084
20085/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020086 @brief Helper routine used to find a session based on the BSSID
20087
20088
20089 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070020090 macBSSID: BSSID of the session
Jeff Johnsone7245742012-09-05 17:12:55 -070020091 pSession: pointer to the session (if found)
20092
Jeff Johnson295189b2012-06-20 16:38:30 -070020093 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020094 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020095*/
20096wpt_uint8
20097WDI_FindAssocSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020098(
Jeff Johnson295189b2012-06-20 16:38:30 -070020099 WDI_ControlBlockType* pWDICtx,
20100 wpt_macAddr macBSSID,
20101 WDI_BSSSessionType** ppSession
20102)
20103{
Jeff Johnsone7245742012-09-05 17:12:55 -070020104 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020105 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20106
20107 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020108 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020109 -------------------------------------------------------------------------*/
20110 if ( NULL == ppSession )
20111 {
20112 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20113 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020114 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020115 }
20116
Jeff Johnsone7245742012-09-05 17:12:55 -070020117 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020118
Jeff Johnsone7245742012-09-05 17:12:55 -070020119 /*------------------------------------------------------------------------
20120 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070020121 ------------------------------------------------------------------------*/
20122 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20123 {
Jeff Johnsone7245742012-09-05 17:12:55 -070020124 if ( eWLAN_PAL_TRUE ==
Jeff Johnson295189b2012-06-20 16:38:30 -070020125 wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) )
20126 {
20127 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020128 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020129 return i;
20130 }
20131 }
20132
Jeff Johnsone7245742012-09-05 17:12:55 -070020133 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020134}/*WDI_FindAssocSession*/
20135
20136/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020137 @brief Helper routine used to find a session based on the BSSID
20138
20139
20140 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070020141 ucBSSIdx: BSS Index of the session
20142 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070020143
Jeff Johnson295189b2012-06-20 16:38:30 -070020144 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020145 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020146*/
20147wpt_uint8
20148WDI_FindAssocSessionByBSSIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070020149(
Jeff Johnson295189b2012-06-20 16:38:30 -070020150 WDI_ControlBlockType* pWDICtx,
20151 wpt_uint16 ucBSSIdx,
20152 WDI_BSSSessionType** ppSession
20153)
20154{
Jeff Johnsone7245742012-09-05 17:12:55 -070020155 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020156 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20157
20158 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020159 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020160 -------------------------------------------------------------------------*/
20161 if ( NULL == ppSession )
20162 {
20163 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20164 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020165 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020166 }
20167
Jeff Johnsone7245742012-09-05 17:12:55 -070020168 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020169
Jeff Johnsone7245742012-09-05 17:12:55 -070020170 /*------------------------------------------------------------------------
20171 Search for a session that matches the BSSID
Jeff Johnson295189b2012-06-20 16:38:30 -070020172 ------------------------------------------------------------------------*/
20173 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20174 {
20175 if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx )
20176 {
20177 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020178 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020179 return i;
20180 }
20181 }
20182
Jeff Johnsone7245742012-09-05 17:12:55 -070020183 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020184}/*WDI_FindAssocSessionByBSSIdx*/
20185
20186/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020187 @brief Helper routine used to find a session based on the BSSID
20188
20189
20190 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070020191 ucBSSIdx: BSS Index of the session
20192 ppSession: out pointer to the session (if found)
Jeff Johnsone7245742012-09-05 17:12:55 -070020193
Jeff Johnson295189b2012-06-20 16:38:30 -070020194 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020195 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020196*/
20197wpt_uint8
20198WDI_FindAssocSessionByIdx
Jeff Johnsone7245742012-09-05 17:12:55 -070020199(
Jeff Johnson295189b2012-06-20 16:38:30 -070020200 WDI_ControlBlockType* pWDICtx,
20201 wpt_uint16 usIdx,
20202 WDI_BSSSessionType** ppSession
20203)
20204{
20205 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20206
20207 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020208 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020209 -------------------------------------------------------------------------*/
20210 if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS )
20211 {
20212 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20213 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020214 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020215 }
20216
20217 /*Found the session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020218 *ppSession = &pWDICtx->aBSSSessions[usIdx];
Jeff Johnson295189b2012-06-20 16:38:30 -070020219
20220 return usIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020221
Jeff Johnson295189b2012-06-20 16:38:30 -070020222}/*WDI_FindAssocSessionByBSSIdx*/
20223
20224/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020225 @brief Helper routine used to find an empty session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020226 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020227
20228
20229 @param pWDICtx: pointer to the WLAN DAL context
20230 pSession: pointer to the session (if found)
20231
Jeff Johnson295189b2012-06-20 16:38:30 -070020232 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020233 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020234*/
20235wpt_uint8
20236WDI_FindEmptySession
Jeff Johnsone7245742012-09-05 17:12:55 -070020237(
Jeff Johnson295189b2012-06-20 16:38:30 -070020238 WDI_ControlBlockType* pWDICtx,
20239 WDI_BSSSessionType** ppSession
20240)
20241{
Jeff Johnsone7245742012-09-05 17:12:55 -070020242 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020243 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20244 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020245 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020246 -------------------------------------------------------------------------*/
20247 if ( NULL == ppSession )
20248 {
20249 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20250 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020251 return WDI_MAX_BSS_SESSIONS;
Jeff Johnson295189b2012-06-20 16:38:30 -070020252 }
20253
Jeff Johnsone7245742012-09-05 17:12:55 -070020254 *ppSession = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070020255
Jeff Johnsone7245742012-09-05 17:12:55 -070020256 /*------------------------------------------------------------------------
20257 Search for a session that it is not in use
Jeff Johnson295189b2012-06-20 16:38:30 -070020258 ------------------------------------------------------------------------*/
20259 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20260 {
20261 if ( ! pWDICtx->aBSSSessions[i].bInUse )
20262 {
20263 /*Found a session*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020264 *ppSession = &pWDICtx->aBSSSessions[i];
Jeff Johnson295189b2012-06-20 16:38:30 -070020265 return i;
20266 }
20267 }
20268
Jeff Johnsone7245742012-09-05 17:12:55 -070020269 return i;
Jeff Johnson295189b2012-06-20 16:38:30 -070020270}/*WDI_FindEmptySession*/
20271
20272
20273/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020274 @brief Helper routine used to get the total count of active
Jeff Johnson295189b2012-06-20 16:38:30 -070020275 sessions
Jeff Johnsone7245742012-09-05 17:12:55 -070020276
20277
20278 @param pWDICtx: pointer to the WLAN DAL context
20279
Jeff Johnson295189b2012-06-20 16:38:30 -070020280 @see
20281 @return Number of sessions in use
20282*/
20283wpt_uint8
20284WDI_GetActiveSessionsCount
Jeff Johnsone7245742012-09-05 17:12:55 -070020285(
Jeff Johnson295189b2012-06-20 16:38:30 -070020286 WDI_ControlBlockType* pWDICtx
20287)
20288{
Jeff Johnsone7245742012-09-05 17:12:55 -070020289 wpt_uint8 i, ucCount = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -070020290 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020291
20292 /*------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070020293 Count all sessions in use
20294 ------------------------------------------------------------------------*/
20295 for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ )
20296 {
20297 if ( pWDICtx->aBSSSessions[i].bInUse )
20298 {
20299 ucCount++;
20300 }
20301 }
20302
Jeff Johnsone7245742012-09-05 17:12:55 -070020303 return ucCount;
Jeff Johnson295189b2012-06-20 16:38:30 -070020304}/*WDI_GetActiveSessionsCount*/
20305
20306/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020307 @brief Helper routine used to delete session in the WDI
Jeff Johnson295189b2012-06-20 16:38:30 -070020308 CB
Jeff Johnsone7245742012-09-05 17:12:55 -070020309
20310
20311 @param pWDICtx: pointer to the WLAN DAL context
20312 pSession: pointer to the session (if found)
20313
Jeff Johnson295189b2012-06-20 16:38:30 -070020314 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020315 @return Index of the session in the array
Jeff Johnson295189b2012-06-20 16:38:30 -070020316*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020317void
Jeff Johnson295189b2012-06-20 16:38:30 -070020318WDI_DeleteSession
Jeff Johnsone7245742012-09-05 17:12:55 -070020319(
Jeff Johnson295189b2012-06-20 16:38:30 -070020320 WDI_ControlBlockType* pWDICtx,
20321 WDI_BSSSessionType* ppSession
20322)
20323{
20324 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070020325 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070020326 -------------------------------------------------------------------------*/
20327 if ( NULL == ppSession )
20328 {
20329 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20330 "%s: Invalid parameters", __FUNCTION__);
Jeff Johnsone7245742012-09-05 17:12:55 -070020331 return ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020332 }
20333
Jeff Johnsone7245742012-09-05 17:12:55 -070020334 /*------------------------------------------------------------------------
20335 Reset the entries int session
Jeff Johnson295189b2012-06-20 16:38:30 -070020336 ------------------------------------------------------------------------*/
20337 wpal_list_destroy(&ppSession->wptPendingQueue);
20338 wpalMemoryZero(ppSession, sizeof(*ppSession));
Jeff Johnsone7245742012-09-05 17:12:55 -070020339 ppSession->wdiAssocState = WDI_ASSOC_INIT_ST;
20340 ppSession->bInUse = eWLAN_PAL_FALSE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020341 ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE;
20342 wpal_list_init(&ppSession->wptPendingQueue);
20343
20344}/*WDI_DeleteSession*/
20345
20346/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020347 @brief Utility function to add the broadcast STA to the the STA table.
Jeff Johnson295189b2012-06-20 16:38:30 -070020348 The bcast STA ID is assigned by HAL and must be valid.
Jeff Johnsone7245742012-09-05 17:12:55 -070020349 @param
20350
Jeff Johnson295189b2012-06-20 16:38:30 -070020351 WDI_AddStaParams: - pointer to the WDI Add STA params
20352 usBcastStaIdx: - Broadcast STA index passed by HAL
Jeff Johnsone7245742012-09-05 17:12:55 -070020353
20354 @see
20355 @return void
Jeff Johnson295189b2012-06-20 16:38:30 -070020356*/
20357void
20358WDI_AddBcastSTAtoSTATable
20359(
20360 WDI_ControlBlockType* pWDICtx,
20361 WDI_AddStaParams * staParams,
20362 wpt_uint16 usBcastStaIdx
20363)
20364{
20365 WDI_AddStaParams wdiAddSTAParam = {0};
20366 wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
20367 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
20368
20369 /*---------------------------------------------------------------------
20370 Sanity check
20371 ---------------------------------------------------------------------*/
20372 if ( NULL == staParams )
20373 {
20374 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20375 "%s: Invalid parameters", __FUNCTION__);
20376
Jeff Johnsone7245742012-09-05 17:12:55 -070020377 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020378 }
20379
20380 wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex;
20381 wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature;
20382 wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex;
20383 wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature;
20384 wdiAddSTAParam.dpuIndex = staParams->dpuIndex;
20385 wdiAddSTAParam.dpuSig = staParams->dpuSig;
20386 wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID,
20387 WDI_MAC_ADDR_LEN );
20388 wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN );
20389 wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx;
20390 wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable;
20391 wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled;
20392 wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST;
20393 wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled;
20394 wdiAddSTAParam.ucSTAIdx = usBcastStaIdx;
Jeff Johnsone7245742012-09-05 17:12:55 -070020395
Jeff Johnson295189b2012-06-20 16:38:30 -070020396 (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam);
20397}
20398
20399/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020400 @brief NV blob will be divided into fragments of size 4kb and
20401 Sent to HAL
20402
20403 @param pWDICtx: pointer to the WLAN DAL context
20404 pEventData: pointer to the event information structure
20405
Jeff Johnson295189b2012-06-20 16:38:30 -070020406 @see
20407 @return Result of the function call
20408 */
20409
20410WDI_Status WDI_SendNvBlobReq
Jeff Johnsone7245742012-09-05 17:12:55 -070020411(
Jeff Johnson295189b2012-06-20 16:38:30 -070020412 WDI_ControlBlockType* pWDICtx,
20413 WDI_EventInfoType* pEventData
20414)
20415{
20416
20417 tHalNvImgDownloadReqMsg halNvImgDownloadParam;
20418 wpt_uint8* pSendBuffer = NULL;
20419 wpt_uint16 usDataOffset = 0;
20420 wpt_uint16 usSendSize = 0;
20421 wpt_uint16 usCurrentFragmentSize =0;
20422 wpt_uint8* pSrcBuffer = NULL;
20423 WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ;
20424 WDI_NvDownloadRspCb wdiNvDownloadRspCb;
20425
20426 wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc;
20427 WDI_ASSERT(NULL != wdiNvDownloadRspCb);
20428 pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData;
20429
Jeff Johnsone7245742012-09-05 17:12:55 -070020430 /* Sanity Check is done by the caller */
Jeff Johnson295189b2012-06-20 16:38:30 -070020431 pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress;
20432
20433 /* Update the current Fragment Number */
20434 pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1;
20435
20436 /*Update the HAL REQ structure */
20437 /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/
20438 halNvImgDownloadParam.nvImageReqParams.fragNumber =
20439 pWDICtx->wdiNvBlobInfo.usCurrentFragment-1;
20440
20441 /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL.
Jeff Johnsone7245742012-09-05 17:12:55 -070020442 If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total
Jeff Johnson295189b2012-06-20 16:38:30 -070020443 image will be sent to HAL*/
20444
Jeff Johnsone7245742012-09-05 17:12:55 -070020445 if(pWDICtx->wdiNvBlobInfo.usTotalFragment
Jeff Johnson295189b2012-06-20 16:38:30 -070020446 == pWDICtx->wdiNvBlobInfo.usCurrentFragment)
Jeff Johnsone7245742012-09-05 17:12:55 -070020447 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020448 /* Taking care of boundry condition */
Jeff Johnsone7245742012-09-05 17:12:55 -070020449 if( !(usCurrentFragmentSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070020450 pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE ))
20451 usCurrentFragmentSize = FRAGMENT_SIZE;
20452
20453 /*Update the HAL REQ structure */
20454 halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1;
20455 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize;
20456
20457 }
20458 else
Jeff Johnsone7245742012-09-05 17:12:55 -070020459 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020460 usCurrentFragmentSize = FRAGMENT_SIZE;
20461
20462 /*Update the HAL REQ structure */
20463 halNvImgDownloadParam.nvImageReqParams.isLastFragment =0;
20464 halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize;
20465 }
20466
20467 /*-----------------------------------------------------------------------
20468 Get message buffer
20469 -----------------------------------------------------------------------*/
20470 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ,
20471 sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize,
20472 &pSendBuffer, &usDataOffset, &usSendSize))||
Jeff Johnsone7245742012-09-05 17:12:55 -070020473 ( usSendSize <
Jeff Johnson295189b2012-06-20 16:38:30 -070020474 (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize )))
20475 {
20476 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
20477 "Unable to get send buffer in NV Download req %x %x ",
20478 pEventData, pwdiNvDownloadReqParams);
20479 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070020480 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020481 }
20482
20483 /* Copying the Hal NV download REQ structure */
Jeff Johnsone7245742012-09-05 17:12:55 -070020484 wpalMemoryCopy(pSendBuffer + usDataOffset ,
Jeff Johnson295189b2012-06-20 16:38:30 -070020485 &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams));
20486
20487 /* Appending the NV image fragment */
20488 wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams),
20489 (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE),
20490 usCurrentFragmentSize);
20491
20492 pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070020493 pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070020494
Jeff Johnsone7245742012-09-05 17:12:55 -070020495 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
20496 wdiNvDownloadRspCb, pEventData->pUserData,
Jeff Johnson295189b2012-06-20 16:38:30 -070020497 WDI_NV_DOWNLOAD_RESP);
20498
20499}
Jeff Johnsone7245742012-09-05 17:12:55 -070020500/*============================================================================
20501 Helper inline functions for
Jeff Johnson295189b2012-06-20 16:38:30 -070020502 ============================================================================*/
20503/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020504 @brief Helper routine used to find a session based on the BSSID
20505 @param pContext: pointer to the WLAN DAL context
20506 @param pDPContext: pointer to the Datapath context
20507
Jeff Johnson295189b2012-06-20 16:38:30 -070020508 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020509 @return
Jeff Johnson295189b2012-06-20 16:38:30 -070020510*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020511WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020512WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext)
20513{
20514 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20515
20516 pCB->pDPContext = pDPContext;
20517 return;
20518}
20519
20520/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020521 @brief Helper routine used to find a session based on the BSSID
20522
20523
20524 @param pContext: pointer to the WLAN DAL context
20525
Jeff Johnson295189b2012-06-20 16:38:30 -070020526 @see
20527 @return pointer to Datapath context
20528*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020529WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020530WDI_DS_GetDatapathContext (void *pContext)
20531{
20532 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20533 return pCB->pDPContext;
20534}
20535/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020536 @brief Helper routine used to find a session based on the BSSID
20537
20538
20539 @param pContext: pointer to the WLAN DAL context
20540 @param pDTDriverContext: pointer to the Transport Driver context
20541
Jeff Johnson295189b2012-06-20 16:38:30 -070020542 @see
20543 @return void
20544*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020545WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070020546WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext)
20547{
20548 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
20549
20550 pCB->pDTDriverContext = pDTDriverContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020551 return;
Jeff Johnson295189b2012-06-20 16:38:30 -070020552}
20553
20554/**
Jeff Johnsone7245742012-09-05 17:12:55 -070020555 @brief Helper routine used to find a session based on the BSSID
20556
20557
20558 @param pWDICtx: pointer to the WLAN DAL context
20559
Jeff Johnson295189b2012-06-20 16:38:30 -070020560 @see
Jeff Johnsone7245742012-09-05 17:12:55 -070020561 @return pointer to datapath context
Jeff Johnson295189b2012-06-20 16:38:30 -070020562*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020563WPT_INLINE void *
Jeff Johnson295189b2012-06-20 16:38:30 -070020564WDT_GetTransportDriverContext (void *pContext)
20565{
20566 WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext;
Jeff Johnsone7245742012-09-05 17:12:55 -070020567 return(pCB->pDTDriverContext);
Jeff Johnson295189b2012-06-20 16:38:30 -070020568}
20569
Jeff Johnsone7245742012-09-05 17:12:55 -070020570/*============================================================================
Jeff Johnson295189b2012-06-20 16:38:30 -070020571 Helper inline converters
20572 ============================================================================*/
20573/*Convert WDI driver type into HAL driver type*/
20574WPT_STATIC WPT_INLINE WDI_Status
20575WDI_HAL_2_WDI_STATUS
20576(
20577 eHalStatus halStatus
20578)
20579{
Jeff Johnsone7245742012-09-05 17:12:55 -070020580 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020581 the chances of getting inlined*/
20582 switch( halStatus )
20583 {
20584 case eHAL_STATUS_SUCCESS:
20585 case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20586 case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO:
20587 return WDI_STATUS_SUCCESS;
20588 case eHAL_STATUS_FAILURE:
20589 return WDI_STATUS_E_FAILURE;
20590 case eHAL_STATUS_FAILED_ALLOC:
Jeff Johnsone7245742012-09-05 17:12:55 -070020591 return WDI_STATUS_MEM_FAILURE;
20592 /*The rest of the HAL error codes must be kept hidden from the UMAC as
Jeff Johnson295189b2012-06-20 16:38:30 -070020593 they refer to specific internal modules of our device*/
Jeff Johnsone7245742012-09-05 17:12:55 -070020594 default:
20595 return WDI_STATUS_DEV_INTERNAL_FAILURE;
20596 }
Jeff Johnson295189b2012-06-20 16:38:30 -070020597
Jeff Johnsone7245742012-09-05 17:12:55 -070020598 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070020599}/*WDI_HAL_2_WDI_STATUS*/
20600
20601/*Convert WDI request type into HAL request type*/
20602WPT_STATIC WPT_INLINE tHalHostMsgType
20603WDI_2_HAL_REQ_TYPE
20604(
20605 WDI_RequestEnumType wdiReqType
20606)
20607{
Jeff Johnsone7245742012-09-05 17:12:55 -070020608 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020609 the chances of getting inlined*/
20610 switch( wdiReqType )
Jeff Johnsone7245742012-09-05 17:12:55 -070020611 {
Jeff Johnson295189b2012-06-20 16:38:30 -070020612 case WDI_START_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020613 return WLAN_HAL_START_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020614 case WDI_STOP_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020615 return WLAN_HAL_STOP_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020616 case WDI_INIT_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020617 return WLAN_HAL_INIT_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020618 case WDI_START_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020619 return WLAN_HAL_START_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020620 case WDI_END_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020621 return WLAN_HAL_END_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020622 case WDI_FINISH_SCAN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020623 return WLAN_HAL_FINISH_SCAN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020624 case WDI_JOIN_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020625 return WLAN_HAL_JOIN_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020626 case WDI_CONFIG_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020627 return WLAN_HAL_CONFIG_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020628 case WDI_DEL_BSS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020629 return WLAN_HAL_DELETE_BSS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020630 case WDI_POST_ASSOC_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020631 return WLAN_HAL_POST_ASSOC_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020632 case WDI_DEL_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020633 return WLAN_HAL_DELETE_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020634 case WDI_SET_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020635 return WLAN_HAL_SET_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020636 case WDI_RMV_BSS_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020637 return WLAN_HAL_RMV_BSSKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020638 case WDI_SET_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020639 return WLAN_HAL_SET_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020640 case WDI_RMV_STA_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020641 return WLAN_HAL_RMV_STAKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020642 case WDI_SET_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020643 return WLAN_HAL_SET_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020644 case WDI_RMV_STA_BCAST_KEY_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020645 //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020646 return WLAN_HAL_RMV_STAKEY_REQ;
20647 case WDI_ADD_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020648 return WLAN_HAL_ADD_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020649 case WDI_DEL_TS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020650 return WLAN_HAL_DEL_TS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020651 case WDI_UPD_EDCA_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020652 return WLAN_HAL_UPD_EDCA_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020653 case WDI_ADD_BA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020654 return WLAN_HAL_ADD_BA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020655 case WDI_DEL_BA_REQ:
20656 return WLAN_HAL_DEL_BA_REQ;
20657#ifdef FEATURE_WLAN_CCX
20658 case WDI_TSM_STATS_REQ:
20659 return WLAN_HAL_TSM_STATS_REQ;
20660#endif
20661 case WDI_CH_SWITCH_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020662 return WLAN_HAL_CH_SWITCH_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020663 case WDI_CONFIG_STA_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020664 return WLAN_HAL_CONFIG_STA_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020665 case WDI_SET_LINK_ST_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020666 return WLAN_HAL_SET_LINK_ST_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020667 case WDI_GET_STATS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020668 return WLAN_HAL_GET_STATS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020669 case WDI_UPDATE_CFG_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020670 return WLAN_HAL_UPDATE_CFG_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020671 case WDI_ADD_BA_SESSION_REQ:
20672 return WLAN_HAL_ADD_BA_SESSION_REQ;
20673 case WDI_TRIGGER_BA_REQ:
20674 return WLAN_HAL_TRIGGER_BA_REQ;
20675 case WDI_UPD_BCON_PRMS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020676 return WLAN_HAL_UPDATE_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020677 case WDI_SND_BCON_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020678 return WLAN_HAL_SEND_BEACON_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020679 case WDI_UPD_PROBE_RSP_TEMPLATE_REQ:
20680 return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ;
20681 case WDI_SET_MAX_TX_POWER_REQ:
20682 return WLAN_HAL_SET_MAX_TX_POWER_REQ;
20683#ifdef WLAN_FEATURE_P2P
20684 case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ:
20685 return WLAN_HAL_SET_P2P_GONOA_REQ;
20686#endif
20687 case WDI_ENTER_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020688 return WLAN_HAL_ENTER_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020689 case WDI_EXIT_IMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020690 return WLAN_HAL_EXIT_IMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020691 case WDI_ENTER_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020692 return WLAN_HAL_ENTER_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020693 case WDI_EXIT_BMPS_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020694 return WLAN_HAL_EXIT_BMPS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020695 case WDI_ENTER_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020696 return WLAN_HAL_ENTER_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020697 case WDI_EXIT_UAPSD_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020698 return WLAN_HAL_EXIT_UAPSD_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020699 case WDI_SET_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020700 return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020701 case WDI_UPDATE_UAPSD_PARAM_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020702 return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020703 case WDI_CONFIGURE_RXP_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020704 return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020705 case WDI_SET_BEACON_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020706 return WLAN_HAL_ADD_BCN_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020707 case WDI_REM_BEACON_FILTER_REQ:
20708 return WLAN_HAL_REM_BCN_FILTER_REQ;
20709 case WDI_SET_RSSI_THRESHOLDS_REQ:
20710 return WLAN_HAL_SET_RSSI_THRESH_REQ;
20711 case WDI_HOST_OFFLOAD_REQ:
20712 return WLAN_HAL_HOST_OFFLOAD_REQ;
20713 case WDI_WOWL_ADD_BC_PTRN_REQ:
20714 return WLAN_HAL_ADD_WOWL_BCAST_PTRN;
20715 case WDI_WOWL_DEL_BC_PTRN_REQ:
20716 return WLAN_HAL_DEL_WOWL_BCAST_PTRN;
20717 case WDI_WOWL_ENTER_REQ:
20718 return WLAN_HAL_ENTER_WOWL_REQ;
20719 case WDI_WOWL_EXIT_REQ:
20720 return WLAN_HAL_EXIT_WOWL_REQ;
20721 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
20722 return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ;
20723 case WDI_NV_DOWNLOAD_REQ:
20724 return WLAN_HAL_DOWNLOAD_NV_REQ;
20725 case WDI_FLUSH_AC_REQ:
20726 return WLAN_HAL_TL_HAL_FLUSH_AC_REQ;
20727 case WDI_BTAMP_EVENT_REQ:
20728 return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ;
20729#ifdef WLAN_FEATURE_VOWIFI_11R
20730 case WDI_AGGR_ADD_TS_REQ:
20731 return WLAN_HAL_AGGR_ADD_TS_REQ;
20732#endif /* WLAN_FEATURE_VOWIFI_11R */
20733#ifdef ANI_MANF_DIAG
20734 case WDI_FTM_CMD_REQ:
20735 return WLAN_HAL_PROCESS_PTT_REQ;
20736#endif /* ANI_MANF_DIAG */
20737 case WDI_ADD_STA_SELF_REQ:
20738 return WLAN_HAL_ADD_STA_SELF_REQ;
20739 case WDI_DEL_STA_SELF_REQ:
20740 return WLAN_HAL_DEL_STA_SELF_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070020741#ifdef FEATURE_OEM_DATA_SUPPORT
20742 case WDI_START_OEM_DATA_REQ:
20743 return WLAN_HAL_START_OEM_DATA_REQ;
20744#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020745 case WDI_HOST_RESUME_REQ:
20746 return WLAN_HAL_HOST_RESUME_REQ;
20747 case WDI_HOST_SUSPEND_IND:
20748 return WLAN_HAL_HOST_SUSPEND_IND;
20749 case WDI_KEEP_ALIVE_REQ:
20750 return WLAN_HAL_KEEP_ALIVE_REQ;
20751
20752#ifdef FEATURE_WLAN_SCAN_PNO
20753 case WDI_SET_PREF_NETWORK_REQ:
20754 return WLAN_HAL_SET_PREF_NETWORK_REQ;
20755 case WDI_SET_RSSI_FILTER_REQ:
20756 return WLAN_HAL_SET_RSSI_FILTER_REQ;
20757 case WDI_UPDATE_SCAN_PARAMS_REQ:
20758 return WLAN_HAL_UPDATE_SCAN_PARAM_REQ;
20759#endif // FEATURE_WLAN_SCAN_PNO
20760 case WDI_SET_TX_PER_TRACKING_REQ:
20761 return WLAN_HAL_SET_TX_PER_TRACKING_REQ;
20762#ifdef WLAN_FEATURE_PACKET_FILTERING
20763 case WDI_8023_MULTICAST_LIST_REQ:
20764 return WLAN_HAL_8023_MULTICAST_LIST_REQ;
20765 case WDI_RECEIVE_FILTER_SET_FILTER_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -070020766 return WLAN_HAL_SET_PACKET_FILTER_REQ;
Jeff Johnson295189b2012-06-20 16:38:30 -070020767 case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ:
20768 return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ;
20769 case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ:
20770 return WLAN_HAL_CLEAR_PACKET_FILTER_REQ;
20771#endif // WLAN_FEATURE_PACKET_FILTERING
20772 case WDI_HAL_DUMP_CMD_REQ:
20773 return WLAN_HAL_DUMP_COMMAND_REQ;
20774#ifdef WLAN_FEATURE_GTK_OFFLOAD
20775 case WDI_GTK_OFFLOAD_REQ:
20776 return WLAN_HAL_GTK_OFFLOAD_REQ;
20777 case WDI_GTK_OFFLOAD_GETINFO_REQ:
20778 return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ;
20779#endif /* WLAN_FEATURE_GTK_OFFLOAD */
20780
20781 case WDI_INIT_SCAN_CON_REQ:
20782 return WLAN_HAL_INIT_SCAN_CON_REQ;
20783 case WDI_SET_POWER_PARAMS_REQ:
20784 return WLAN_HAL_SET_POWER_PARAMS_REQ;
20785 case WDI_SET_TM_LEVEL_REQ:
20786 return WLAN_HAL_SET_THERMAL_MITIGATION_REQ;
20787 case WDI_FEATURE_CAPS_EXCHANGE_REQ:
20788 return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ;
Mohit Khanna4a70d262012-09-11 16:30:12 -070020789#ifdef WLAN_FEATURE_11AC
20790 case WDI_UPDATE_VHT_OP_MODE_REQ:
20791 return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ;
20792#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070020793 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070020794 return WLAN_HAL_MSG_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070020795 }
Jeff Johnsone7245742012-09-05 17:12:55 -070020796
Jeff Johnson295189b2012-06-20 16:38:30 -070020797}/*WDI_2_HAL_REQ_TYPE*/
20798
20799/*Convert WDI response type into HAL response type*/
20800WPT_STATIC WPT_INLINE WDI_ResponseEnumType
20801HAL_2_WDI_RSP_TYPE
20802(
20803 tHalHostMsgType halMsg
20804)
20805{
Jeff Johnsone7245742012-09-05 17:12:55 -070020806 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070020807 the chances of getting inlined*/
20808 switch( halMsg )
20809 {
20810 case WLAN_HAL_START_RSP:
20811 return WDI_START_RESP;
20812 case WLAN_HAL_STOP_RSP:
20813 return WDI_STOP_RESP;
20814 case WLAN_HAL_INIT_SCAN_RSP:
20815 return WDI_INIT_SCAN_RESP;
20816 case WLAN_HAL_START_SCAN_RSP:
20817 return WDI_START_SCAN_RESP;
20818 case WLAN_HAL_END_SCAN_RSP:
20819 return WDI_END_SCAN_RESP;
20820 case WLAN_HAL_FINISH_SCAN_RSP:
20821 return WDI_FINISH_SCAN_RESP;
20822 case WLAN_HAL_CONFIG_STA_RSP:
20823 return WDI_CONFIG_STA_RESP;
20824 case WLAN_HAL_DELETE_STA_RSP:
20825 return WDI_DEL_STA_RESP;
20826 case WLAN_HAL_CONFIG_BSS_RSP:
20827 return WDI_CONFIG_BSS_RESP;
20828 case WLAN_HAL_DELETE_BSS_RSP:
20829 return WDI_DEL_BSS_RESP;
20830 case WLAN_HAL_JOIN_RSP:
20831 return WDI_JOIN_RESP;
20832 case WLAN_HAL_POST_ASSOC_RSP:
20833 return WDI_POST_ASSOC_RESP;
20834 case WLAN_HAL_SET_BSSKEY_RSP:
20835 return WDI_SET_BSS_KEY_RESP;
20836 case WLAN_HAL_SET_STAKEY_RSP:
20837 return WDI_SET_STA_KEY_RESP;
20838 case WLAN_HAL_RMV_BSSKEY_RSP:
20839 return WDI_RMV_BSS_KEY_RESP;
20840 case WLAN_HAL_RMV_STAKEY_RSP:
20841 return WDI_RMV_STA_KEY_RESP;
20842 case WLAN_HAL_SET_BCASTKEY_RSP:
20843 return WDI_SET_STA_BCAST_KEY_RESP;
20844 //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP:
20845 // return WDI_RMV_STA_BCAST_KEY_RESP;
20846 case WLAN_HAL_ADD_TS_RSP:
20847 return WDI_ADD_TS_RESP;
20848 case WLAN_HAL_DEL_TS_RSP:
20849 return WDI_DEL_TS_RESP;
20850 case WLAN_HAL_UPD_EDCA_PARAMS_RSP:
20851 return WDI_UPD_EDCA_PRMS_RESP;
20852 case WLAN_HAL_ADD_BA_RSP:
20853 return WDI_ADD_BA_RESP;
20854 case WLAN_HAL_DEL_BA_RSP:
20855 return WDI_DEL_BA_RESP;
20856#ifdef FEATURE_WLAN_CCX
20857 case WLAN_HAL_TSM_STATS_RSP:
20858 return WDI_TSM_STATS_RESP;
20859#endif
20860 case WLAN_HAL_CH_SWITCH_RSP:
20861 return WDI_CH_SWITCH_RESP;
20862 case WLAN_HAL_SET_LINK_ST_RSP:
20863 return WDI_SET_LINK_ST_RESP;
20864 case WLAN_HAL_GET_STATS_RSP:
20865 return WDI_GET_STATS_RESP;
20866 case WLAN_HAL_UPDATE_CFG_RSP:
20867 return WDI_UPDATE_CFG_RESP;
20868 case WLAN_HAL_ADD_BA_SESSION_RSP:
20869 return WDI_ADD_BA_SESSION_RESP;
20870 case WLAN_HAL_TRIGGER_BA_RSP:
20871 return WDI_TRIGGER_BA_RESP;
20872 case WLAN_HAL_UPDATE_BEACON_RSP:
20873 return WDI_UPD_BCON_PRMS_RESP;
20874 case WLAN_HAL_SEND_BEACON_RSP:
20875 return WDI_SND_BCON_RESP;
20876 case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
20877 return WDI_UPD_PROBE_RSP_TEMPLATE_RESP;
20878 /*Indications*/
20879 case WLAN_HAL_RSSI_NOTIFICATION_IND:
20880 return WDI_HAL_RSSI_NOTIFICATION_IND;
20881 case WLAN_HAL_MISSED_BEACON_IND:
20882 return WDI_HAL_MISSED_BEACON_IND;
20883 case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND:
20884 return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND;
20885 case WLAN_HAL_MIC_FAILURE_IND:
20886 return WDI_HAL_MIC_FAILURE_IND;
20887 case WLAN_HAL_FATAL_ERROR_IND:
20888 return WDI_HAL_FATAL_ERROR_IND;
20889 case WLAN_HAL_DELETE_STA_CONTEXT_IND:
20890 return WDI_HAL_DEL_STA_IND;
20891 case WLAN_HAL_COEX_IND:
20892 return WDI_HAL_COEX_IND;
20893 case WLAN_HAL_OTA_TX_COMPL_IND:
20894 return WDI_HAL_TX_COMPLETE_IND;
20895#ifdef WLAN_FEATURE_P2P
20896 case WLAN_HAL_P2P_NOA_ATTR_IND:
20897 return WDI_HAL_P2P_NOA_ATTR_IND;
20898#endif
20899 case WLAN_HAL_TX_PER_HIT_IND:
20900 return WDI_HAL_TX_PER_HIT_IND;
20901 case WLAN_HAL_SET_MAX_TX_POWER_RSP:
20902 return WDI_SET_MAX_TX_POWER_RESP;
20903#ifdef WLAN_FEATURE_P2P
20904 case WLAN_HAL_SET_P2P_GONOA_RSP:
20905 return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP;
20906#endif
20907 case WLAN_HAL_ENTER_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020908 return WDI_ENTER_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020909 case WLAN_HAL_EXIT_IMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020910 return WDI_EXIT_IMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020911 case WLAN_HAL_ENTER_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020912 return WDI_ENTER_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020913 case WLAN_HAL_EXIT_BMPS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020914 return WDI_EXIT_BMPS_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020915 case WLAN_HAL_ENTER_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020916 return WDI_ENTER_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020917 case WLAN_HAL_EXIT_UAPSD_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020918 return WDI_EXIT_UAPSD_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020919 case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020920 return WDI_SET_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020921 case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020922 return WDI_UPDATE_UAPSD_PARAM_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020923 case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020924 return WDI_CONFIGURE_RXP_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020925 case WLAN_HAL_ADD_BCN_FILTER_RSP:
20926 return WDI_SET_BEACON_FILTER_RESP;
20927 case WLAN_HAL_REM_BCN_FILTER_RSP:
20928 return WDI_REM_BEACON_FILTER_RESP;
20929 case WLAN_HAL_SET_RSSI_THRESH_RSP:
20930 return WDI_SET_RSSI_THRESHOLDS_RESP;
20931 case WLAN_HAL_HOST_OFFLOAD_RSP:
20932 return WDI_HOST_OFFLOAD_RESP;
20933 case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP:
20934 return WDI_WOWL_ADD_BC_PTRN_RESP;
20935 case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP:
20936 return WDI_WOWL_DEL_BC_PTRN_RESP;
20937 case WLAN_HAL_ENTER_WOWL_RSP:
20938 return WDI_WOWL_ENTER_RESP;
20939 case WLAN_HAL_EXIT_WOWL_RSP:
20940 return WDI_WOWL_EXIT_RESP;
20941 case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP:
20942 return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP;
20943 case WLAN_HAL_DOWNLOAD_NV_RSP:
20944 return WDI_NV_DOWNLOAD_RESP;
20945 case WLAN_HAL_TL_HAL_FLUSH_AC_RSP:
20946 return WDI_FLUSH_AC_RESP;
20947 case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP:
20948 return WDI_BTAMP_EVENT_RESP;
20949#ifdef ANI_MANF_DIAG
20950 case WLAN_HAL_PROCESS_PTT_RSP:
20951 return WDI_FTM_CMD_RESP;
20952#endif /* ANI_MANF_DIAG */
20953 case WLAN_HAL_ADD_STA_SELF_RSP:
20954 return WDI_ADD_STA_SELF_RESP;
20955case WLAN_HAL_DEL_STA_SELF_RSP:
20956 return WDI_DEL_STA_SELF_RESP;
Jeff Johnsone7245742012-09-05 17:12:55 -070020957#ifdef FEATURE_OEM_DATA_SUPPORT
20958 case WLAN_HAL_START_OEM_DATA_RSP:
20959 return WDI_START_OEM_DATA_RESP;
20960#endif /* FEATURE_OEM_DATA_SUPPORT */
Jeff Johnson295189b2012-06-20 16:38:30 -070020961 case WLAN_HAL_HOST_RESUME_RSP:
20962 return WDI_HOST_RESUME_RESP;
20963 case WLAN_HAL_KEEP_ALIVE_RSP:
20964 return WDI_KEEP_ALIVE_RESP;
20965#ifdef FEATURE_WLAN_SCAN_PNO
20966 case WLAN_HAL_SET_PREF_NETWORK_RSP:
20967 return WDI_SET_PREF_NETWORK_RESP;
20968 case WLAN_HAL_SET_RSSI_FILTER_RSP:
Jeff Johnsone7245742012-09-05 17:12:55 -070020969 return WDI_SET_RSSI_FILTER_RESP;
Jeff Johnson295189b2012-06-20 16:38:30 -070020970 case WLAN_HAL_UPDATE_SCAN_PARAM_RSP:
20971 return WDI_UPDATE_SCAN_PARAMS_RESP;
20972 case WLAN_HAL_PREF_NETW_FOUND_IND:
20973 return WDI_HAL_PREF_NETWORK_FOUND_IND;
20974#endif // FEATURE_WLAN_SCAN_PNO
20975 case WLAN_HAL_SET_TX_PER_TRACKING_RSP:
20976 return WDI_SET_TX_PER_TRACKING_RESP;
20977#ifdef WLAN_FEATURE_PACKET_FILTERING
20978 case WLAN_HAL_8023_MULTICAST_LIST_RSP:
20979 return WDI_8023_MULTICAST_LIST_RESP;
20980 case WLAN_HAL_SET_PACKET_FILTER_RSP:
20981 return WDI_RECEIVE_FILTER_SET_FILTER_RESP;
20982 case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP:
20983 return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP;
20984 case WLAN_HAL_CLEAR_PACKET_FILTER_RSP:
20985 return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP;
20986#endif // WLAN_FEATURE_PACKET_FILTERING
20987
20988 case WLAN_HAL_DUMP_COMMAND_RSP:
20989 return WDI_HAL_DUMP_CMD_RESP;
20990 case WLAN_HAL_SET_POWER_PARAMS_RSP:
20991 return WDI_SET_POWER_PARAMS_RESP;
20992#ifdef WLAN_FEATURE_VOWIFI_11R
20993 case WLAN_HAL_AGGR_ADD_TS_RSP:
20994 return WDI_AGGR_ADD_TS_RESP;
20995#endif
20996
20997#ifdef WLAN_FEATURE_GTK_OFFLOAD
20998 case WLAN_HAL_GTK_OFFLOAD_RSP:
20999 return WDI_GTK_OFFLOAD_RESP;
21000 case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP:
21001 return WDI_GTK_OFFLOAD_GETINFO_RESP;
21002#endif /* WLAN_FEATURE_GTK_OFFLOAD */
21003#ifdef WLAN_WAKEUP_EVENTS
21004 case WLAN_HAL_WAKE_REASON_IND:
21005 return WDI_HAL_WAKE_REASON_IND;
21006#endif // WLAN_WAKEUP_EVENTS
21007
21008 case WLAN_HAL_SET_THERMAL_MITIGATION_RSP:
21009 return WDI_SET_TM_LEVEL_RESP;
21010 case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP:
21011 return WDI_FEATURE_CAPS_EXCHANGE_RESP;
Mohit Khanna4a70d262012-09-11 16:30:12 -070021012#ifdef WLAN_FEATURE_11AC
21013 case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP:
21014 return WDI_UPDATE_VHT_OP_MODE_RESP;
21015#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021016 default:
Jeff Johnsone7245742012-09-05 17:12:55 -070021017 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021018 }
21019
21020}/*HAL_2_WDI_RSP_TYPE*/
21021
21022
21023/*Convert WDI driver type into HAL driver type*/
21024WPT_STATIC WPT_INLINE tDriverType
21025WDI_2_HAL_DRV_TYPE
21026(
21027 WDI_DriverType wdiDriverType
21028)
21029{
Jeff Johnsone7245742012-09-05 17:12:55 -070021030 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021031 the chances of getting inlined*/
21032 switch( wdiDriverType )
21033 {
21034 case WDI_DRIVER_TYPE_PRODUCTION:
21035 return eDRIVER_TYPE_PRODUCTION;
21036 case WDI_DRIVER_TYPE_MFG:
21037 return eDRIVER_TYPE_MFG;
21038 case WDI_DRIVER_TYPE_DVT:
21039 return eDRIVER_TYPE_DVT;
21040 }
21041
Jeff Johnsone7245742012-09-05 17:12:55 -070021042 return eDRIVER_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021043}/*WDI_2_HAL_DRV_TYPE*/
21044
21045
21046/*Convert WDI stop reason into HAL stop reason*/
21047WPT_STATIC WPT_INLINE tHalStopType
21048WDI_2_HAL_STOP_REASON
21049(
21050 WDI_StopType wdiDriverType
21051)
21052{
Jeff Johnsone7245742012-09-05 17:12:55 -070021053 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021054 the chances of getting inlined*/
21055 switch( wdiDriverType )
21056 {
21057 case WDI_STOP_TYPE_SYS_RESET:
21058 return HAL_STOP_TYPE_SYS_RESET;
21059 case WDI_DRIVER_TYPE_MFG:
21060 return WDI_STOP_TYPE_SYS_DEEP_SLEEP;
21061 case WDI_STOP_TYPE_RF_KILL:
21062 return HAL_STOP_TYPE_RF_KILL;
21063 }
21064
Jeff Johnsone7245742012-09-05 17:12:55 -070021065 return HAL_STOP_TYPE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021066}/*WDI_2_HAL_STOP_REASON*/
21067
21068
21069/*Convert WDI scan mode type into HAL scan mode type*/
21070WPT_STATIC WPT_INLINE eHalSysMode
21071WDI_2_HAL_SCAN_MODE
21072(
21073 WDI_ScanMode wdiScanMode
21074)
21075{
Jeff Johnsone7245742012-09-05 17:12:55 -070021076 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021077 the chances of getting inlined*/
21078 switch( wdiScanMode )
21079 {
21080 case WDI_SCAN_MODE_NORMAL:
21081 return eHAL_SYS_MODE_NORMAL;
21082 case WDI_SCAN_MODE_LEARN:
21083 return eHAL_SYS_MODE_LEARN;
21084 case WDI_SCAN_MODE_SCAN:
21085 return eHAL_SYS_MODE_SCAN;
21086 case WDI_SCAN_MODE_PROMISC:
21087 return eHAL_SYS_MODE_PROMISC;
21088 case WDI_SCAN_MODE_SUSPEND_LINK:
21089 return eHAL_SYS_MODE_SUSPEND_LINK;
Madan Mohan Koyyalamudi9b876782012-10-11 16:22:51 -070021090 case WDI_SCAN_MODE_ROAM_SCAN:
21091 return eHAL_SYS_MODE_ROAM_SCAN;
21092 case WDI_SCAN_MODE_ROAM_SUSPEND_LINK:
21093 return eHAL_SYS_MODE_ROAM_SUSPEND_LINK;
Jeff Johnson295189b2012-06-20 16:38:30 -070021094 }
21095
Jeff Johnsone7245742012-09-05 17:12:55 -070021096 return eHAL_SYS_MODE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021097}/*WDI_2_HAL_SCAN_MODE*/
21098
21099/*Convert WDI sec ch offset into HAL sec ch offset type*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021100WPT_STATIC WPT_INLINE ePhyChanBondState
Jeff Johnson295189b2012-06-20 16:38:30 -070021101WDI_2_HAL_SEC_CH_OFFSET
21102(
21103 WDI_HTSecondaryChannelOffset wdiSecChOffset
21104)
21105{
Jeff Johnsone7245742012-09-05 17:12:55 -070021106 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021107 the chances of getting inlined*/
21108 switch( wdiSecChOffset )
21109 {
21110 case WDI_SECONDARY_CHANNEL_OFFSET_NONE:
Jeff Johnsone7245742012-09-05 17:12:55 -070021111 return PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -070021112 case WDI_SECONDARY_CHANNEL_OFFSET_UP:
Jeff Johnsone7245742012-09-05 17:12:55 -070021113 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
Jeff Johnson295189b2012-06-20 16:38:30 -070021114 case WDI_SECONDARY_CHANNEL_OFFSET_DOWN:
Jeff Johnsone7245742012-09-05 17:12:55 -070021115 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
21116#ifdef WLAN_FEATURE_11AC
21117 case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
21118 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
21119 case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
21120 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
21121 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
21122 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
21123 case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW:
21124 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21125 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
21126 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21127 case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
21128 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
21129 case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
21130 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
21131#endif
21132 default:
21133 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021134 }
21135
Jeff Johnsone7245742012-09-05 17:12:55 -070021136 return PHY_CHANNEL_BONDING_STATE_MAX;
Jeff Johnson295189b2012-06-20 16:38:30 -070021137}/*WDI_2_HAL_SEC_CH_OFFSET*/
21138
21139/*Convert WDI BSS type into HAL BSS type*/
21140WPT_STATIC WPT_INLINE tSirBssType
21141WDI_2_HAL_BSS_TYPE
21142(
21143 WDI_BssType wdiBSSType
21144)
21145{
Jeff Johnsone7245742012-09-05 17:12:55 -070021146 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021147 the chances of getting inlined*/
21148 switch( wdiBSSType )
21149 {
21150 case WDI_INFRASTRUCTURE_MODE:
21151 return eSIR_INFRASTRUCTURE_MODE;
21152 case WDI_INFRA_AP_MODE:
21153 return eSIR_INFRA_AP_MODE;
21154 case WDI_IBSS_MODE:
21155 return eSIR_IBSS_MODE;
21156 case WDI_BTAMP_STA_MODE:
21157 return eSIR_BTAMP_STA_MODE;
21158 case WDI_BTAMP_AP_MODE:
Jeff Johnsone7245742012-09-05 17:12:55 -070021159 return eSIR_BTAMP_AP_MODE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021160 case WDI_BSS_AUTO_MODE:
21161 return eSIR_AUTO_MODE;
21162 }
21163
Jeff Johnsone7245742012-09-05 17:12:55 -070021164 return eSIR_DONOT_USE_BSS_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021165}/*WDI_2_HAL_BSS_TYPE*/
21166
21167/*Convert WDI NW type into HAL NW type*/
21168WPT_STATIC WPT_INLINE tSirNwType
21169WDI_2_HAL_NW_TYPE
21170(
21171 WDI_NwType wdiNWType
21172)
21173{
Jeff Johnsone7245742012-09-05 17:12:55 -070021174 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021175 the chances of getting inlined*/
21176 switch( wdiNWType )
21177 {
21178 case WDI_11A_NW_TYPE:
21179 return eSIR_11A_NW_TYPE;
21180 case WDI_11B_NW_TYPE:
21181 return eSIR_11B_NW_TYPE;
21182 case WDI_11G_NW_TYPE:
21183 return eSIR_11G_NW_TYPE;
21184 case WDI_11N_NW_TYPE:
21185 return eSIR_11N_NW_TYPE;
21186 }
21187
Jeff Johnsone7245742012-09-05 17:12:55 -070021188 return eSIR_DONOT_USE_NW_TYPE;
Jeff Johnson295189b2012-06-20 16:38:30 -070021189}/*WDI_2_HAL_NW_TYPE*/
21190
21191/*Convert WDI chanel bonding type into HAL cb type*/
21192WPT_STATIC WPT_INLINE ePhyChanBondState
21193WDI_2_HAL_CB_STATE
21194(
21195 WDI_PhyChanBondState wdiCbState
21196)
21197{
Jeff Johnsone7245742012-09-05 17:12:55 -070021198 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021199 the chances of getting inlined*/
21200 switch ( wdiCbState )
21201 {
21202 case WDI_PHY_SINGLE_CHANNEL_CENTERED:
21203 return PHY_SINGLE_CHANNEL_CENTERED;
21204 case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
21205 return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
21206 case WDI_PHY_DOUBLE_CHANNEL_CENTERED:
21207 return PHY_DOUBLE_CHANNEL_CENTERED;
21208 case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
21209 return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
Jeff Johnsone7245742012-09-05 17:12:55 -070021210#ifdef WLAN_FEATURE_11AC
21211 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
21212 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED;
21213 case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
21214 return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
21215 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
21216 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED;
21217 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
21218 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
21219 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
21220 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
21221 case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
21222 return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
21223 case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
21224 return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
21225#endif
21226 case WDI_MAX_CB_STATE:
21227 default:
21228 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021229 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021230
Jeff Johnson295189b2012-06-20 16:38:30 -070021231 return PHY_CHANNEL_BONDING_STATE_MAX;
21232}/*WDI_2_HAL_CB_STATE*/
21233
21234/*Convert WDI chanel bonding type into HAL cb type*/
21235WPT_STATIC WPT_INLINE tSirMacHTOperatingMode
21236WDI_2_HAL_HT_OPER_MODE
21237(
21238 WDI_HTOperatingMode wdiHTOperMode
21239)
21240{
Jeff Johnsone7245742012-09-05 17:12:55 -070021241 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021242 the chances of getting inlined*/
21243 switch ( wdiHTOperMode )
21244 {
21245 case WDI_HT_OP_MODE_PURE:
21246 return eSIR_HT_OP_MODE_PURE;
21247 case WDI_HT_OP_MODE_OVERLAP_LEGACY:
21248 return eSIR_HT_OP_MODE_OVERLAP_LEGACY;
21249 case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT:
21250 return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT;
21251 case WDI_HT_OP_MODE_MIXED:
21252 return eSIR_HT_OP_MODE_MIXED;
21253 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021254
Jeff Johnson295189b2012-06-20 16:38:30 -070021255 return eSIR_HT_OP_MODE_MAX;
21256}/*WDI_2_HAL_HT_OPER_MODE*/
21257
21258/*Convert WDI mimo PS type into HAL mimo PS type*/
21259WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState
21260WDI_2_HAL_MIMO_PS
21261(
21262 WDI_HTMIMOPowerSaveState wdiHTOperMode
21263)
21264{
Jeff Johnsone7245742012-09-05 17:12:55 -070021265 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021266 the chances of getting inlined*/
21267 switch ( wdiHTOperMode )
21268 {
21269 case WDI_HT_MIMO_PS_STATIC:
21270 return eSIR_HT_MIMO_PS_STATIC;
21271 case WDI_HT_MIMO_PS_DYNAMIC:
21272 return eSIR_HT_MIMO_PS_DYNAMIC;
21273 case WDI_HT_MIMO_PS_NA:
21274 return eSIR_HT_MIMO_PS_NA;
21275 case WDI_HT_MIMO_PS_NO_LIMIT:
21276 return eSIR_HT_MIMO_PS_NO_LIMIT;
21277 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021278
Jeff Johnson295189b2012-06-20 16:38:30 -070021279 return eSIR_HT_MIMO_PS_MAX;
21280}/*WDI_2_HAL_MIMO_PS*/
21281
21282/*Convert WDI ENC type into HAL ENC type*/
21283WPT_STATIC WPT_INLINE tAniEdType
21284WDI_2_HAL_ENC_TYPE
21285(
21286 WDI_EncryptType wdiEncType
21287)
21288{
Jeff Johnsone7245742012-09-05 17:12:55 -070021289 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021290 the chances of getting inlined*/
21291 switch ( wdiEncType )
21292 {
21293 case WDI_ENCR_NONE:
21294 return eSIR_ED_NONE;
21295
21296 case WDI_ENCR_WEP40:
21297 return eSIR_ED_WEP40;
21298
21299 case WDI_ENCR_WEP104:
21300 return eSIR_ED_WEP104;
21301
21302 case WDI_ENCR_TKIP:
21303 return eSIR_ED_TKIP;
21304
21305 case WDI_ENCR_CCMP:
21306 return eSIR_ED_CCMP;
21307
21308 case WDI_ENCR_AES_128_CMAC:
21309 return eSIR_ED_AES_128_CMAC;
21310#if defined(FEATURE_WLAN_WAPI)
21311 case WDI_ENCR_WPI:
21312 return eSIR_ED_WPI;
21313#endif
21314 default:
21315 return eSIR_ED_NOT_IMPLEMENTED;
21316 }
21317
21318}/*WDI_2_HAL_ENC_TYPE*/
21319
21320/*Convert WDI WEP type into HAL WEP type*/
21321WPT_STATIC WPT_INLINE tAniWepType
21322WDI_2_HAL_WEP_TYPE
21323(
21324 WDI_WepType wdiWEPType
21325)
21326{
Jeff Johnsone7245742012-09-05 17:12:55 -070021327 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021328 the chances of getting inlined*/
21329 switch ( wdiWEPType )
21330 {
21331 case WDI_WEP_STATIC:
21332 return eSIR_WEP_STATIC;
21333
21334 case WDI_WEP_DYNAMIC:
21335 return eSIR_WEP_DYNAMIC;
21336 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021337
Jeff Johnson295189b2012-06-20 16:38:30 -070021338 return eSIR_WEP_MAX;
21339}/*WDI_2_HAL_WEP_TYPE*/
21340
21341WPT_STATIC WPT_INLINE tSirLinkState
21342WDI_2_HAL_LINK_STATE
21343(
21344 WDI_LinkStateType wdiLinkState
21345)
21346{
Jeff Johnsone7245742012-09-05 17:12:55 -070021347 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021348 the chances of getting inlined*/
21349 switch ( wdiLinkState )
21350 {
21351 case WDI_LINK_IDLE_STATE:
21352 return eSIR_LINK_IDLE_STATE;
21353
21354 case WDI_LINK_PREASSOC_STATE:
21355 return eSIR_LINK_PREASSOC_STATE;
21356
21357 case WDI_LINK_POSTASSOC_STATE:
21358 return eSIR_LINK_POSTASSOC_STATE;
21359
21360 case WDI_LINK_AP_STATE:
21361 return eSIR_LINK_AP_STATE;
21362
21363 case WDI_LINK_IBSS_STATE:
21364 return eSIR_LINK_IBSS_STATE;
21365
21366 case WDI_LINK_BTAMP_PREASSOC_STATE:
21367 return eSIR_LINK_BTAMP_PREASSOC_STATE;
21368
21369 case WDI_LINK_BTAMP_POSTASSOC_STATE:
21370 return eSIR_LINK_BTAMP_POSTASSOC_STATE;
21371
21372 case WDI_LINK_BTAMP_AP_STATE:
21373 return eSIR_LINK_BTAMP_AP_STATE;
21374
21375 case WDI_LINK_BTAMP_STA_STATE:
21376 return eSIR_LINK_BTAMP_STA_STATE;
21377
21378 case WDI_LINK_LEARN_STATE:
21379 return eSIR_LINK_LEARN_STATE;
21380
21381 case WDI_LINK_SCAN_STATE:
21382 return eSIR_LINK_SCAN_STATE;
21383
21384 case WDI_LINK_FINISH_SCAN_STATE:
21385 return eSIR_LINK_FINISH_SCAN_STATE;
21386
21387 case WDI_LINK_INIT_CAL_STATE:
21388 return eSIR_LINK_INIT_CAL_STATE;
21389
21390 case WDI_LINK_FINISH_CAL_STATE:
21391 return eSIR_LINK_FINISH_CAL_STATE;
21392
21393#ifdef WLAN_FEATURE_P2P
21394 case WDI_LINK_LISTEN_STATE:
21395 return eSIR_LINK_LISTEN_STATE;
21396#endif
21397
21398 default:
21399 return eSIR_LINK_MAX;
Jeff Johnsone7245742012-09-05 17:12:55 -070021400 }
Jeff Johnson295189b2012-06-20 16:38:30 -070021401}
21402
Jeff Johnsone7245742012-09-05 17:12:55 -070021403/*Translate a STA Context from WDI into HAL*/
21404WPT_STATIC WPT_INLINE
Jeff Johnson295189b2012-06-20 16:38:30 -070021405void
21406WDI_CopyWDIStaCtxToHALStaCtx
Jeff Johnsone7245742012-09-05 17:12:55 -070021407(
Jeff Johnson295189b2012-06-20 16:38:30 -070021408 tConfigStaParams* phalConfigSta,
21409 WDI_ConfigStaReqInfoType* pwdiConfigSta
21410)
21411{
21412 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070021413#ifdef WLAN_FEATURE_11AC
21414 /* Get the Version 1 Handler */
21415 tConfigStaParams_V1* phalConfigSta_V1 = NULL;
21416 if (WDI_getFwWlanFeatCaps(DOT11AC))
21417 {
21418 phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta;
21419 }
21420#endif
21421 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021422 the chances of getting inlined*/
21423
Jeff Johnsone7245742012-09-05 17:12:55 -070021424 wpalMemoryCopy(phalConfigSta->bssId,
21425 pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN);
21426
21427 wpalMemoryCopy(phalConfigSta->staMac,
21428 pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN);
Jeff Johnson295189b2012-06-20 16:38:30 -070021429
21430 phalConfigSta->assocId = pwdiConfigSta->usAssocId;
21431 phalConfigSta->staType = pwdiConfigSta->wdiSTAType;
21432 phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported;
21433 phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval;
21434 phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled;
21435 phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable;
21436 phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet;
21437 phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode;
21438 phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection;
21439 phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize;
21440 phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity;
21441 phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize;
21442 phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz;
21443 phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz;
21444 phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled;
21445 phalConfigSta->action = pwdiConfigSta->wdiAction;
21446 phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD;
21447 phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen;
21448 phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable;
21449 phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport;
21450 phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio;
21451 phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz;
21452 phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType;
Jeff Johnsone7245742012-09-05 17:12:55 -070021453
Jeff Johnson295189b2012-06-20 16:38:30 -070021454 phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS);
21455
Jeff Johnsone7245742012-09-05 17:12:55 -070021456 phalConfigSta->supportedRates.opRateMode =
Jeff Johnson295189b2012-06-20 16:38:30 -070021457 pwdiConfigSta->wdiSupportedRates.opRateMode;
21458 for(i = 0; i < SIR_NUM_11B_RATES; i ++)
21459 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021460 phalConfigSta->supportedRates.llbRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021461 pwdiConfigSta->wdiSupportedRates.llbRates[i];
21462 }
21463 for(i = 0; i < SIR_NUM_11A_RATES; i ++)
21464 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021465 phalConfigSta->supportedRates.llaRates[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021466 pwdiConfigSta->wdiSupportedRates.llaRates[i];
21467 }
21468 for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++)
21469 {
21470 phalConfigSta->supportedRates.aniLegacyRates[i] =
21471 pwdiConfigSta->wdiSupportedRates.aLegacyRates[i];
21472 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021473 phalConfigSta->supportedRates.aniEnhancedRateBitmap =
Jeff Johnson295189b2012-06-20 16:38:30 -070021474 pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap;
21475 for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++)
21476 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021477 phalConfigSta->supportedRates.supportedMCSSet[i] =
Jeff Johnson295189b2012-06-20 16:38:30 -070021478 pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i];
21479 }
21480 phalConfigSta->supportedRates.rxHighestDataRate =
21481 pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate;
21482
Jeff Johnsone7245742012-09-05 17:12:55 -070021483#ifdef WLAN_FEATURE_11AC
21484 if(phalConfigSta_V1 != NULL)
21485 {
21486 phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap;
21487 phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate;
21488 phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap;
21489 phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate;
21490 }
21491#endif
21492
Jeff Johnson295189b2012-06-20 16:38:30 -070021493#ifdef WLAN_FEATURE_P2P
21494 phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ;
21495#endif
21496
Jeff Johnsone7245742012-09-05 17:12:55 -070021497#ifdef WLAN_FEATURE_11AC
21498 if(phalConfigSta_V1 != NULL)
21499 {
21500 phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta;
21501 phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet;
21502 }
21503#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070021504}/*WDI_CopyWDIStaCtxToHALStaCtx*/;
Jeff Johnsone7245742012-09-05 17:12:55 -070021505
21506/*Translate a Rate set info from WDI into HAL*/
21507WPT_STATIC WPT_INLINE void
Jeff Johnson295189b2012-06-20 16:38:30 -070021508WDI_CopyWDIRateSetToHALRateSet
Jeff Johnsone7245742012-09-05 17:12:55 -070021509(
Jeff Johnson295189b2012-06-20 16:38:30 -070021510 tSirMacRateSet* pHalRateSet,
21511 WDI_RateSet* pwdiRateSet
21512)
21513{
Jeff Johnsone7245742012-09-05 17:12:55 -070021514 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070021515 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21516
21517 pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )?
21518 pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX;
21519
21520 for ( i = 0; i < pHalRateSet->numRates; i++ )
21521 {
21522 pHalRateSet->rate[i] = pwdiRateSet->aRates[i];
21523 }
Jeff Johnsone7245742012-09-05 17:12:55 -070021524
Jeff Johnson295189b2012-06-20 16:38:30 -070021525}/*WDI_CopyWDIRateSetToHALRateSet*/
21526
21527
21528/*Translate an EDCA Parameter Record from WDI into HAL*/
21529WPT_STATIC WPT_INLINE void
21530WDI_CopyWDIEDCAParamsToHALEDCAParams
Jeff Johnsone7245742012-09-05 17:12:55 -070021531(
Jeff Johnson295189b2012-06-20 16:38:30 -070021532 tSirMacEdcaParamRecord* phalEdcaParam,
21533 WDI_EdcaParamRecord* pWDIEdcaParam
21534)
21535{
Jeff Johnsone7245742012-09-05 17:12:55 -070021536 /*Lightweight function - no sanity checks and no unecessary code to increase
Jeff Johnson295189b2012-06-20 16:38:30 -070021537 the chances of getting inlined*/
21538
21539 phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd;
21540 phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci;
21541 phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm;
21542 phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn;
21543
21544 phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max;
21545 phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min;
21546 phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit;
21547}/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/
21548
21549
21550/*Copy a management frame header from WDI fmt into HAL fmt*/
21551WPT_STATIC WPT_INLINE void
21552WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr
21553(
21554 tSirMacMgmtHdr* pmacMgmtHdr,
21555 WDI_MacMgmtHdr* pwdiMacMgmtHdr
21556)
21557{
21558 pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer;
21559 pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type;
21560 pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType;
21561 pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS;
21562 pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS;
21563 pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag;
21564 pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry;
21565 pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt;
21566 pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData;
21567 pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep;
21568 pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order;
21569
21570 pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo;
21571 pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi;
21572
Jeff Johnsone7245742012-09-05 17:12:55 -070021573 wpalMemoryCopy(pmacMgmtHdr->da,
Jeff Johnson295189b2012-06-20 16:38:30 -070021574 pwdiMacMgmtHdr->da, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021575 wpalMemoryCopy(pmacMgmtHdr->sa,
Jeff Johnson295189b2012-06-20 16:38:30 -070021576 pwdiMacMgmtHdr->sa, 6);
Jeff Johnsone7245742012-09-05 17:12:55 -070021577 wpalMemoryCopy(pmacMgmtHdr->bssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070021578 pwdiMacMgmtHdr->bssId, 6);
21579
21580 pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum;
21581 pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo;
21582 pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi;
21583
21584}/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/
21585
21586
21587/*Copy config bss parameters from WDI fmt into HAL fmt*/
21588WPT_STATIC WPT_INLINE void
21589WDI_CopyWDIConfigBSSToHALConfigBSS
21590(
21591 tConfigBssParams* phalConfigBSS,
21592 WDI_ConfigBSSReqInfoType* pwdiConfigBSS
21593)
21594{
21595
21596 wpt_uint8 keyIndex = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070021597#ifdef WLAN_FEATURE_11AC
21598 /* Get the Version 1 Handler */
21599 tConfigBssParams_V1* phalConfigBSS_V1 = NULL;
21600 if (WDI_getFwWlanFeatCaps(DOT11AC))
21601 phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS;
21602#endif
21603
Jeff Johnson295189b2012-06-20 16:38:30 -070021604 wpalMemoryCopy( phalConfigBSS->bssId,
21605 pwdiConfigBSS->macBSSID,
21606 WDI_MAC_ADDR_LEN);
21607
21608#ifdef HAL_SELF_STA_PER_BSS
21609 wpalMemoryCopy( phalConfigBSS->selfMacAddr,
21610 pwdiConfigBSS->macSelfAddr,
21611 WDI_MAC_ADDR_LEN);
21612#endif
21613
21614 phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType);
21615
21616 phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode;
21617 phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType);
21618
Jeff Johnsone7245742012-09-05 17:12:55 -070021619 phalConfigBSS->shortSlotTimeSupported =
Jeff Johnson295189b2012-06-20 16:38:30 -070021620 pwdiConfigBSS->ucShortSlotTimeSupported;
21621 phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist;
21622 phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist;
21623 phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist;
21624 phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist;
21625 phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist;
Jeff Johnsone7245742012-09-05 17:12:55 -070021626 phalConfigBSS->fLsigTXOPProtectionFullSupport =
Jeff Johnson295189b2012-06-20 16:38:30 -070021627 pwdiConfigBSS->ucTXOPProtectionFullSupport;
21628 phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode;
21629 phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval;
21630 phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod;
21631 phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet;
21632 phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel;
21633 phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel;
21634 phalConfigBSS->action = pwdiConfigBSS->wdiAction;
21635 phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable;
21636 phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled;
21637 phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled;
21638
Jeff Johnsone7245742012-09-05 17:12:55 -070021639 phalConfigBSS->htOperMode =
21640 WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod);
Jeff Johnson295189b2012-06-20 16:38:30 -070021641
21642 phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection;
21643 phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit;
21644 phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn;
21645 phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn;
21646
21647#ifdef WLAN_FEATURE_VOWIFI
21648 phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower;
21649#endif
21650
21651 /*! Used 32 as magic number because that is how the ssid is declared inside the
21652 hal header - hal needs a macro for it */
Jeff Johnsone7245742012-09-05 17:12:55 -070021653 phalConfigBSS->ssId.length =
Jeff Johnson295189b2012-06-20 16:38:30 -070021654 (pwdiConfigBSS->wdiSSID.ucLength <= 32)?
21655 pwdiConfigBSS->wdiSSID.ucLength : 32;
21656 wpalMemoryCopy(phalConfigBSS->ssId.ssId,
Jeff Johnsone7245742012-09-05 17:12:55 -070021657 pwdiConfigBSS->wdiSSID.sSSID,
21658 phalConfigBSS->ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070021659
21660 WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext,
21661 &pwdiConfigBSS->wdiSTAContext);
Jeff Johnsone7245742012-09-05 17:12:55 -070021662
Jeff Johnson295189b2012-06-20 16:38:30 -070021663 WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet,
21664 &pwdiConfigBSS->wdiRateSet);
21665
21666 phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid;
21667
21668 if(phalConfigBSS->edcaParamsValid)
21669 {
21670 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe,
21671 &pwdiConfigBSS->wdiBEEDCAParams);
21672 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk,
21673 &pwdiConfigBSS->wdiBKEDCAParams);
21674 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi,
21675 &pwdiConfigBSS->wdiVIEDCAParams);
21676 WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo,
21677 &pwdiConfigBSS->wdiVOEDCAParams);
21678 }
21679
Jeff Johnsone7245742012-09-05 17:12:55 -070021680 phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona;
Jeff Johnson295189b2012-06-20 16:38:30 -070021681
21682 phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn;
21683
21684#ifdef WLAN_FEATURE_VOWIFI_11R
21685
Jeff Johnsone7245742012-09-05 17:12:55 -070021686 phalConfigBSS->extSetStaKeyParamValid =
Jeff Johnson295189b2012-06-20 16:38:30 -070021687 pwdiConfigBSS->bExtSetStaKeyParamValid;
Jeff Johnsone7245742012-09-05 17:12:55 -070021688
Jeff Johnson295189b2012-06-20 16:38:30 -070021689 if( phalConfigBSS->extSetStaKeyParamValid )
21690 {
21691 /*-----------------------------------------------------------------------
21692 Copy the STA Key parameters into the HAL message
21693 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021694 phalConfigBSS->extSetStaKeyParam.encType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021695 WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType);
21696
Jeff Johnsone7245742012-09-05 17:12:55 -070021697 phalConfigBSS->extSetStaKeyParam.wepType =
Jeff Johnson295189b2012-06-20 16:38:30 -070021698 WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType );
21699
21700 phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx;
21701
21702 phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx;
21703
21704 phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc;
21705
21706#ifdef WLAN_SOFTAP_FEATURE
21707 for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ;
21708 keyIndex++)
21709 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021710 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021711 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId;
21712 phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast =
21713 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast;
21714 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection =
21715 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection;
21716 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021717 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].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[keyIndex].paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021720 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021721 phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021722 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength;
21723 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021724 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021725 WDI_MAX_KEY_LENGTH);
21726 }
21727#else
Jeff Johnsone7245742012-09-05 17:12:55 -070021728 phalConfigBSS->extSetStaKeyParam.key.keyId =
Jeff Johnson295189b2012-06-20 16:38:30 -070021729 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId;
21730 phalConfigBSS->extSetStaKeyParam.key.unicast =
21731 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast;
21732 phalConfigBSS->extSetStaKeyParam.key.keyDirection =
21733 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection;
21734 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc,
Jeff Johnsone7245742012-09-05 17:12:55 -070021735 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc,
Jeff Johnson295189b2012-06-20 16:38:30 -070021736 WDI_MAX_KEY_RSC_LEN);
Jeff Johnsone7245742012-09-05 17:12:55 -070021737 phalConfigBSS->extSetStaKeyParam.key.paeRole =
Jeff Johnson295189b2012-06-20 16:38:30 -070021738 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole;
Jeff Johnsone7245742012-09-05 17:12:55 -070021739 phalConfigBSS->extSetStaKeyParam.key.keyLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070021740 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength;
21741 wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key,
Jeff Johnsone7245742012-09-05 17:12:55 -070021742 pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key,
Jeff Johnson295189b2012-06-20 16:38:30 -070021743 WDI_MAX_KEY_LENGTH);
21744#endif
21745 }
21746 else/* phalConfigBSS->extSetStaKeyParamValid is not set */
21747 {
Jeff Johnsone7245742012-09-05 17:12:55 -070021748 wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam,
Jeff Johnson295189b2012-06-20 16:38:30 -070021749 sizeof(phalConfigBSS->extSetStaKeyParam) );
21750 }
21751
21752#endif /*WLAN_FEATURE_VOWIFI_11R*/
21753
Jeff Johnsone7245742012-09-05 17:12:55 -070021754#ifdef WLAN_FEATURE_11AC
21755 if(phalConfigBSS_V1 != NULL)
21756 {
21757 phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta;
21758 phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet;
21759 }
21760#endif
21761
Jeff Johnson295189b2012-06-20 16:38:30 -070021762}/*WDI_CopyWDIConfigBSSToHALConfigBSS*/
21763
21764
Jeff Johnsone7245742012-09-05 17:12:55 -070021765/*Extract the request CB function and user data from a request structure
Jeff Johnson295189b2012-06-20 16:38:30 -070021766 pointed to by user data */
21767WPT_STATIC WPT_INLINE void
21768WDI_ExtractRequestCBFromEvent
21769(
21770 WDI_EventInfoType* pEvent,
Jeff Johnsone7245742012-09-05 17:12:55 -070021771 WDI_ReqStatusCb* ppfnReqCB,
Jeff Johnson295189b2012-06-20 16:38:30 -070021772 void** ppUserData
21773)
21774{
21775 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21776 switch ( pEvent->wdiRequest )
21777 {
21778 case WDI_START_REQ:
21779 *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21780 *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData;
21781 break;
21782 case WDI_STOP_REQ:
21783 *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21784 *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData;
21785 break;
21786 case WDI_INIT_SCAN_REQ:
21787 *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21788 *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData;
21789 break;
21790 case WDI_START_SCAN_REQ:
21791 *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21792 *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData;
21793 break;
21794 case WDI_END_SCAN_REQ:
21795 *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21796 *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData;
21797 break;
21798 case WDI_FINISH_SCAN_REQ:
21799 *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21800 *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData;
21801 break;
21802 case WDI_JOIN_REQ:
21803 *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21804 *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData;
21805 break;
21806 case WDI_CONFIG_BSS_REQ:
21807 *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21808 *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData;
21809 break;
21810 case WDI_DEL_BSS_REQ:
21811 *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21812 *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData;
21813 break;
21814 case WDI_POST_ASSOC_REQ:
21815 *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21816 *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData;
21817 break;
21818 case WDI_DEL_STA_REQ:
21819 *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21820 *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData;
21821 break;
21822 case WDI_DEL_STA_SELF_REQ:
21823 *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21824 *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData;
21825 break;
21826
21827 case WDI_SET_BSS_KEY_REQ:
21828 *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21829 *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21830 break;
21831 case WDI_RMV_BSS_KEY_REQ:
21832 *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21833 *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData;
21834 break;
21835 case WDI_SET_STA_KEY_REQ:
21836 *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21837 *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21838 break;
21839 case WDI_RMV_STA_KEY_REQ:
21840 *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21841 *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData;
21842 break;
21843 case WDI_ADD_TS_REQ:
21844 *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21845 *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData;
21846 break;
21847 case WDI_DEL_TS_REQ:
21848 *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21849 *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData;
21850 break;
21851 case WDI_UPD_EDCA_PRMS_REQ:
21852 *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21853 *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData;
21854 break;
21855 case WDI_ADD_BA_SESSION_REQ:
21856 *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21857 *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData;
21858 break;
21859 case WDI_DEL_BA_REQ:
21860 *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21861 *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData;
21862 break;
21863#ifdef FEATURE_WLAN_CCX
21864 case WDI_TSM_STATS_REQ:
21865 *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21866 *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData;
21867 break;
21868#endif
21869 case WDI_CH_SWITCH_REQ:
21870 *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21871 *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData;
21872 break;
21873 case WDI_CONFIG_STA_REQ:
21874 *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21875 *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData;
21876 break;
21877 case WDI_SET_LINK_ST_REQ:
21878 *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21879 *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData;
21880 break;
21881 case WDI_GET_STATS_REQ:
21882 *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21883 *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData;
21884 break;
21885 case WDI_UPDATE_CFG_REQ:
21886 *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21887 *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData;
21888 break;
21889 case WDI_ADD_BA_REQ:
21890 *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21891 *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData;
21892 break;
21893 case WDI_TRIGGER_BA_REQ:
21894 *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21895 *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData;
21896 break;
21897 case WDI_UPD_BCON_PRMS_REQ:
21898 *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21899 *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData;
21900 break;
21901 case WDI_SND_BCON_REQ:
21902 *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21903 *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData;
21904 break;
21905 case WDI_ENTER_BMPS_REQ:
21906 *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21907 *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21908 break;
21909 case WDI_EXIT_BMPS_REQ:
21910 *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21911 *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData;
21912 break;
21913 case WDI_ENTER_UAPSD_REQ:
21914 *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21915 *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21916 break;
21917 case WDI_UPDATE_UAPSD_PARAM_REQ:
21918 *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21919 *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData;
21920 break;
21921 case WDI_CONFIGURE_RXP_FILTER_REQ:
21922 *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21923 *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData;
21924 break;
21925 case WDI_SET_BEACON_FILTER_REQ:
21926 *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21927 *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
21928 break;
21929 case WDI_REM_BEACON_FILTER_REQ:
21930 *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21931 *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData;
Jeff Johnsone7245742012-09-05 17:12:55 -070021932 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021933 case WDI_SET_RSSI_THRESHOLDS_REQ:
21934 *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21935 *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData;
21936 break;
21937 case WDI_HOST_OFFLOAD_REQ:
21938 *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21939 *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData;
21940 break;
21941 case WDI_WOWL_ADD_BC_PTRN_REQ:
21942 *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21943 *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21944 break;
21945 case WDI_WOWL_DEL_BC_PTRN_REQ:
21946 *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21947 *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData;
21948 break;
21949 case WDI_WOWL_ENTER_REQ:
21950 *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21951 *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData;
21952 break;
21953 case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ:
21954 *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21955 *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData;
21956 break;
21957 case WDI_FLUSH_AC_REQ:
21958 *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21959 *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData;
21960 break;
21961 case WDI_BTAMP_EVENT_REQ:
21962 *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21963 *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData;
21964 break;
21965 case WDI_KEEP_ALIVE_REQ:
21966 *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21967 *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData;
21968 break;
21969 case WDI_SET_TX_PER_TRACKING_REQ:
21970 *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB;
21971 *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData;
21972 default:
21973 *ppfnReqCB = NULL;
21974 *ppUserData = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070021975 break;
Jeff Johnson295189b2012-06-20 16:38:30 -070021976 }
21977}/*WDI_ExtractRequestCBFromEvent*/
21978
21979
21980/**
Jeff Johnsone7245742012-09-05 17:12:55 -070021981 @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW
Jeff Johnson295189b2012-06-20 16:38:30 -070021982 frame xtl is enabled for a particular STA.
21983
21984 WDI_PostAssocReq must have been called.
21985
Jeff Johnsone7245742012-09-05 17:12:55 -070021986 @param uSTAIdx: STA index
21987
Jeff Johnson295189b2012-06-20 16:38:30 -070021988 @see WDI_PostAssocReq
21989 @return Result of the function call
21990*/
Jeff Johnsone7245742012-09-05 17:12:55 -070021991wpt_boolean
Jeff Johnson295189b2012-06-20 16:38:30 -070021992WDI_IsHwFrameTxTranslationCapable
21993(
21994 wpt_uint8 uSTAIdx
21995)
21996{
Jeff Johnsone7245742012-09-05 17:12:55 -070021997 /*!! FIX ME - this must eventually be per station - for now just feedback
Jeff Johnson295189b2012-06-20 16:38:30 -070021998 uma value*/
21999 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022000 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022001 ------------------------------------------------------------------------*/
22002 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22003 {
22004 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22005 "WDI API call before module is initialized - Fail request");
22006
Jeff Johnsone7245742012-09-05 17:12:55 -070022007 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022008 }
22009
Jeff Johnsone7245742012-09-05 17:12:55 -070022010
Jeff Johnson295189b2012-06-20 16:38:30 -070022011 return gWDICb.bFrameTransEnabled;
22012}/*WDI_IsHwFrameTxTranslationCapable*/
22013
22014#ifdef FEATURE_WLAN_SCAN_PNO
22015/**
22016 @brief WDI_SetPreferredNetworkList
22017
Jeff Johnsone7245742012-09-05 17:12:55 -070022018 @param pwdiPNOScanReqParams: the Set PNO as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070022019 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070022020
Jeff Johnson295189b2012-06-20 16:38:30 -070022021 wdiPNOScanCb: callback for passing back the response
22022 of the Set PNO operation received from the
22023 device
Jeff Johnsone7245742012-09-05 17:12:55 -070022024
Jeff Johnson295189b2012-06-20 16:38:30 -070022025 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070022026 callback
22027
Jeff Johnson295189b2012-06-20 16:38:30 -070022028 @return Result of the function call
22029*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022030WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022031WDI_SetPreferredNetworkReq
22032(
22033 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22034 WDI_PNOScanCb wdiPNOScanCb,
22035 void* pUserData
22036)
22037{
22038 WDI_EventInfoType wdiEventData = {{0}};
22039 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22040
22041 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022042 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022043 ------------------------------------------------------------------------*/
22044 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22045 {
22046 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22047 "WDI API call before module is initialized - Fail request");
22048
Jeff Johnsone7245742012-09-05 17:12:55 -070022049 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022050 }
22051
22052 /*------------------------------------------------------------------------
22053 Fill in Event data and post to the Main FSM
22054 ------------------------------------------------------------------------*/
22055 wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022056 wdiEventData.pEventData = pwdiPNOScanReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022057 wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070022058 wdiEventData.pCBfnc = wdiPNOScanCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070022059 wdiEventData.pUserData = pUserData;
22060
22061 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22062}
22063
22064
22065/**
22066 @brief WDI_SetRssiFilterReq
22067
Jeff Johnsone7245742012-09-05 17:12:55 -070022068 @param pwdiRssiFilterReqParams: the Set RSSI Filter as
Jeff Johnson295189b2012-06-20 16:38:30 -070022069 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070022070
Jeff Johnson295189b2012-06-20 16:38:30 -070022071 wdiRssiFilterCb: callback for passing back the response
22072 of the Set RSSI Filter operation received from the
22073 device
Jeff Johnsone7245742012-09-05 17:12:55 -070022074
Jeff Johnson295189b2012-06-20 16:38:30 -070022075 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070022076 callback
22077
Jeff Johnson295189b2012-06-20 16:38:30 -070022078 @return Result of the function call
22079*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022080WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022081WDI_SetRssiFilterReq
22082(
22083 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams,
22084 WDI_RssiFilterCb wdiRssiFilterCb,
22085 void* pUserData
22086)
22087{
22088 WDI_EventInfoType wdiEventData = {{0}};
22089 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22090
22091 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022092 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022093 ------------------------------------------------------------------------*/
22094 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22095 {
22096 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22097 "WDI API call before module is initialized - Fail request");
22098
Jeff Johnsone7245742012-09-05 17:12:55 -070022099 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022100 }
22101
22102 /*------------------------------------------------------------------------
22103 Fill in Event data and post to the Main FSM
22104 ------------------------------------------------------------------------*/
22105 wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022106 wdiEventData.pEventData = pwdiRssiFilterReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022107 wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070022108 wdiEventData.pCBfnc = wdiRssiFilterCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070022109 wdiEventData.pUserData = pUserData;
22110
22111 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22112}/*WDI_SetRssiFilterReq*/
22113
22114/**
22115 @brief WDI_UpdateScanParamsReq
22116
Jeff Johnsone7245742012-09-05 17:12:55 -070022117 @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified
Jeff Johnson295189b2012-06-20 16:38:30 -070022118 by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070022119
Jeff Johnson295189b2012-06-20 16:38:30 -070022120 wdiUpdateScanParamsCb: callback for passing back the response
22121 of the Set PNO operation received from the
22122 device
Jeff Johnsone7245742012-09-05 17:12:55 -070022123
Jeff Johnson295189b2012-06-20 16:38:30 -070022124 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070022125 callback
22126
Jeff Johnson295189b2012-06-20 16:38:30 -070022127 @return Result of the function call
22128*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022129WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022130WDI_UpdateScanParamsReq
22131(
22132 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType,
22133 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb,
22134 void* pUserData
22135)
22136{
22137 WDI_EventInfoType wdiEventData = {{0}};
22138 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22139
22140 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022141 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022142 ------------------------------------------------------------------------*/
22143 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22144 {
22145 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22146 "WDI API call before module is initialized - Fail request");
22147
Jeff Johnsone7245742012-09-05 17:12:55 -070022148 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022149 }
22150
22151 /*------------------------------------------------------------------------
22152 Fill in Event data and post to the Main FSM
22153 ------------------------------------------------------------------------*/
22154 wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022155 wdiEventData.pEventData = pwdiUpdateScanParamsInfoType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022156 wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType);
Jeff Johnsone7245742012-09-05 17:12:55 -070022157 wdiEventData.pCBfnc = wdiUpdateScanParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070022158 wdiEventData.pUserData = pUserData;
22159
22160 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22161}
22162
22163/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022164 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022165 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022166
22167 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022168 pwdiPNOScanReqParams: pointer to the info received
22169 from upper layers
22170 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022171 and its size
22172
Jeff Johnson295189b2012-06-20 16:38:30 -070022173 @return Result of the function call
22174*/
22175
22176WDI_Status
22177WDI_PackPreferredNetworkList
22178(
22179 WDI_ControlBlockType* pWDICtx,
22180 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22181 wpt_uint8** ppSendBuffer,
22182 wpt_uint16* pSize
22183)
22184{
Jeff Johnsone7245742012-09-05 17:12:55 -070022185 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022186 wpt_uint16 usDataOffset = 0;
22187 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022188 tpPrefNetwListParams pPrefNetwListParams = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022189 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070022190 /*-----------------------------------------------------------------------
22191 Get message buffer
22192 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022193 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022194 sizeof(tPrefNetwListParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070022195 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022196 ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParams) )))
Jeff Johnson295189b2012-06-20 16:38:30 -070022197 {
22198 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22199 "Unable to get send buffer in Set PNO req %x ",
22200 pwdiPNOScanReqParams);
22201 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022202 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022203 }
22204
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022205 pPrefNetwListParams = (tpPrefNetwListParams)(pSendBuffer + usDataOffset);
22206
Jeff Johnson295189b2012-06-20 16:38:30 -070022207 /*-------------------------------------------------------------------------
22208 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22209 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022210 pPrefNetwListParams->enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022211 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022212 pPrefNetwListParams->modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022213 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22214
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022215 pPrefNetwListParams->ucNetworksCount =
Jeff Johnsone7245742012-09-05 17:12:55 -070022216 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022217 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022218 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022219 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22220
22221 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022222 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022223 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22224 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22225 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22226
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022227 for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ )
Jeff Johnson295189b2012-06-20 16:38:30 -070022228 {
22229 /*SSID of the BSS*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022230 pPrefNetwListParams->aNetworks[i].ssId.length
Jeff Johnson295189b2012-06-20 16:38:30 -070022231 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22232
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022233 wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022234 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022235 pPrefNetwListParams->aNetworks[i].ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070022236
22237 /*Authentication type for the network*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022238 pPrefNetwListParams->aNetworks[i].authentication =
Jeff Johnsone7245742012-09-05 17:12:55 -070022239 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022240
22241 /*Encryption type for the network*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022242 pPrefNetwListParams->aNetworks[i].encryption =
Jeff Johnsone7245742012-09-05 17:12:55 -070022243 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022244
Jeff Johnsone7245742012-09-05 17:12:55 -070022245 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022246 0 - if all channels */
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022247 pPrefNetwListParams->aNetworks[i].ucChannelCount =
Madan Mohan Koyyalamudia208d102012-10-15 15:18:18 -070022248 (pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount <
22249 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22250 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount :
22251 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022252
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022253 wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022254 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022255 pPrefNetwListParams->aNetworks[i].ucChannelCount);
Jeff Johnson295189b2012-06-20 16:38:30 -070022256
22257 /*Indicates the RSSI threshold for the network to be considered*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022258 pPrefNetwListParams->aNetworks[i].rssiThreshold =
Jeff Johnson295189b2012-06-20 16:38:30 -070022259 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22260
22261 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022262 "WDI SET PNO: SSID %d %s",
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022263 pPrefNetwListParams->aNetworks[i].ssId.length,
22264 pPrefNetwListParams->aNetworks[i].ssId.ssId);
Jeff Johnson295189b2012-06-20 16:38:30 -070022265 }
22266
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022267 pPrefNetwListParams->scanTimers.ucScanTimersCount =
Jeff Johnsone7245742012-09-05 17:12:55 -070022268 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022269 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22270 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22271 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22272
22273 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
Jeff Johnsone7245742012-09-05 17:12:55 -070022274 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022275 pPrefNetwListParams->scanTimers.ucScanTimersCount,
Jeff Johnson295189b2012-06-20 16:38:30 -070022276 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22277 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22278
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022279 for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ )
Jeff Johnson295189b2012-06-20 16:38:30 -070022280 {
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022281 pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022282 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022283 pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022284 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22285 }
22286
22287 /*Copy the probe template*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022288 pPrefNetwListParams->us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022289 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22290 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22291 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022292 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022293
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022294 wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070022295 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022296 pPrefNetwListParams->us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022297
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022298 pPrefNetwListParams->us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022299 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22300 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22301 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022302 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022303
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022304 wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070022305 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022306 pPrefNetwListParams->us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022307
22308 /*Set the output values*/
22309 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022310 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022311
22312 return WDI_STATUS_SUCCESS;
22313}/*WDI_PackPreferredNetworkList*/
22314
22315/**
Jeff Johnsone7245742012-09-05 17:12:55 -070022316 @brief Helper function to pack Set Preferred Network List
Jeff Johnson295189b2012-06-20 16:38:30 -070022317 Request parameters
Jeff Johnsone7245742012-09-05 17:12:55 -070022318
22319 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnson295189b2012-06-20 16:38:30 -070022320 pwdiPNOScanReqParams: pointer to the info received
22321 from upper layers
22322 ppSendBuffer, pSize - out pointers of the packed buffer
Jeff Johnsone7245742012-09-05 17:12:55 -070022323 and its size
22324
Jeff Johnson295189b2012-06-20 16:38:30 -070022325 @return Result of the function call
22326*/
22327
22328WDI_Status
22329WDI_PackPreferredNetworkListNew
22330(
22331 WDI_ControlBlockType* pWDICtx,
22332 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams,
22333 wpt_uint8** ppSendBuffer,
22334 wpt_uint16* pSize
22335)
22336{
Jeff Johnsone7245742012-09-05 17:12:55 -070022337 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022338 wpt_uint16 usDataOffset = 0;
22339 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022340 tpPrefNetwListParamsNew pPrefNetwListParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022341 wpt_uint8 i;
Jeff Johnson295189b2012-06-20 16:38:30 -070022342
22343 /*-----------------------------------------------------------------------
22344 Get message buffer
22345 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022346 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022347 sizeof(tPrefNetwListParamsNew),
Jeff Johnson295189b2012-06-20 16:38:30 -070022348 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022349 ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParamsNew) )))
Jeff Johnson295189b2012-06-20 16:38:30 -070022350 {
22351 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22352 "Unable to get send buffer in Set PNO req %x ",
22353 pwdiPNOScanReqParams);
22354 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022355 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022356 }
22357
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022358 pPrefNetwListParams = (tpPrefNetwListParamsNew)(pSendBuffer + usDataOffset);
22359
Jeff Johnson295189b2012-06-20 16:38:30 -070022360 /*-------------------------------------------------------------------------
22361 Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo
22362 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022363 pPrefNetwListParams->enable =
Jeff Johnson295189b2012-06-20 16:38:30 -070022364 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022365 pPrefNetwListParams->modePNO =
Jeff Johnson295189b2012-06-20 16:38:30 -070022366 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO;
22367
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022368 pPrefNetwListParams->ucNetworksCount =
Jeff Johnsone7245742012-09-05 17:12:55 -070022369 (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022370 WLAN_HAL_PNO_MAX_SUPP_NETWORKS)?
Jeff Johnsone7245742012-09-05 17:12:55 -070022371 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount :
Jeff Johnson295189b2012-06-20 16:38:30 -070022372 WLAN_HAL_PNO_MAX_SUPP_NETWORKS;
22373
22374 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022375 "WDI SET PNO: Enable %d, Mode %d, Netw Count %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022376 pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable,
22377 pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO,
22378 pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount);
22379
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022380 for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ )
Jeff Johnson295189b2012-06-20 16:38:30 -070022381 {
22382 /*SSID of the BSS*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022383 pPrefNetwListParams->aNetworks[i].ssId.length
Jeff Johnson295189b2012-06-20 16:38:30 -070022384 = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength;
22385
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022386 wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022387 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022388 pPrefNetwListParams->aNetworks[i].ssId.length);
Jeff Johnson295189b2012-06-20 16:38:30 -070022389
22390 /*Authentication type for the network*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022391 pPrefNetwListParams->aNetworks[i].authentication =
Jeff Johnsone7245742012-09-05 17:12:55 -070022392 (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth;
Jeff Johnson295189b2012-06-20 16:38:30 -070022393
22394 /*Encryption type for the network*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022395 pPrefNetwListParams->aNetworks[i].encryption =
Jeff Johnsone7245742012-09-05 17:12:55 -070022396 (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption;
Jeff Johnson295189b2012-06-20 16:38:30 -070022397
22398 /*SSID bcast type for the network*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022399 pPrefNetwListParams->aNetworks[i].bcastNetworkType =
Jeff Johnsone7245742012-09-05 17:12:55 -070022400 (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType;
Jeff Johnson295189b2012-06-20 16:38:30 -070022401
Jeff Johnsone7245742012-09-05 17:12:55 -070022402 /*Indicate the channel on which the Network can be found
Jeff Johnson295189b2012-06-20 16:38:30 -070022403 0 - if all channels */
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022404 pPrefNetwListParams->aNetworks[i].ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022405 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount;
22406
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022407 wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022408 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022409 pPrefNetwListParams->aNetworks[i].ucChannelCount);
Jeff Johnson295189b2012-06-20 16:38:30 -070022410
22411 /*Indicates the RSSI threshold for the network to be considered*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022412 pPrefNetwListParams->aNetworks[i].rssiThreshold =
Jeff Johnson295189b2012-06-20 16:38:30 -070022413 pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold;
22414
22415 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022416 "WDI SET PNO: SSID %d %s",
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022417 pPrefNetwListParams->aNetworks[i].ssId.length,
22418 pPrefNetwListParams->aNetworks[i].ssId.ssId);
Jeff Johnson295189b2012-06-20 16:38:30 -070022419 }
22420
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022421 pPrefNetwListParams->scanTimers.ucScanTimersCount =
Jeff Johnsone7245742012-09-05 17:12:55 -070022422 (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount <
Jeff Johnson295189b2012-06-20 16:38:30 -070022423 WLAN_HAL_PNO_MAX_SCAN_TIMERS)?
22424 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount :
22425 WLAN_HAL_PNO_MAX_SCAN_TIMERS;
22426
22427 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022428 "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d",
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022429 pPrefNetwListParams->scanTimers.ucScanTimersCount,
Jeff Johnson295189b2012-06-20 16:38:30 -070022430 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize,
22431 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize);
22432
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022433 for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ )
Jeff Johnson295189b2012-06-20 16:38:30 -070022434 {
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022435 pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue =
Jeff Johnson295189b2012-06-20 16:38:30 -070022436 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022437 pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat =
Jeff Johnson295189b2012-06-20 16:38:30 -070022438 pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat;
22439 }
22440
22441 /*Copy the probe template*/
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022442 pPrefNetwListParams->us24GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022443 (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize<
22444 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22445 pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022446 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022447
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022448 wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070022449 pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022450 pPrefNetwListParams->us24GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022451
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022452 pPrefNetwListParams->us5GProbeSize =
Jeff Johnson295189b2012-06-20 16:38:30 -070022453 (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize <
22454 WLAN_HAL_PNO_MAX_PROBE_SIZE)?
22455 pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize:
Jeff Johnsone7245742012-09-05 17:12:55 -070022456 WLAN_HAL_PNO_MAX_PROBE_SIZE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022457
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022458 wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate,
Jeff Johnsone7245742012-09-05 17:12:55 -070022459 pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070022460 pPrefNetwListParams->us5GProbeSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070022461
Jeff Johnson295189b2012-06-20 16:38:30 -070022462
22463 /*Set the output values*/
22464 *ppSendBuffer = pSendBuffer;
Jeff Johnsone7245742012-09-05 17:12:55 -070022465 *pSize = usSendSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070022466
22467 return WDI_STATUS_SUCCESS;
22468}/*WDI_PackPreferredNetworkListNew*/
22469
22470/**
22471 @brief Process Set Preferred Network List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022472
22473 @param pWDICtx: pointer to the WLAN DAL context
22474 pEventData: pointer to the event information structure
22475
Jeff Johnson295189b2012-06-20 16:38:30 -070022476 @return Result of the function call
22477*/
22478WDI_Status
22479WDI_ProcessSetPreferredNetworkReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022480(
Jeff Johnson295189b2012-06-20 16:38:30 -070022481 WDI_ControlBlockType* pWDICtx,
22482 WDI_EventInfoType* pEventData
22483)
22484{
22485 WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL;
22486 WDI_PNOScanCb wdiPNOScanCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022487 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022488 wpt_uint16 usSendSize = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070022489 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022490
22491 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022492 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022493 -------------------------------------------------------------------------*/
22494 if (( NULL == pEventData ) ||
22495 ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) ||
22496 ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc)))
22497 {
22498 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22499 "%s: Invalid parameters", __FUNCTION__);
22500 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022501 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022502 }
22503
22504 /*-------------------------------------------------------------------------
22505 Pack the PNO request structure based on version
22506 -------------------------------------------------------------------------*/
22507 if ( pWDICtx->wdiPNOVersion > 0 )
22508 {
22509 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022510 "%s: PNO new version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022511 pWDICtx->wdiPNOVersion);
22512
22513 wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams,
22514 &pSendBuffer, &usSendSize);
22515 }
22516 else
22517 {
22518 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022519 "%s: PNO old version %d ", __FUNCTION__,
Jeff Johnson295189b2012-06-20 16:38:30 -070022520 pWDICtx->wdiPNOVersion);
22521
22522 wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams,
22523 &pSendBuffer, &usSendSize);
22524 }
22525
22526 if (( WDI_STATUS_SUCCESS != wdiStatus )||
22527 ( NULL == pSendBuffer )||( 0 == usSendSize ))
22528 {
22529 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22530 "%s: failed to pack request parameters", __FUNCTION__);
22531 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022532 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022533 }
22534
22535 pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022536 pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022537
22538 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022539 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022540 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022541 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22542 wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022543}
22544
22545/**
22546 @brief Process Set RSSI Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070022547
22548 @param pWDICtx: pointer to the WLAN DAL context
22549 pEventData: pointer to the event information structure
22550
Jeff Johnson295189b2012-06-20 16:38:30 -070022551 @see
22552 @return Result of the function call
22553*/
22554WDI_Status
22555WDI_ProcessSetRssiFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022556(
Jeff Johnson295189b2012-06-20 16:38:30 -070022557 WDI_ControlBlockType* pWDICtx,
22558 WDI_EventInfoType* pEventData
22559)
22560{
22561 WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL;
22562 WDI_RssiFilterCb wdiRssiFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022563 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022564 wpt_uint16 usDataOffset = 0;
22565 wpt_uint16 usSendSize = 0;
22566 wpt_uint8 ucRssiThreshold;
22567
22568 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022569 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022570 -------------------------------------------------------------------------*/
22571 if (( NULL == pEventData ) ||
22572 ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) ||
22573 ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc)))
22574 {
22575 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22576 "%s: Invalid parameters", __FUNCTION__);
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 /*-----------------------------------------------------------------------
22582 Get message buffer
22583 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022584 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022585 sizeof(ucRssiThreshold),
22586 &pSendBuffer, &usDataOffset, &usSendSize))||
22587 ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) )))
22588 {
22589 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22590 "Unable to get send buffer in Set PNO req %x %x %x",
22591 pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb);
22592 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022593 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022594 }
22595
22596 ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold;
22597
Jeff Johnsone7245742012-09-05 17:12:55 -070022598 wpalMemoryCopy( pSendBuffer+usDataOffset,
22599 &ucRssiThreshold,
22600 sizeof(ucRssiThreshold));
Jeff Johnson295189b2012-06-20 16:38:30 -070022601
22602 pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022603 pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022604
22605 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022606 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022607 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022608 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22609 wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022610}
22611
22612
22613/**
22614 @brief Process Update Scan Params function
Jeff Johnsone7245742012-09-05 17:12:55 -070022615
22616 @param pWDICtx: pointer to the WLAN DAL context
22617 pEventData: pointer to the event information structure
22618
Jeff Johnson295189b2012-06-20 16:38:30 -070022619 @see
22620 @return Result of the function call
22621*/
22622WDI_Status
22623WDI_ProcessUpdateScanParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070022624(
Jeff Johnson295189b2012-06-20 16:38:30 -070022625 WDI_ControlBlockType* pWDICtx,
22626 WDI_EventInfoType* pEventData
22627)
22628{
22629 WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL;
22630 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022631 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070022632 wpt_uint16 usDataOffset = 0;
22633 wpt_uint16 usSendSize = 0;
22634 tUpdateScanParams updateScanParams = {0};
22635
22636
22637 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022638 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022639 -------------------------------------------------------------------------*/
22640 if (( NULL == pEventData ) ||
22641 ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) ||
22642 ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc)))
22643 {
22644 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22645 "%s: Invalid parameters", __FUNCTION__);
22646 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022647 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022648 }
22649
22650 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22651 "Begin WDI Update Scan Parameters");
22652 /*-----------------------------------------------------------------------
22653 Get message buffer
22654 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022655 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070022656 sizeof(updateScanParams),
22657 &pSendBuffer, &usDataOffset, &usSendSize))||
22658 ( usSendSize < (usDataOffset + sizeof(updateScanParams) )))
22659 {
22660 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22661 "Unable to get send buffer in Update Scan Params req %x %x %x",
22662 pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb);
22663 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022664 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022665 }
22666
22667 //
22668 // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo
22669 //
22670
22671 updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled;
22672 updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved;
Jeff Johnsone7245742012-09-05 17:12:55 -070022673 updateScanParams.ucChannelCount =
Jeff Johnson295189b2012-06-20 16:38:30 -070022674 (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount <
22675 WLAN_HAL_PNO_MAX_NETW_CHANNELS)?
22676 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount :
22677 WLAN_HAL_PNO_MAX_NETW_CHANNELS;
22678
Jeff Johnsone7245742012-09-05 17:12:55 -070022679 wpalMemoryCopy( updateScanParams.aChannels,
Jeff Johnson295189b2012-06-20 16:38:30 -070022680 pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels,
22681 updateScanParams.ucChannelCount);
22682
22683 updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime;
22684 updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime;
22685 updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime;
22686 updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime;
22687 updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState;
22688
Jeff Johnsone7245742012-09-05 17:12:55 -070022689 wpalMemoryCopy( pSendBuffer+usDataOffset,
22690 &updateScanParams,
22691 sizeof(updateScanParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070022692
22693 pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070022694 pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070022695
22696 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22697 "End Update Scan Parameters");
22698 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022699 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070022700 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022701 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
22702 wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070022703}
22704
22705/**
22706 @brief Process Preferred Network Found Indication function
Jeff Johnsone7245742012-09-05 17:12:55 -070022707
22708 @param pWDICtx: pointer to the WLAN DAL context
22709 pEventData: pointer to the event information structure
22710
Jeff Johnson295189b2012-06-20 16:38:30 -070022711 @see
22712 @return Result of the function call
22713*/
22714WDI_Status
22715WDI_ProcessPrefNetworkFoundInd
Jeff Johnsone7245742012-09-05 17:12:55 -070022716(
Jeff Johnson295189b2012-06-20 16:38:30 -070022717 WDI_ControlBlockType* pWDICtx,
22718 WDI_EventInfoType* pEventData
22719)
22720{
22721 WDI_LowLevelIndType wdiInd;
22722 tPrefNetwFoundInd prefNetwFoundInd = {{0}};
22723
22724
22725 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022726 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022727 -------------------------------------------------------------------------*/
22728 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22729 ( NULL == pEventData->pEventData ))
22730 {
22731 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22732 "%s: Invalid parameters", __FUNCTION__);
22733 WDI_ASSERT( 0 );
Jeff Johnsone7245742012-09-05 17:12:55 -070022734 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022735 }
22736
22737 /*-------------------------------------------------------------------------
22738 Extract indication and send it to UMAC
22739 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022740 wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams,
22741 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022742 sizeof(tPrefNetwFoundParams));
22743
22744 /*Fill in the indication parameters*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022745 wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND;
Jeff Johnson295189b2012-06-20 16:38:30 -070022746
22747 wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32);
22748
Jeff Johnsone7245742012-09-05 17:12:55 -070022749 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength =
Jeff Johnson295189b2012-06-20 16:38:30 -070022750 (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )?
Jeff Johnsone7245742012-09-05 17:12:55 -070022751 prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31;
Jeff Johnson295189b2012-06-20 16:38:30 -070022752
Jeff Johnsone7245742012-09-05 17:12:55 -070022753 wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22754 prefNetwFoundInd.prefNetwFoundParams.ssId.ssId,
Jeff Johnson295189b2012-06-20 16:38:30 -070022755 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength);
22756
22757 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi =
22758 prefNetwFoundInd.prefNetwFoundParams.rssi;
22759
22760 // DEBUG
22761 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
22762 "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)",
22763 wdiInd.wdiIndicationType,
22764 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,
22765 wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi );
22766
22767 /*Notify UMAC*/
22768 pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData );
Jeff Johnsone7245742012-09-05 17:12:55 -070022769
22770 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022771}
22772
22773/**
22774 @brief Process PNO Rsp function (called when a
22775 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022776
22777 @param pWDICtx: pointer to the WLAN DAL context
22778 pEventData: pointer to the event information structure
22779
Jeff Johnson295189b2012-06-20 16:38:30 -070022780 @see
22781 @return Result of the function call
22782*/
22783WDI_Status
22784WDI_ProcessSetPreferredNetworkRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022785(
Jeff Johnson295189b2012-06-20 16:38:30 -070022786 WDI_ControlBlockType* pWDICtx,
22787 WDI_EventInfoType* pEventData
22788)
22789{
22790 WDI_Status wdiStatus;
22791 eHalStatus halStatus;
22792 WDI_PNOScanCb wdiPNOScanCb = NULL;
22793 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22794
22795 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022796 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022797 -------------------------------------------------------------------------*/
22798 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22799 ( NULL == pEventData->pEventData ))
22800 {
22801 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22802 "%s: Invalid parameters", __FUNCTION__);
22803 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022804 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022805 }
22806
22807
Jeff Johnsone7245742012-09-05 17:12:55 -070022808 wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022809
22810 /*-------------------------------------------------------------------------
22811 Extract response and send it to UMAC
22812 -------------------------------------------------------------------------*/
22813 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022814 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022815
22816 /*Notify UMAC*/
22817 wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData);
22818
Jeff Johnsone7245742012-09-05 17:12:55 -070022819 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022820}/*WDI_ProcessSetPreferredNetworkRsp*/
22821
22822/**
22823 @brief Process RSSI Filter Rsp function (called when a
22824 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022825
22826 @param pWDICtx: pointer to the WLAN DAL context
22827 pEventData: pointer to the event information structure
22828
Jeff Johnson295189b2012-06-20 16:38:30 -070022829 @see
22830 @return Result of the function call
22831*/
22832WDI_Status
22833WDI_ProcessSetRssiFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022834(
Jeff Johnson295189b2012-06-20 16:38:30 -070022835 WDI_ControlBlockType* pWDICtx,
22836 WDI_EventInfoType* pEventData
22837)
22838{
22839 WDI_Status wdiStatus;
22840 eHalStatus halStatus;
22841 WDI_RssiFilterCb wdiRssiFilterCb;
22842 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22843
22844 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022845 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022846 -------------------------------------------------------------------------*/
22847 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22848 ( NULL == pEventData->pEventData ))
22849 {
22850 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22851 "%s: Invalid parameters", __FUNCTION__);
22852 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022853 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022854 }
22855
Jeff Johnsone7245742012-09-05 17:12:55 -070022856 wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022857
22858 /*-------------------------------------------------------------------------
22859 Extract response and send it to UMAC
22860 -------------------------------------------------------------------------*/
22861 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070022862 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022863
22864 /*Notify UMAC*/
22865 wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
22866
Jeff Johnsone7245742012-09-05 17:12:55 -070022867 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022868}/*WDI_ProcessSetRssiFilterRsp*/
22869
22870/**
22871 @brief Process Update Scan Params Rsp function (called when a
22872 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070022873
22874 @param pWDICtx: pointer to the WLAN DAL context
22875 pEventData: pointer to the event information structure
22876
Jeff Johnson295189b2012-06-20 16:38:30 -070022877 @see
22878 @return Result of the function call
22879*/
22880WDI_Status
22881WDI_ProcessUpdateScanParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070022882(
Jeff Johnson295189b2012-06-20 16:38:30 -070022883 WDI_ControlBlockType* pWDICtx,
22884 WDI_EventInfoType* pEventData
22885)
22886{
22887 WDI_Status wdiStatus;
Jeff Johnsone7245742012-09-05 17:12:55 -070022888 tUpdateScanParamsResp halUpdScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070022889 WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070022890 wpt_uint32 uStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070022891 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22892
22893 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022894 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070022895 -------------------------------------------------------------------------*/
22896 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
22897 ( NULL == pEventData->pEventData ))
22898 {
22899 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
22900 "%s: Invalid parameters", __FUNCTION__);
22901 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070022902 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070022903 }
22904
22905 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22906 "Process UPD scan params ptr : %x", __FUNCTION__);
22907
Jeff Johnsone7245742012-09-05 17:12:55 -070022908 wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070022909
22910 /*-------------------------------------------------------------------------
22911 Extract response and send it to UMAC
22912 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022913 wpalMemoryCopy( (void *)&halUpdScanParams.status,
22914 pEventData->pEventData,
Jeff Johnson295189b2012-06-20 16:38:30 -070022915 sizeof(halUpdScanParams.status));
22916
22917 uStatus = halUpdScanParams.status;
22918
22919 /*Extract PNO version - 1st bit of the status */
Jeff Johnsone7245742012-09-05 17:12:55 -070022920 pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0;
Jeff Johnson295189b2012-06-20 16:38:30 -070022921
22922 /*Remove version bit*/
Jeff Johnsone7245742012-09-05 17:12:55 -070022923 uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK));
Jeff Johnson295189b2012-06-20 16:38:30 -070022924
Jeff Johnsone7245742012-09-05 17:12:55 -070022925 wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070022926
22927 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070022928 "UPD Scan Parameters rsp with status: %d",
Jeff Johnson295189b2012-06-20 16:38:30 -070022929 halUpdScanParams.status);
22930
22931 /*Notify UMAC*/
22932 wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
22933
Jeff Johnsone7245742012-09-05 17:12:55 -070022934 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070022935}
22936#endif // FEATURE_WLAN_SCAN_PNO
22937
22938#ifdef WLAN_FEATURE_PACKET_FILTERING
Jeff Johnsone7245742012-09-05 17:12:55 -070022939WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022940WDI_8023MulticastListReq
22941(
22942 WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo,
22943 WDI_8023MulticastListCb wdi8023MulticastListCallback,
22944 void* pUserData
22945)
22946{
22947 WDI_EventInfoType wdiEventData;
22948 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22949
22950 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22951 "%s", __FUNCTION__);
22952
22953 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022954 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022955 ------------------------------------------------------------------------*/
22956 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22957 {
22958 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22959 "WDI API call before module is initialized - Fail request");
22960
Jeff Johnsone7245742012-09-05 17:12:55 -070022961 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022962 }
22963
22964 /*------------------------------------------------------------------------
22965 Fill in Event data and post to the Main FSM
22966 ------------------------------------------------------------------------*/
22967 wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070022968 wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070022969 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070022970 wdiEventData.pCBfnc = wdi8023MulticastListCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070022971 wdiEventData.pUserData = pUserData;
22972
22973 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
22974}
22975
Jeff Johnsone7245742012-09-05 17:12:55 -070022976WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070022977WDI_ReceiveFilterSetFilterReq
22978(
22979 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo,
22980 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback,
22981 void* pUserData
22982)
22983{
22984 WDI_EventInfoType wdiEventData;
22985 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22986
22987 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
22988 "%s",__FUNCTION__);
22989
22990 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070022991 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070022992 ------------------------------------------------------------------------*/
22993 if ( eWLAN_PAL_FALSE == gWDIInitialized )
22994 {
22995 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
22996 "WDI API call before module is initialized - Fail request");
22997
Jeff Johnsone7245742012-09-05 17:12:55 -070022998 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070022999 }
23000
23001 /*------------------------------------------------------------------------
23002 Fill in Event data and post to the Main FSM
23003 ------------------------------------------------------------------------*/
23004 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023005 wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo;
23006 wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) +
23007 (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams
Jeff Johnson295189b2012-06-20 16:38:30 -070023008 * sizeof(WDI_RcvPktFilterFieldParams) - 1);
Jeff Johnsone7245742012-09-05 17:12:55 -070023009 wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070023010 wdiEventData.pUserData = pUserData;
23011
23012
23013 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23014}
23015
Jeff Johnsone7245742012-09-05 17:12:55 -070023016WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023017WDI_FilterMatchCountReq
23018(
23019 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo,
23020 WDI_FilterMatchCountCb wdiFilterMatchCountCallback,
23021 void* pUserData
23022)
23023{
23024 WDI_EventInfoType wdiEventData;
23025 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23026
23027 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23028 "%s",__FUNCTION__);
23029
23030 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023031 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023032 ------------------------------------------------------------------------*/
23033 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23034 {
23035 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23036 "WDI API call before module is initialized - Fail request");
23037
Jeff Johnsone7245742012-09-05 17:12:55 -070023038 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023039 }
23040
23041 /*------------------------------------------------------------------------
23042 Fill in Event data and post to the Main FSM
23043 ------------------------------------------------------------------------*/
23044 wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023045 wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023046 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070023047 wdiEventData.pCBfnc = wdiFilterMatchCountCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070023048 wdiEventData.pUserData = pUserData;
23049
23050
23051 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23052}
23053
Jeff Johnsone7245742012-09-05 17:12:55 -070023054WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023055WDI_ReceiveFilterClearFilterReq
23056(
23057 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo,
23058 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback,
23059 void* pUserData
23060)
23061{
23062 WDI_EventInfoType wdiEventData;
23063 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23064
23065 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23066 "%s",__FUNCTION__);
23067
23068 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023069 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023070 ------------------------------------------------------------------------*/
23071 if ( eWLAN_PAL_FALSE == gWDIInitialized )
23072 {
23073 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23074 "WDI API call before module is initialized - Fail request");
23075
Jeff Johnsone7245742012-09-05 17:12:55 -070023076 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070023077 }
23078
23079 /*------------------------------------------------------------------------
23080 Fill in Event data and post to the Main FSM
23081 ------------------------------------------------------------------------*/
23082 wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070023083 wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023084 wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo);
Jeff Johnsone7245742012-09-05 17:12:55 -070023085 wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070023086 wdiEventData.pUserData = pUserData;
23087
23088
23089 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
23090}
23091
23092/**
23093 @brief Process 8023 Multicast List Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023094
23095 @param pWDICtx: pointer to the WLAN DAL context
23096 pEventData: pointer to the event information structure
23097
Jeff Johnson295189b2012-06-20 16:38:30 -070023098 @see
23099 @return Result of the function call
23100*/
23101WDI_Status
23102WDI_Process8023MulticastListReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023103(
Jeff Johnson295189b2012-06-20 16:38:30 -070023104 WDI_ControlBlockType* pWDICtx,
23105 WDI_EventInfoType* pEventData
23106)
23107{
23108 WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL;
23109 WDI_8023MulticastListCb wdi8023MulticastListCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023110 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023111 wpt_uint16 usDataOffset = 0;
23112 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023113 tpHalRcvFltMcAddrListType pRcvFltMcAddrListType;
Jeff Johnson295189b2012-06-20 16:38:30 -070023114 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070023115 wpt_uint8 ucCurrentBSSSesIdx = 0;
23116 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023117
23118 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23119 "%s",__FUNCTION__);
23120
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023121 pRcvFltMcAddrListType = wpalMemoryAllocate(sizeof(tHalRcvFltMcAddrListType)) ;
23122 if( NULL == pRcvFltMcAddrListType )
23123 {
23124 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23125 "Failed to alloc in WDI_Process8023MulticastListReq");
23126 return WDI_STATUS_E_FAILURE;
23127 }
23128
Jeff Johnson295189b2012-06-20 16:38:30 -070023129 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023130 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023131 -------------------------------------------------------------------------*/
23132 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023133 ( NULL == (pwdiFltPktSetMcListReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023134 (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023135 ( NULL == (wdi8023MulticastListCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023136 (WDI_8023MulticastListCb)pEventData->pCBfnc)))
23137 {
23138 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23139 "%s: Invalid parameters", __FUNCTION__);
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023140 wpalMemoryFree(pRcvFltMcAddrListType);
Jeff Johnson295189b2012-06-20 16:38:30 -070023141 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023142 return WDI_STATUS_E_FAILURE;
23143 }
23144
23145 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23146 pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId,
23147 &pBSSSes);
23148 if ( NULL == pBSSSes )
23149 {
23150 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23151 " %s : Association for this BSSID does not exist",__FUNCTION__);
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023152 wpalMemoryFree(pRcvFltMcAddrListType);
Jeff Johnsone7245742012-09-05 17:12:55 -070023153 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023154 }
23155
23156 /*-----------------------------------------------------------------------
23157 Get message buffer
23158 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023159 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23160 WDI_8023_MULTICAST_LIST_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023161 sizeof(tHalRcvFltMcAddrListType),
23162 &pSendBuffer, &usDataOffset, &usSendSize))||
23163 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType))))
23164 {
23165 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23166 "Unable to get send buffer in "
23167 "WDI_Process8023MulticastListReq() %x %x %x",
23168 pEventData, pwdiFltPktSetMcListReqParamsType,
23169 wdi8023MulticastListCb);
23170 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023171 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023172 }
23173
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023174 pRcvFltMcAddrListType->cMulticastAddr =
Jeff Johnsone7245742012-09-05 17:12:55 -070023175 pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt;
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023176 for( i = 0; i < pRcvFltMcAddrListType->cMulticastAddr; i++ )
Jeff Johnson295189b2012-06-20 16:38:30 -070023177 {
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023178 wpalMemoryCopy(pRcvFltMcAddrListType->multicastAddr[i],
Jeff Johnson295189b2012-06-20 16:38:30 -070023179 pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i],
23180 sizeof(tSirMacAddr));
23181 }
23182
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023183 pRcvFltMcAddrListType->bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070023184 wpalMemoryCopy( pSendBuffer+usDataOffset,
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023185 pRcvFltMcAddrListType,
23186 sizeof(tHalRcvFltMcAddrListType));
Jeff Johnson295189b2012-06-20 16:38:30 -070023187
23188 pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023189 pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023190
23191
Madan Mohan Koyyalamudicfb9f4d2012-10-21 12:35:08 -070023192 wpalMemoryFree(pRcvFltMcAddrListType);
Jeff Johnson295189b2012-06-20 16:38:30 -070023193 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023194 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023195 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023196 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023197 wdi8023MulticastListCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023198 WDI_8023_MULTICAST_LIST_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023199}
23200
23201/**
23202 @brief Process Receive Filter Set Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023203
23204 @param pWDICtx: pointer to the WLAN DAL context
23205 pEventData: pointer to the event information structure
23206
Jeff Johnson295189b2012-06-20 16:38:30 -070023207 @see
23208 @return Result of the function call
23209*/
23210WDI_Status
23211WDI_ProcessReceiveFilterSetFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023212(
Jeff Johnson295189b2012-06-20 16:38:30 -070023213 WDI_ControlBlockType* pWDICtx,
23214 WDI_EventInfoType* pEventData
23215)
23216{
23217 WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL;
23218 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023219 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023220 wpt_uint16 usDataOffset = 0;
23221 wpt_uint16 usSendSize = 0;
23222 wpt_uint32 usRcvPktFilterCfgSize;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023223 tHalRcvPktFilterCfgType *pRcvPktFilterCfg = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023224 wpt_uint8 i;
Jeff Johnsone7245742012-09-05 17:12:55 -070023225 wpt_uint8 ucCurrentBSSSesIdx = 0;
23226 WDI_BSSSessionType* pBSSSes = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023227 tHalSessionizedRcvPktFilterCfgType *pSessRcvPktFilterCfg = NULL;
23228 wpt_uint32 usSessRcvPktFilterCfgSize;
Jeff Johnson295189b2012-06-20 16:38:30 -070023229
23230 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23231 "%s",__FUNCTION__);
23232
23233 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023234 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023235 -------------------------------------------------------------------------*/
23236 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023237 ( NULL == (pwdiSetRcvPktFilterReqInfo =
Jeff Johnson295189b2012-06-20 16:38:30 -070023238 (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023239 ( NULL == (wdiReceiveFilterSetFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023240 (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc)))
23241 {
23242 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23243 "%s: Invalid parameters", __FUNCTION__);
23244 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023245 return WDI_STATUS_E_FAILURE;
23246 }
23247
23248 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23249 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId,
23250 &pBSSSes);
23251 if ( NULL == pBSSSes )
23252 {
23253 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23254 " %s : Association for this BSSID does not exist",__FUNCTION__);
23255 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023256 }
23257
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023258 if( WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) )
23259 {
Jeff Johnson295189b2012-06-20 16:38:30 -070023260
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023261 usSessRcvPktFilterCfgSize = sizeof(tHalSessionizedRcvPktFilterCfgType) +
23262 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23263 * sizeof(tHalSessionizedRcvPktFilterCfgType));
23264
23265 pSessRcvPktFilterCfg = (tHalSessionizedRcvPktFilterCfgType *)wpalMemoryAllocate(
23266 usSessRcvPktFilterCfgSize);
23267
23268 if(NULL == pSessRcvPktFilterCfg)
23269 {
23270 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23271 "%s: Failed to allocate memory for "
23272 "tHalRcvPktFilterCfgType: %x %x %x ",
23273 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23274 WDI_ASSERT(0);
23275 return WDI_STATUS_E_FAILURE;
23276 }
23277
23278 wpalMemoryZero(pSessRcvPktFilterCfg, usSessRcvPktFilterCfgSize);
23279
23280 /*-----------------------------------------------------------------------
23281 Get message buffer
23282 -----------------------------------------------------------------------*/
23283
23284 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
23285 usSessRcvPktFilterCfgSize,
23286 &pSendBuffer, &usDataOffset, &usSendSize))||
23287 ( usSendSize < (usDataOffset + usSessRcvPktFilterCfgSize)))
23288 {
23289 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23290 "Unable to get send buffer in "
23291 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23292 pEventData, pwdiSetRcvPktFilterReqInfo,
23293 wdiReceiveFilterSetFilterCb);
23294 WDI_ASSERT(0);
23295 wpalMemoryFree(pSessRcvPktFilterCfg);
23296 return WDI_STATUS_E_FAILURE;
23297 }
23298
23299 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23300 "UsData Off %d UsSend %d cfg %d",usDataOffset,
23301 usSendSize,pSessRcvPktFilterCfg);
23302
23303 pSessRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
23304 pSessRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
23305 pSessRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
23306 pSessRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
23307
23308 pSessRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx;
23309
23310 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23311 "Out: FID %d FT %d",pSessRcvPktFilterCfg->filterId,
23312 pSessRcvPktFilterCfg->filterType);
23313 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23314 "NParams %d CT %d",pSessRcvPktFilterCfg->numParams,
23315 pSessRcvPktFilterCfg->coleasceTime);
23316
23317 for ( i = 0; i < pSessRcvPktFilterCfg->numParams; i++ )
23318 {
23319 pSessRcvPktFilterCfg->paramsData[i].protocolLayer =
23320 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
23321 pSessRcvPktFilterCfg->paramsData[i].cmpFlag =
23322 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
23323 pSessRcvPktFilterCfg->paramsData[i].dataOffset =
23324 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
23325 pSessRcvPktFilterCfg->paramsData[i].dataLength =
23326 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
23327
23328 wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].compareData,
23329 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23330 8);
23331 wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].dataMask,
23332 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23333 8);
23334
23335 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23336 "Out:Proto %d Comp Flag %d \n",
23337 pSessRcvPktFilterCfg->paramsData[i].protocolLayer,
23338 pSessRcvPktFilterCfg->paramsData[i].cmpFlag);
23339
23340 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23341 "Data Offset %d Data Len %d\n",
23342 pSessRcvPktFilterCfg->paramsData[i].dataOffset,
23343 pSessRcvPktFilterCfg->paramsData[i].dataLength);
23344
23345 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23346 "CData: %d:%d:%d:%d:%d:%d\n",
23347 pSessRcvPktFilterCfg->paramsData[i].compareData[0],
23348 pSessRcvPktFilterCfg->paramsData[i].compareData[1],
23349 pSessRcvPktFilterCfg->paramsData[i].compareData[2],
23350 pSessRcvPktFilterCfg->paramsData[i].compareData[3],
23351 pSessRcvPktFilterCfg->paramsData[i].compareData[4],
23352 pSessRcvPktFilterCfg->paramsData[i].compareData[5]);
23353
23354 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23355 "MData: %d:%d:%d:%d:%d:%d\n",
23356 pSessRcvPktFilterCfg->paramsData[i].dataMask[0],
23357 pSessRcvPktFilterCfg->paramsData[i].dataMask[1],
23358 pSessRcvPktFilterCfg->paramsData[i].dataMask[2],
23359 pSessRcvPktFilterCfg->paramsData[i].dataMask[3],
23360 pSessRcvPktFilterCfg->paramsData[i].dataMask[4],
23361 pSessRcvPktFilterCfg->paramsData[i].dataMask[5]);
23362 }
23363
23364 wpalMemoryCopy( pSendBuffer+usDataOffset,
23365 pSessRcvPktFilterCfg,
23366 usSessRcvPktFilterCfgSize);
23367
23368
23369 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
23370 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
23371
23372 wpalMemoryFree(pSessRcvPktFilterCfg);
23373
23374 }
23375 /*If SLM_SESSIONIZATION is not supported then do this */
23376 else
23377 {
23378 usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) +
23379 ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1)
23380 * sizeof(tHalRcvPktFilterParams));
23381
23382 pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate(
Jeff Johnson295189b2012-06-20 16:38:30 -070023383 usRcvPktFilterCfgSize);
23384
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023385 if(NULL == pRcvPktFilterCfg)
23386 {
23387 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23388 "%s: Failed to allocate memory for "
23389 "tHalRcvPktFilterCfgType: %x %x %x ",
23390 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
23391 WDI_ASSERT(0);
23392 return WDI_STATUS_E_FAILURE;
23393 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023394
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023395 wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023396
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023397 /*-----------------------------------------------------------------------
23398 Get message buffer
23399 -----------------------------------------------------------------------*/
23400 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023401 usRcvPktFilterCfgSize,
23402 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023403 ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize)))
23404 {
23405 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
Jeff Johnson295189b2012-06-20 16:38:30 -070023406 "Unable to get send buffer in "
23407 "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x",
23408 pEventData, pwdiSetRcvPktFilterReqInfo,
23409 wdiReceiveFilterSetFilterCb);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023410 WDI_ASSERT(0);
23411 wpalMemoryFree(pRcvPktFilterCfg);
23412 return WDI_STATUS_E_FAILURE;
23413 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023414
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023415 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023416 "UsData Off %d UsSend %d cfg %d",usDataOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -070023417 usSendSize,usRcvPktFilterCfgSize);
23418
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023419 pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId;
23420 pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType;
23421 pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams;
23422 pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime;
Jeff Johnson295189b2012-06-20 16:38:30 -070023423
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023424 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070023425 "Out: FID %d FT %d",pRcvPktFilterCfg->filterId,
Jeff Johnson295189b2012-06-20 16:38:30 -070023426 pRcvPktFilterCfg->filterType);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023427 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnson295189b2012-06-20 16:38:30 -070023428 "NParams %d CT %d",pRcvPktFilterCfg->numParams,
Jeff Johnsone7245742012-09-05 17:12:55 -070023429 pRcvPktFilterCfg->coalesceTime);
Jeff Johnson295189b2012-06-20 16:38:30 -070023430
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023431 for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ )
23432 {
23433 pRcvPktFilterCfg->paramsData[i].protocolLayer =
23434 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer;
23435 pRcvPktFilterCfg->paramsData[i].cmpFlag =
23436 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag;
23437 pRcvPktFilterCfg->paramsData[i].dataOffset =
23438 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset;
23439 pRcvPktFilterCfg->paramsData[i].dataLength =
23440 pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength;
Jeff Johnson295189b2012-06-20 16:38:30 -070023441
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023442 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData,
Jeff Johnson295189b2012-06-20 16:38:30 -070023443 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData,
23444 8);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023445 wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask,
Jeff Johnson295189b2012-06-20 16:38:30 -070023446 &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask,
23447 8);
23448
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023449 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnson295189b2012-06-20 16:38:30 -070023450 "Out:Proto %d Comp Flag %d \n",
Jeff Johnsone7245742012-09-05 17:12:55 -070023451 pRcvPktFilterCfg->paramsData[i].protocolLayer,
Jeff Johnson295189b2012-06-20 16:38:30 -070023452 pRcvPktFilterCfg->paramsData[i].cmpFlag);
23453
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023454 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23455 "Data Offset %d Data Len %d\n",
23456 pRcvPktFilterCfg->paramsData[i].dataOffset,
23457 pRcvPktFilterCfg->paramsData[i].dataLength);
Jeff Johnson295189b2012-06-20 16:38:30 -070023458
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023459 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23460 "CData: %d:%d:%d:%d:%d:%d\n",
23461 pRcvPktFilterCfg->paramsData[i].compareData[0],
23462 pRcvPktFilterCfg->paramsData[i].compareData[1],
23463 pRcvPktFilterCfg->paramsData[i].compareData[2],
23464 pRcvPktFilterCfg->paramsData[i].compareData[3],
23465 pRcvPktFilterCfg->paramsData[i].compareData[4],
23466 pRcvPktFilterCfg->paramsData[i].compareData[5]);
Jeff Johnson295189b2012-06-20 16:38:30 -070023467
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023468 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23469 "MData: %d:%d:%d:%d:%d:%d\n",
23470 pRcvPktFilterCfg->paramsData[i].dataMask[0],
23471 pRcvPktFilterCfg->paramsData[i].dataMask[1],
23472 pRcvPktFilterCfg->paramsData[i].dataMask[2],
23473 pRcvPktFilterCfg->paramsData[i].dataMask[3],
23474 pRcvPktFilterCfg->paramsData[i].dataMask[4],
23475 pRcvPktFilterCfg->paramsData[i].dataMask[5]);
23476 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023477
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023478 wpalMemoryCopy( pSendBuffer+usDataOffset,
Jeff Johnsone7245742012-09-05 17:12:55 -070023479 pRcvPktFilterCfg,
23480 usRcvPktFilterCfgSize);
Jeff Johnson295189b2012-06-20 16:38:30 -070023481
23482
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023483 pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB;
23484 pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023485
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023486 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23487 "%s",__FUNCTION__);
23488 wpalMemoryFree(pRcvPktFilterCfg);
23489 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023490 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023491 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023492 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023493 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023494 wdiReceiveFilterSetFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023495 WDI_RECEIVE_FILTER_SET_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023496}
23497
23498/**
23499 @brief Process Packet Filter Match Count Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023500
23501 @param pWDICtx: pointer to the WLAN DAL context
23502 pEventData: pointer to the event information structure
23503
Jeff Johnson295189b2012-06-20 16:38:30 -070023504 @see
23505 @return Result of the function call
23506*/
23507WDI_Status
23508WDI_ProcessFilterMatchCountReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023509(
Jeff Johnson295189b2012-06-20 16:38:30 -070023510 WDI_ControlBlockType* pWDICtx,
23511 WDI_EventInfoType* pEventData
23512)
23513{
23514 WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType =
23515 NULL;
23516 WDI_FilterMatchCountCb wdiFilterMatchCountCb =
23517 NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023518 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023519 wpt_uint16 usDataOffset = 0;
23520 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023521 tHalRcvFltPktMatchCntReqParams rcvFltPktMatchCntReqParam = {0};
23522 wpt_uint8 ucCurrentBSSSesIdx = 0;
23523 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023524
23525 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23526 "%s",__FUNCTION__);
23527
23528 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023529 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023530 -------------------------------------------------------------------------*/
23531 if (( NULL == pEventData ) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023532 ( NULL == (pwdiRcvFltPktMatchCntReqParamsType =
Jeff Johnson295189b2012-06-20 16:38:30 -070023533 (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023534 ( NULL == (wdiFilterMatchCountCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023535 (WDI_FilterMatchCountCb)pEventData->pCBfnc)))
23536 {
23537 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23538 "%s: Invalid parameters", __FUNCTION__);
23539 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023540 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023541 }
23542
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023543 ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx,
23544 pwdiRcvFltPktMatchCntReqParamsType->bssId,
23545 &pBSSSes);
23546 if ( NULL == pBSSSes )
23547 {
23548 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23549 " %s : Association for this BSSID does not exist",__FUNCTION__);
23550 return WDI_STATUS_E_FAILURE;
23551 }
23552
Jeff Johnson295189b2012-06-20 16:38:30 -070023553 /*-----------------------------------------------------------------------
23554 Get message buffer
23555 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023556 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
23557 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023558 sizeof(tHalRcvFltPktMatchCntReqParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070023559 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023560 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktMatchCntReqParams))))
Jeff Johnson295189b2012-06-20 16:38:30 -070023561 {
23562 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23563 "Unable to get send buffer in "
23564 "WDI_ProcessFilterMatchCountReq() %x %x %x",
23565 pEventData, pwdiRcvFltPktMatchCntReqParamsType,
23566 wdiFilterMatchCountCb);
23567 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023568 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023569 }
23570
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023571 rcvFltPktMatchCntReqParam.bssIdx = pBSSSes->ucBSSIdx;
23572 wpalMemoryCopy( pSendBuffer+usDataOffset,
23573 &rcvFltPktMatchCntReqParam,
23574 sizeof(rcvFltPktMatchCntReqParam));
23575
Jeff Johnson295189b2012-06-20 16:38:30 -070023576 //
23577 // Don't need to fill send buffer other than header
23578 //
23579 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023580 pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023581
23582
23583 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023584 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023585 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023586 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
23587 wdiFilterMatchCountCb,
23588 pEventData->pUserData,
23589 WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023590}
23591
23592/**
23593 @brief Process Receive Filter Clear Filter Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070023594
23595 @param pWDICtx: pointer to the WLAN DAL context
23596 pEventData: pointer to the event information structure
23597
Jeff Johnson295189b2012-06-20 16:38:30 -070023598 @see
23599 @return Result of the function call
23600*/
23601WDI_Status
23602WDI_ProcessReceiveFilterClearFilterReq
Jeff Johnsone7245742012-09-05 17:12:55 -070023603(
Jeff Johnson295189b2012-06-20 16:38:30 -070023604 WDI_ControlBlockType* pWDICtx,
23605 WDI_EventInfoType* pEventData
23606)
Jeff Johnsone7245742012-09-05 17:12:55 -070023607{
Jeff Johnson295189b2012-06-20 16:38:30 -070023608 WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL;
23609 WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070023610 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023611 wpt_uint16 usDataOffset = 0;
23612 wpt_uint16 usSendSize = 0;
23613 tHalRcvFltPktClearParam rcvFltPktClearParam;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023614 wpt_uint8 ucCurrentSessionId = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070023615 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070023616
23617 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23618 "%s",__FUNCTION__);
23619
23620 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023621 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023622 -------------------------------------------------------------------------*/
23623 if (( NULL == pEventData ) ||
23624 ( NULL == (pwdiRcvFltPktClearReqParamsType =
23625 (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) ||
Jeff Johnsone7245742012-09-05 17:12:55 -070023626 ( NULL == (wdiRcvFltPktClearFilterCb =
Jeff Johnson295189b2012-06-20 16:38:30 -070023627 (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc)))
23628 {
23629 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23630 "%s: Invalid parameters", __FUNCTION__);
23631 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023632 return WDI_STATUS_E_FAILURE;
23633 }
23634
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023635 ucCurrentSessionId = WDI_FindAssocSession( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023636 pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId,
23637 &pBSSSes);
23638 if ( NULL == pBSSSes )
23639 {
23640 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
23641 " %s : Association for this BSSID does not exist",__FUNCTION__);
23642 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023643 }
23644
23645 /*-----------------------------------------------------------------------
23646 Get message buffer
23647 -----------------------------------------------------------------------*/
23648 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
Jeff Johnsone7245742012-09-05 17:12:55 -070023649 WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070023650 sizeof(tHalRcvFltPktClearParam),
23651 &pSendBuffer, &usDataOffset, &usSendSize))||
23652 ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam))))
23653 {
23654 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23655 "Unable to get send buffer in "
23656 "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x",
23657 pEventData, pwdiRcvFltPktClearReqParamsType,
23658 wdiRcvFltPktClearFilterCb);
23659 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023660 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023661 }
23662
23663
23664 rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023665 filterClearParam.status;
Jeff Johnson295189b2012-06-20 16:38:30 -070023666 rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType->
Jeff Johnsone7245742012-09-05 17:12:55 -070023667 filterClearParam.filterId;
Jeff Johnson295189b2012-06-20 16:38:30 -070023668
Jeff Johnsone7245742012-09-05 17:12:55 -070023669 rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx;
23670 wpalMemoryCopy( pSendBuffer+usDataOffset,
23671 &rcvFltPktClearParam,
23672 sizeof(rcvFltPktClearParam));
Jeff Johnson295189b2012-06-20 16:38:30 -070023673
23674 pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070023675 pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070023676
23677
23678 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023679 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070023680 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023681 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
Jeff Johnson295189b2012-06-20 16:38:30 -070023682 wdiRcvFltPktClearFilterCb, pEventData->pUserData,
Jeff Johnsone7245742012-09-05 17:12:55 -070023683 WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070023684}
23685
23686/**
23687 @brief Process 8023 Multicast List Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023688
23689 @param pWDICtx: pointer to the WLAN DAL context
23690 pEventData: pointer to the event information structure
23691
Jeff Johnson295189b2012-06-20 16:38:30 -070023692 @see
23693 @return Result of the function call
23694*/
23695WDI_Status
23696WDI_Process8023MulticastListRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023697(
Jeff Johnson295189b2012-06-20 16:38:30 -070023698 WDI_ControlBlockType* pWDICtx,
23699 WDI_EventInfoType* pEventData
23700)
23701{
Jeff Johnson295189b2012-06-20 16:38:30 -070023702 eHalStatus halStatus;
23703 WDI_8023MulticastListCb wdi8023MulticastListCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023704 tHalRcvFltPktSetMcListRspType halRcvFltPktSetMcListRsp;
23705 WDI_RcvFltPktSetMcListRspParamsType wdiRcvFltPktSetMcListRspInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023706 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23707
23708 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23709 "%s",__FUNCTION__);
23710
23711 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023712 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023713 -------------------------------------------------------------------------*/
23714 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23715 ( NULL == pEventData->pEventData ))
23716 {
23717 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23718 "%s: Invalid parameters", __FUNCTION__);
23719 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023720 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023721 }
23722
Jeff Johnsone7245742012-09-05 17:12:55 -070023723 wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023724
23725 /*-------------------------------------------------------------------------
23726 Extract response and send it to UMAC
23727 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023728 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23729 {
23730 wpalMemoryCopy( &halRcvFltPktSetMcListRsp,
23731 pEventData->pEventData,
23732 sizeof(halRcvFltPktSetMcListRsp));
23733
23734 wdiRcvFltPktSetMcListRspInfo.wdiStatus =
23735 WDI_HAL_2_WDI_STATUS(halRcvFltPktSetMcListRsp.status);
23736 wdiRcvFltPktSetMcListRspInfo.bssIdx =
23737 halRcvFltPktSetMcListRsp.bssIdx;
23738 }
23739 else
23740 {
23741 halStatus = *((eHalStatus*)pEventData->pEventData);
23742 wdiRcvFltPktSetMcListRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23743 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023744
23745 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023746 wdi8023MulticastListCb(&wdiRcvFltPktSetMcListRspInfo, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023747
Jeff Johnsone7245742012-09-05 17:12:55 -070023748 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023749}
23750
23751/**
23752 @brief Process Set Rsp function (called when a
23753 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070023754
23755 @param pWDICtx: pointer to the WLAN DAL context
23756 pEventData: pointer to the event information structure
23757
Jeff Johnson295189b2012-06-20 16:38:30 -070023758 @see
23759 @return Result of the function call
23760*/
23761WDI_Status
23762WDI_ProcessReceiveFilterSetFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023763(
Jeff Johnson295189b2012-06-20 16:38:30 -070023764 WDI_ControlBlockType* pWDICtx,
23765 WDI_EventInfoType* pEventData
23766)
23767{
Jeff Johnson295189b2012-06-20 16:38:30 -070023768 eHalStatus halStatus;
23769 WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023770 tHalSetPktFilterRspParams halSetPktFilterRspParams;
23771 WDI_SetRcvPktFilterRspParamsType wdiSetRcvPktFilterRspInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -070023772 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23773
23774 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23775 "%s",__FUNCTION__);
23776
23777 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023778 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023779 -------------------------------------------------------------------------*/
23780 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23781 ( NULL == pEventData->pEventData ))
23782 {
23783 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23784 "%s: Invalid parameters", __FUNCTION__);
23785 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023786 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023787 }
23788
23789 wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023790 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023791
23792 /*-------------------------------------------------------------------------
23793 Extract response and send it to UMAC
23794 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023795 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23796 {
23797 wpalMemoryCopy( &halSetPktFilterRspParams,
23798 pEventData->pEventData,
23799 sizeof(halSetPktFilterRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070023800
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023801 wdiSetRcvPktFilterRspInfo.bssIdx = halSetPktFilterRspParams.bssIdx;
23802 wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halSetPktFilterRspParams.status);
23803 }
23804 else
23805 {
23806 halStatus = *((eHalStatus*)pEventData->pEventData);
23807 wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23808 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023809 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023810 wdiReceiveFilterSetFilterCb(&wdiSetRcvPktFilterRspInfo, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023811
Jeff Johnsone7245742012-09-05 17:12:55 -070023812 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023813}
23814
23815/**
23816 @brief Process Packet Filter Match Count Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023817
23818 @param pWDICtx: pointer to the WLAN DAL context
23819 pEventData: pointer to the event information structure
23820
Jeff Johnson295189b2012-06-20 16:38:30 -070023821 @see
23822 @return Result of the function call
23823*/
23824WDI_Status
23825WDI_ProcessFilterMatchCountRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023826(
Jeff Johnson295189b2012-06-20 16:38:30 -070023827 WDI_ControlBlockType* pWDICtx,
23828 WDI_EventInfoType* pEventData
23829)
23830{
Jeff Johnson295189b2012-06-20 16:38:30 -070023831 eHalStatus halStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070023832 WDI_FilterMatchCountCb wdiFilterMatchCountCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023833 tHalRcvFltPktMatchRspParams halRcvFltrPktMatachRsp;
23834 WDI_RcvFltPktMatchCntRspParamsType wdiRcvFltPktMatchRspParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070023835
23836 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23837
23838 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23839 "%s",__FUNCTION__);
23840
23841 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023842 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023843 -------------------------------------------------------------------------*/
23844 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23845 ( NULL == pEventData->pEventData ))
23846 {
23847 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23848 "%s: Invalid parameters", __FUNCTION__);
23849 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023850 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023851 }
23852
Jeff Johnsone7245742012-09-05 17:12:55 -070023853 wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023854
23855 /*-------------------------------------------------------------------------
23856 Extract response and send it to UMAC
23857 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023858 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23859 {
23860 wpalMemoryCopy( &halRcvFltrPktMatachRsp,
23861 pEventData->pEventData,
23862 sizeof(halRcvFltrPktMatachRsp));
23863
23864 wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halRcvFltrPktMatachRsp.status);
23865 wdiRcvFltPktMatchRspParams.bssIdx = halRcvFltrPktMatachRsp.bssIdx;
23866 }
23867 else
23868 {
23869 halStatus = *((eHalStatus*)pEventData->pEventData);
23870 wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23871 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023872
23873 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023874 wdiFilterMatchCountCb(&wdiRcvFltPktMatchRspParams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023875
Jeff Johnsone7245742012-09-05 17:12:55 -070023876 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023877}
23878
23879/**
23880 @brief Process Receive Filter Clear Filter Response function
Jeff Johnsone7245742012-09-05 17:12:55 -070023881
23882 @param pWDICtx: pointer to the WLAN DAL context
23883 pEventData: pointer to the event information structure
23884
Jeff Johnson295189b2012-06-20 16:38:30 -070023885 @see
23886 @return Result of the function call
23887*/
23888WDI_Status
23889WDI_ProcessReceiveFilterClearFilterRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023890(
Jeff Johnson295189b2012-06-20 16:38:30 -070023891 WDI_ControlBlockType* pWDICtx,
23892 WDI_EventInfoType* pEventData
23893)
23894{
Jeff Johnson295189b2012-06-20 16:38:30 -070023895 eHalStatus halStatus;
23896 WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023897 tHalRcvFltPktClearParam halRcvFltPktClearRspMsg;
23898 WDI_RcvFltPktClearRspParamsType wdiRcvFltPktClearRspParamsType;
Jeff Johnson295189b2012-06-20 16:38:30 -070023899 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23900
23901 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
23902 "%s",__FUNCTION__);
23903
23904 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023905 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070023906 -------------------------------------------------------------------------*/
23907 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
23908 ( NULL == pEventData->pEventData ))
23909 {
23910 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
23911 "%s: Invalid parameters", __FUNCTION__);
23912 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070023913 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070023914 }
23915
23916 wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx->
Jeff Johnsone7245742012-09-05 17:12:55 -070023917 pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070023918
23919 /*-------------------------------------------------------------------------
23920 Extract response and send it to UMAC
23921 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023922 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
23923 {
23924 wpalMemoryCopy( &halRcvFltPktClearRspMsg,
23925 pEventData->pEventData,
23926 sizeof(halRcvFltPktClearRspMsg));
23927
23928 wdiRcvFltPktClearRspParamsType.wdiStatus =
23929 WDI_HAL_2_WDI_STATUS(halRcvFltPktClearRspMsg.status);
23930 wdiRcvFltPktClearRspParamsType.bssIdx =
23931 halRcvFltPktClearRspMsg.bssIdx;
23932 }
23933 else
23934 {
23935 halStatus = *((eHalStatus*)pEventData->pEventData);
23936 wdiRcvFltPktClearRspParamsType.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
23937 }
Jeff Johnson295189b2012-06-20 16:38:30 -070023938
23939 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070023940 wdiReceiveFilterClearFilterCb(&wdiRcvFltPktClearRspParamsType, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070023941
Jeff Johnsone7245742012-09-05 17:12:55 -070023942 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070023943}
23944#endif // WLAN_FEATURE_PACKET_FILTERING
23945
23946/**
23947 @brief Process Shutdown Rsp function
23948 There is no shutdown response comming from HAL
23949 - function just kept for simmetry
Jeff Johnsone7245742012-09-05 17:12:55 -070023950
Jeff Johnson295189b2012-06-20 16:38:30 -070023951 @param pWDICtx: pointer to the WLAN DAL context
Jeff Johnsone7245742012-09-05 17:12:55 -070023952 pEventData: pointer to the event information structure
Jeff Johnson295189b2012-06-20 16:38:30 -070023953
23954 @see
23955 @return Result of the function call
23956*/
23957WDI_Status
23958WDI_ProcessShutdownRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070023959(
Jeff Johnson295189b2012-06-20 16:38:30 -070023960 WDI_ControlBlockType* pWDICtx,
23961 WDI_EventInfoType* pEventData
23962)
23963{
23964 /*There is no shutdown response comming from HAL - function just kept for
23965 simmetry */
23966 WDI_ASSERT(0);
23967 return WDI_STATUS_SUCCESS;
23968}/*WDI_ProcessShutdownRsp*/
23969
23970/**
23971 @brief WDI_SetPowerParamsReq
23972
Jeff Johnsone7245742012-09-05 17:12:55 -070023973 @param pwdiPowerParamsReqParams: the Set Power Params as
Jeff Johnson295189b2012-06-20 16:38:30 -070023974 specified by the Device Interface
Jeff Johnsone7245742012-09-05 17:12:55 -070023975
Jeff Johnson295189b2012-06-20 16:38:30 -070023976 wdiPowerParamsCb: callback for passing back the response
23977 of the Set Power Params operation received from the
23978 device
Jeff Johnsone7245742012-09-05 17:12:55 -070023979
Jeff Johnson295189b2012-06-20 16:38:30 -070023980 pUserData: user data will be passed back with the
Jeff Johnsone7245742012-09-05 17:12:55 -070023981 callback
23982
Jeff Johnson295189b2012-06-20 16:38:30 -070023983 @return Result of the function call
23984*/
Jeff Johnsone7245742012-09-05 17:12:55 -070023985WDI_Status
Jeff Johnson295189b2012-06-20 16:38:30 -070023986WDI_SetPowerParamsReq
23987(
23988 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams,
23989 WDI_SetPowerParamsCb wdiPowerParamsCb,
23990 void* pUserData
23991)
23992{
23993 WDI_EventInfoType wdiEventData;
23994 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
23995
23996 /*------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070023997 Sanity Check
Jeff Johnson295189b2012-06-20 16:38:30 -070023998 ------------------------------------------------------------------------*/
23999 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24000 {
24001 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24002 "WDI API call before module is initialized - Fail request");
24003
Jeff Johnsone7245742012-09-05 17:12:55 -070024004 return WDI_STATUS_E_NOT_ALLOWED;
Jeff Johnson295189b2012-06-20 16:38:30 -070024005 }
24006
24007 /*------------------------------------------------------------------------
24008 Fill in Event data and post to the Main FSM
24009 ------------------------------------------------------------------------*/
24010 wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ;
Jeff Johnsone7245742012-09-05 17:12:55 -070024011 wdiEventData.pEventData = pwdiPowerParamsReqParams;
Jeff Johnson295189b2012-06-20 16:38:30 -070024012 wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams);
Jeff Johnsone7245742012-09-05 17:12:55 -070024013 wdiEventData.pCBfnc = wdiPowerParamsCb;
Jeff Johnson295189b2012-06-20 16:38:30 -070024014 wdiEventData.pUserData = pUserData;
24015
24016 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24017}/*WDI_SetPowerParamsReq*/
24018
24019/**
24020 @brief Process Set Power Params Request function
Jeff Johnsone7245742012-09-05 17:12:55 -070024021
24022 @param pWDICtx: pointer to the WLAN DAL context
24023 pEventData: pointer to the event information structure
24024
Jeff Johnson295189b2012-06-20 16:38:30 -070024025 @see
24026 @return Result of the function call
24027*/
24028WDI_Status
24029WDI_ProcessSetPowerParamsReq
Jeff Johnsone7245742012-09-05 17:12:55 -070024030(
Jeff Johnson295189b2012-06-20 16:38:30 -070024031 WDI_ControlBlockType* pWDICtx,
24032 WDI_EventInfoType* pEventData
24033)
24034{
24035 WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL;
24036 WDI_SetPowerParamsCb wdiPowerParamsCb = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -070024037 wpt_uint8* pSendBuffer = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070024038 wpt_uint16 usDataOffset = 0;
24039 wpt_uint16 usSendSize = 0;
24040 tSetPowerParamsType powerParams;
24041
24042 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070024043 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070024044 -------------------------------------------------------------------------*/
24045 if (( NULL == pEventData ) ||
24046 ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) ||
24047 ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc)))
24048 {
24049 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24050 "%s: Invalid parameters", __FUNCTION__);
24051 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070024052 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070024053 }
24054
24055 /*-----------------------------------------------------------------------
24056 Get message buffer
24057 -----------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070024058 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ,
Jeff Johnson295189b2012-06-20 16:38:30 -070024059 sizeof(powerParams),
24060 &pSendBuffer, &usDataOffset, &usSendSize))||
24061 ( usSendSize < (usDataOffset + sizeof(powerParams) )))
24062 {
24063 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24064 "Unable to get send buffer in Set PNO req %x %x %x",
24065 pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb);
24066 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070024067 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070024068 }
24069
24070 /* Ignore DTIM */
Jeff Johnsone7245742012-09-05 17:12:55 -070024071 powerParams.uIgnoreDTIM =
Jeff Johnson295189b2012-06-20 16:38:30 -070024072 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM;
24073
24074 /*DTIM Period*/
Jeff Johnsone7245742012-09-05 17:12:55 -070024075 powerParams.uDTIMPeriod =
Jeff Johnson295189b2012-06-20 16:38:30 -070024076 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod;
24077
24078 /* Listen Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070024079 powerParams.uListenInterval=
Jeff Johnson295189b2012-06-20 16:38:30 -070024080 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval;
24081
24082 /* Broadcast Multicas Filter */
Jeff Johnsone7245742012-09-05 17:12:55 -070024083 powerParams.uBcastMcastFilter =
Jeff Johnson295189b2012-06-20 16:38:30 -070024084 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter;
24085
24086 /* Beacon Early Termination */
Jeff Johnsone7245742012-09-05 17:12:55 -070024087 powerParams.uEnableBET =
Jeff Johnson295189b2012-06-20 16:38:30 -070024088 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET;
24089
24090 /* Beacon Early Termination Interval */
Jeff Johnsone7245742012-09-05 17:12:55 -070024091 powerParams.uBETInterval =
24092 pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval;
Jeff Johnson295189b2012-06-20 16:38:30 -070024093
Jeff Johnsone7245742012-09-05 17:12:55 -070024094
24095 wpalMemoryCopy( pSendBuffer+usDataOffset,
24096 &powerParams,
24097 sizeof(powerParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070024098
24099 pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB;
Jeff Johnsone7245742012-09-05 17:12:55 -070024100 pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData;
Jeff Johnson295189b2012-06-20 16:38:30 -070024101
24102 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070024103 Send Get STA Request to HAL
Jeff Johnson295189b2012-06-20 16:38:30 -070024104 -------------------------------------------------------------------------*/
Jeff Johnsone7245742012-09-05 17:12:55 -070024105 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24106 wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP);
Jeff Johnson295189b2012-06-20 16:38:30 -070024107}
24108
24109/**
24110 @brief Process Power Params Rsp function (called when a
24111 response is being received over the bus from HAL)
Jeff Johnsone7245742012-09-05 17:12:55 -070024112
24113 @param pWDICtx: pointer to the WLAN DAL context
24114 pEventData: pointer to the event information structure
24115
Jeff Johnson295189b2012-06-20 16:38:30 -070024116 @see
24117 @return Result of the function call
24118*/
24119WDI_Status
24120WDI_ProcessSetPowerParamsRsp
Jeff Johnsone7245742012-09-05 17:12:55 -070024121(
Jeff Johnson295189b2012-06-20 16:38:30 -070024122 WDI_ControlBlockType* pWDICtx,
24123 WDI_EventInfoType* pEventData
24124)
24125{
24126 WDI_Status wdiStatus;
24127 eHalStatus halStatus;
24128 WDI_SetPowerParamsCb wdiPowerParamsCb;
24129 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24130
24131 /*-------------------------------------------------------------------------
Jeff Johnsone7245742012-09-05 17:12:55 -070024132 Sanity check
Jeff Johnson295189b2012-06-20 16:38:30 -070024133 -------------------------------------------------------------------------*/
24134 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24135 ( NULL == pEventData->pEventData ))
24136 {
24137 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24138 "%s: Invalid parameters", __FUNCTION__);
24139 WDI_ASSERT(0);
Jeff Johnsone7245742012-09-05 17:12:55 -070024140 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -070024141 }
24142
Jeff Johnsone7245742012-09-05 17:12:55 -070024143 wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
Jeff Johnson295189b2012-06-20 16:38:30 -070024144
24145 /*-------------------------------------------------------------------------
24146 Extract response and send it to UMAC
24147 -------------------------------------------------------------------------*/
24148 halStatus = *((eHalStatus*)pEventData->pEventData);
Jeff Johnsone7245742012-09-05 17:12:55 -070024149 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
Jeff Johnson295189b2012-06-20 16:38:30 -070024150
24151 /*Notify UMAC*/
24152 wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24153
Jeff Johnsone7245742012-09-05 17:12:55 -070024154 return WDI_STATUS_SUCCESS;
Jeff Johnson295189b2012-06-20 16:38:30 -070024155}/*WDI_ProcessSetPowerParamsRsp*/
24156
24157#ifdef WLAN_FEATURE_GTK_OFFLOAD
24158/**
24159 @brief WDI_GTKOffloadReq will be called when the upper MAC
24160 wants to set GTK Rekey Counter while in power save. Upon
24161 the call of this API the WLAN DAL will pack and send a
24162 HAL GTK offload request message to the lower RIVA
24163 sub-system if DAL is in state STARTED.
24164
24165 In state BUSY this request will be queued. Request won't
24166 be allowed in any other state.
24167
24168 WDI_PostAssocReq must have been called.
24169
24170 @param pwdiGtkOffloadParams: the GTK offload as specified
24171 by the Device Interface
24172
24173 wdiGtkOffloadCb: callback for passing back the response
24174 of the GTK offload operation received from the device
24175
24176 pUserData: user data will be passed back with the
24177 callback
24178
24179 @see WDI_PostAssocReq
24180 @return Result of the function call
24181*/
24182WDI_Status
24183WDI_GTKOffloadReq
24184(
24185 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg,
24186 WDI_GtkOffloadCb wdiGtkOffloadCb,
24187 void* pUserData
24188)
24189{
24190 WDI_EventInfoType wdiEventData = {0};
24191 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24192
24193 /*------------------------------------------------------------------------
24194 Sanity Check
24195 ------------------------------------------------------------------------*/
24196 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24197 {
24198 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24199 "WDI API call before module is initialized - Fail request");
24200
24201 return WDI_STATUS_E_NOT_ALLOWED;
24202 }
24203
24204 /*------------------------------------------------------------------------
24205 Fill in Event data and post to the Main FSM
24206 ------------------------------------------------------------------------*/
24207 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ;
24208 wdiEventData.pEventData = pwdiGtkOffloadReqMsg;
24209 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);;
24210 wdiEventData.pCBfnc = wdiGtkOffloadCb;
24211 wdiEventData.pUserData = pUserData;
24212
24213 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24214}
24215
24216
24217/**
24218 @brief WDI_GTKOffloadGetInfoReq will be called when the upper
24219 MAC wants to get GTK Rekey Counter while in power save.
24220 Upon the call of this API the WLAN DAL will pack and
24221 send a HAL GTK offload request message to the lower RIVA
24222 sub-system if DAL is in state STARTED.
24223
24224 In state BUSY this request will be queued. Request won't
24225 be allowed in any other state.
24226
24227 WDI_PostAssocReq must have been called.
24228
24229 @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload
24230 Information Message as specified by the
24231 Device Interface
24232
24233 wdiGtkOffloadGetInfoCb: callback for passing back the
24234 response of the GTK offload operation received from the
24235 device
24236
24237 pUserData: user data will be passed back with the
24238 callback
24239
24240 @see WDI_PostAssocReq
24241 @return Result of the function call
24242*/
24243WDI_Status
24244WDI_GTKOffloadGetInfoReq
24245(
24246 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg,
24247 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb,
24248 void* pUserData
24249)
24250{
24251 WDI_EventInfoType wdiEventData = {0};
24252 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24253
24254 /*------------------------------------------------------------------------
24255 Sanity Check
24256 ------------------------------------------------------------------------*/
24257 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24258 {
24259 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24260 "WDI API call before module is initialized - Fail request");
24261
24262 return WDI_STATUS_E_NOT_ALLOWED;
24263 }
24264
24265 /*------------------------------------------------------------------------
24266 Fill in Event data and post to the Main FSM
24267 ------------------------------------------------------------------------*/
24268 wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ;
24269 wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg;
24270 wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg);
24271 wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb;
24272 wdiEventData.pUserData = pUserData;
24273
24274 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24275}
24276
24277
24278/**
24279 @brief Process set GTK Offload Request function
24280
24281 @param pWDICtx: pointer to the WLAN DAL context
24282 pEventData: pointer to the event information structure
24283
24284 @see
24285 @return Result of the function call
24286*/
24287WDI_Status
24288WDI_ProcessGTKOffloadReq
24289(
24290 WDI_ControlBlockType* pWDICtx,
24291 WDI_EventInfoType* pEventData
24292)
24293{
24294 WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL;
24295 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
24296 wpt_uint8* pSendBuffer = NULL;
24297 wpt_uint16 usDataOffset = 0;
24298 wpt_uint16 usSendSize = 0;
24299 tHalGtkOffloadReqParams gtkOffloadReqParams = {0};
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024300 wpt_uint8 ucCurrentSessionId = 0;
24301 WDI_BSSSessionType* pBSSSes = NULL;
24302
Jeff Johnson295189b2012-06-20 16:38:30 -070024303 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24304
24305 /*-------------------------------------------------------------------------
24306 Sanity check
24307 -------------------------------------------------------------------------*/
24308 if (( NULL == pEventData ) ||
24309 ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) ||
24310 ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc)))
24311 {
24312 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24313 "%s: Invalid parameters", __FUNCTION__);
24314 WDI_ASSERT(0);
24315 return WDI_STATUS_E_FAILURE;
24316 }
24317
24318 /*-----------------------------------------------------------------------
24319 Get message buffer
24320 -----------------------------------------------------------------------*/
24321 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ,
24322 sizeof(gtkOffloadReqParams),
24323 &pSendBuffer, &usDataOffset, &usSendSize))||
24324 ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) )))
24325 {
24326 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24327 "Unable to get send buffer in GTK offload req %x %x %x",
24328 pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb);
24329 WDI_ASSERT(0);
24330 return WDI_STATUS_E_FAILURE;
24331 }
24332
24333 //
24334 // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams
24335 //
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024336 ucCurrentSessionId = WDI_FindAssocSession( pWDICtx,
24337 pwdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId,
24338 &pBSSSes);
24339 if ( NULL == pBSSSes )
24340 {
24341 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24342 " %s : Association for this BSSID does not exist", __FUNCTION__);
24343 return WDI_STATUS_E_FAILURE;
24344 }
24345
24346 gtkOffloadReqParams.bssIdx = pBSSSes->ucBSSIdx;
24347
Jeff Johnson295189b2012-06-20 16:38:30 -070024348 gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags;
24349 // Copy KCK
24350 wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16);
24351 // Copy KEK
24352 wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16);
24353 // Copy KeyReplayCounter
24354 wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t));
24355
24356 wpalMemoryCopy( pSendBuffer+usDataOffset,
24357 &gtkOffloadReqParams,
24358 sizeof(gtkOffloadReqParams));
24359
24360 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB;
24361 pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData;
24362
24363 /*-------------------------------------------------------------------------
24364 Send Get STA Request to HAL
24365 -------------------------------------------------------------------------*/
24366 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24367 wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP);
24368}
24369
24370
24371/**
24372 @brief Process GTK Offload Get Information Request function
24373
24374 @param pWDICtx: pointer to the WLAN DAL context
24375 pEventData: pointer to the event information structure
24376
24377 @see
24378 @return Result of the function call
24379*/
24380WDI_Status
24381WDI_ProcessGTKOffloadGetInfoReq
24382(
24383 WDI_ControlBlockType* pWDICtx,
24384 WDI_EventInfoType* pEventData
24385)
24386{
24387 WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL;
24388 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
24389 wpt_uint8* pSendBuffer = NULL;
24390 wpt_uint16 usDataOffset = 0;
24391 wpt_uint16 usSendSize = 0;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024392 tHalGtkOffloadGetInfoReqParams halGtkOffloadGetInfoReqParams;
24393 wpt_uint8 ucCurrentSessionId = 0;
24394 WDI_BSSSessionType* pBSSSes = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -070024395
24396 /*-------------------------------------------------------------------------
24397 Sanity check
24398 -------------------------------------------------------------------------*/
24399 if (( NULL == pEventData ) ||
24400 ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) ||
24401 ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc)))
24402 {
24403 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24404 "%s: Invalid parameters", __FUNCTION__);
24405 WDI_ASSERT(0);
24406 return WDI_STATUS_E_FAILURE;
24407 }
24408
24409 /*-----------------------------------------------------------------------
24410 Get message buffer
24411 -----------------------------------------------------------------------*/
24412 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ,
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024413 sizeof(halGtkOffloadGetInfoReqParams),
Jeff Johnson295189b2012-06-20 16:38:30 -070024414 &pSendBuffer, &usDataOffset, &usSendSize))||
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024415 ( usSendSize < ( usDataOffset + sizeof(halGtkOffloadGetInfoReqParams)))
Jeff Johnson295189b2012-06-20 16:38:30 -070024416 {
24417 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24418 "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x",
24419 pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb);
24420 WDI_ASSERT(0);
24421 return WDI_STATUS_E_FAILURE;
24422 }
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024423 ucCurrentSessionId = WDI_FindAssocSession( pWDICtx,
24424 pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId,
24425 &pBSSSes);
24426 if ( NULL == pBSSSes )
24427 {
24428 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24429 " %s : Association for this BSSID does not exist",__FUNCTION__);
24430 return WDI_STATUS_E_FAILURE;
24431 }
24432 halGtkOffloadGetInfoReqParams.bssIdx = pBSSSes->ucBSSIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070024433
24434 //
24435 // Don't need to fill send buffer other than header
24436 //
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024437 wpalMemoryCopy( pSendBuffer+usDataOffset,
24438 &halGtkOffloadGetInfoReqParams,
24439 sizeof(halGtkOffloadGetInfoReqParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070024440
24441 pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB;
24442 pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData;
24443
24444 /*-------------------------------------------------------------------------
24445 Send Get STA Request to HAL
24446 -------------------------------------------------------------------------*/
24447 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24448 wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP);
24449}
24450
24451/**
24452 @brief Process host offload Rsp function (called when a
24453 response is being received over the bus from HAL)
24454
24455 @param pWDICtx: pointer to the WLAN DAL context
24456 pEventData: pointer to the event information structure
24457
24458 @see
24459 @return Result of the function call
24460*/
24461WDI_Status
24462WDI_ProcessGtkOffloadRsp
24463(
24464 WDI_ControlBlockType* pWDICtx,
24465 WDI_EventInfoType* pEventData
24466)
24467{
Jeff Johnson295189b2012-06-20 16:38:30 -070024468 eHalStatus halStatus;
24469 WDI_GtkOffloadCb wdiGtkOffloadCb = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024470 tHalGtkOffloadRspParams halGtkOffloadRspParams;
24471 WDI_GtkOffloadRspParams wdiGtkOffloadRsparams;
Jeff Johnson295189b2012-06-20 16:38:30 -070024472 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24473
24474 wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB;
24475
24476 /*-------------------------------------------------------------------------
24477 Sanity check
24478 -------------------------------------------------------------------------*/
24479 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24480 ( NULL == pEventData->pEventData))
24481 {
24482 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24483 "%s: Invalid parameters", __FUNCTION__);
24484 WDI_ASSERT(0);
24485 return WDI_STATUS_E_FAILURE;
24486 }
24487
24488 /*-------------------------------------------------------------------------
24489 Extract response and send it to UMAC
24490 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024491 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
24492 {
24493 wpalMemoryCopy( &halGtkOffloadRspParams,
24494 pEventData->pEventData,
24495 sizeof(halGtkOffloadRspParams));
24496
24497 wdiGtkOffloadRsparams.ulStatus =
24498 WDI_HAL_2_WDI_STATUS(halGtkOffloadRspParams.status);
24499 wdiGtkOffloadRsparams.bssIdx =
24500 halGtkOffloadRspParams.bssIdx;
24501 }
24502 else
24503 {
24504 halStatus = *((eHalStatus*)pEventData->pEventData);
24505 wdiGtkOffloadRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24506 }
Jeff Johnson295189b2012-06-20 16:38:30 -070024507
24508 /*Notify UMAC*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024509 wdiGtkOffloadCb( &wdiGtkOffloadRsparams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070024510
24511 return WDI_STATUS_SUCCESS;
24512}
24513
24514/**
24515 @brief Process GTK Offload Get Information Response function
24516
24517 @param pWDICtx: pointer to the WLAN DAL context
24518 pEventData: pointer to the event information structure
24519
24520 @see
24521 @return Result of the function call
24522*/
24523WDI_Status
24524WDI_ProcessGTKOffloadGetInfoRsp
24525(
24526 WDI_ControlBlockType* pWDICtx,
24527 WDI_EventInfoType* pEventData
24528)
24529{
Jeff Johnson295189b2012-06-20 16:38:30 -070024530 eHalStatus halStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -070024531 WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL;
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024532 tHalGtkOffloadGetInfoRspParams halGtkOffloadGetInfoRspParams;
24533 WDI_GtkOffloadGetInfoRspParams wdiGtkOffloadGetInfoRsparams;
Jeff Johnson295189b2012-06-20 16:38:30 -070024534
24535 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24536
24537 wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB;
24538
24539 /*-------------------------------------------------------------------------
24540 Sanity check
24541 -------------------------------------------------------------------------*/
24542 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24543 ( NULL == pEventData->pEventData ))
24544 {
24545 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24546 "%s: Invalid parameters", __FUNCTION__);
24547 WDI_ASSERT(0);
24548 return WDI_STATUS_E_FAILURE;
24549 }
24550
24551 /*-------------------------------------------------------------------------
24552 Extract response and send it to UMAC
24553 -------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024554 if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION))
24555 {
24556 wpalMemoryCopy( &halGtkOffloadGetInfoRspParams,
24557 pEventData->pEventData,
24558 sizeof(halGtkOffloadGetInfoRspParams));
Jeff Johnson295189b2012-06-20 16:38:30 -070024559
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024560 wdiGtkOffloadGetInfoRsparams.ulStatus =
24561 WDI_HAL_2_WDI_STATUS(halGtkOffloadGetInfoRspParams.status);
24562 wdiGtkOffloadGetInfoRsparams.ullKeyReplayCounter =
24563 halGtkOffloadGetInfoRspParams.ullKeyReplayCounter;
24564 wdiGtkOffloadGetInfoRsparams.ulTotalRekeyCount =
24565 halGtkOffloadGetInfoRspParams.ulTotalRekeyCount;
24566 wdiGtkOffloadGetInfoRsparams.ulGTKRekeyCount =
24567 halGtkOffloadGetInfoRspParams.ulGTKRekeyCount;
24568 wdiGtkOffloadGetInfoRsparams.ulIGTKRekeyCount =
24569 halGtkOffloadGetInfoRspParams.ulIGTKRekeyCount;
24570 wdiGtkOffloadGetInfoRsparams.bssIdx =
24571 halGtkOffloadGetInfoRspParams.bssIdx;
24572 }
24573 else
24574 {
24575 halStatus = *((eHalStatus*)pEventData->pEventData);
24576 wdiGtkOffloadGetInfoRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24577 }
Jeff Johnson295189b2012-06-20 16:38:30 -070024578 /*Notify UMAC*/
24579 //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData);
24580 //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData);
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -070024581 wdiGtkOffloadGetInfoCb(&wdiGtkOffloadGetInfoRsparams, pWDICtx->pRspCBUserData);
Jeff Johnson295189b2012-06-20 16:38:30 -070024582
24583 return WDI_STATUS_SUCCESS;
24584}
24585#endif // WLAN_FEATURE_GTK_OFFLOAD
24586
24587#ifdef WLAN_WAKEUP_EVENTS
24588WDI_Status
24589WDI_ProcessWakeReasonInd
24590(
24591 WDI_ControlBlockType* pWDICtx,
24592 WDI_EventInfoType* pEventData
24593)
24594{
24595 WDI_LowLevelIndType *pWdiInd;
24596 tpWakeReasonParams pWakeReasonParams;
24597 wpt_uint32 allocSize = 0;
24598
24599 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24600 "+%s", __FUNCTION__);
24601
24602 /*-------------------------------------------------------------------------
24603 Sanity check
24604 -------------------------------------------------------------------------*/
24605 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24606 ( NULL == pEventData->pEventData ))
24607 {
24608 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24609 "%s: Invalid parameters", __FUNCTION__);
24610 WDI_ASSERT( 0 );
24611 return WDI_STATUS_E_FAILURE;
24612 }
24613
24614 /*-------------------------------------------------------------------------
24615 Extract indication and send it to UMAC
24616 -------------------------------------------------------------------------*/
24617 pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData);
24618
24619 allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1);
24620
24621 //Allocate memory for WDI_WakeReasonIndType structure
24622 pWdiInd = wpalMemoryAllocate(allocSize) ;
24623
24624 if(NULL == pWdiInd)
24625 {
24626 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24627 "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ",
24628 __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData);
24629 WDI_ASSERT(0);
24630 return WDI_STATUS_E_FAILURE;
24631 }
24632
24633 wpalMemoryZero(pWdiInd, allocSize);
24634
24635 /* Fill in the indication parameters*/
24636 // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams
24637 pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND;
24638 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason;
24639 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg;
24640 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen;
24641 pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen;
24642 wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]),
24643 &(pWakeReasonParams->aDataStart[0]),
24644 pWakeReasonParams->ulStoredDataLen);
24645
24646 /*Notify UMAC*/
24647 pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData );
24648
24649 //Free memory allocated for WDI_WakeReasonIndType structure
24650 wpalMemoryFree(pWdiInd);
24651
24652 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24653 "-%s", __FUNCTION__);
24654
24655 return WDI_STATUS_SUCCESS;
24656}
24657#endif // WLAN_WAKEUP_EVENTS
24658
24659void WDI_GetWcnssCompiledApiVersion
24660(
24661 WDI_WlanVersionType *pWcnssApiVersion
24662)
24663{
24664 pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR;
24665 pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR;
24666 pWcnssApiVersion->version = WLAN_HAL_VER_VERSION;
24667 pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION;
24668}
24669
24670/**
24671 @brief Process Set TM Level Rsp function (called when a
24672 response is being received over the bus from HAL)
24673
24674 @param pWDICtx: pointer to the WLAN DAL context
24675 pEventData: pointer to the event information structure
24676
24677 @see
24678 @return Result of the function call
24679*/
24680WDI_Status
24681WDI_ProcessSetTmLevelRsp
24682(
24683 WDI_ControlBlockType* pWDICtx,
24684 WDI_EventInfoType* pEventData
24685)
24686{
24687 WDI_Status wdiStatus;
24688 eHalStatus halStatus;
24689 WDI_SetTmLevelCb wdiSetTmLevelCb;
24690 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24691
24692 /*-------------------------------------------------------------------------
24693 Sanity check
24694 -------------------------------------------------------------------------*/
24695 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24696 ( NULL == pEventData->pEventData ))
24697 {
24698 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24699 "%s: Invalid parameters", __FUNCTION__);
24700 WDI_ASSERT(0);
24701 return WDI_STATUS_E_FAILURE;
24702 }
24703
24704 wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB;
24705
24706 /*-------------------------------------------------------------------------
24707 Extract response and send it to UMAC
24708 -------------------------------------------------------------------------*/
24709 halStatus = *((eHalStatus*)pEventData->pEventData);
24710 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
24711
24712 /*Notify UMAC*/
24713 wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData);
24714
24715 return WDI_STATUS_SUCCESS;
24716}/*WDI_ProcessSetTmLevelRsp*/
24717
24718/**
24719 @brief Process Set Thermal Mitigation level Changed request
24720
24721 @param pWDICtx: pointer to the WLAN DAL context
24722 pEventData: pointer to the event information structure
24723
24724 @see
24725 @return Result of the function call
24726*/
24727WDI_Status
24728WDI_ProcessSetTmLevelReq
24729(
24730 WDI_ControlBlockType* pWDICtx,
24731 WDI_EventInfoType* pEventData
24732)
24733{
24734 WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL;
24735 WDI_SetTmLevelCb wdiSetTmLevelCb = NULL;
24736 wpt_uint8* pSendBuffer = NULL;
24737 wpt_uint16 usDataOffset = 0;
24738 wpt_uint16 usSendSize = 0;
24739 tSetThermalMitgationType halTmMsg;
24740
24741 /*-------------------------------------------------------------------------
24742 Sanity check
24743 -------------------------------------------------------------------------*/
24744 if (( NULL == pEventData ) ||
24745 ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) ||
24746 ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc)))
24747 {
24748 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24749 "%s: Invalid parameters", __FUNCTION__);
24750 WDI_ASSERT(0);
24751 return WDI_STATUS_E_FAILURE;
24752 }
24753
24754 /*-----------------------------------------------------------------------
24755 Get message buffer
24756 -----------------------------------------------------------------------*/
24757 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ,
24758 sizeof(halTmMsg),
24759 &pSendBuffer, &usDataOffset, &usSendSize))||
24760 ( usSendSize < (usDataOffset + sizeof(halTmMsg) )))
24761 {
24762 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24763 "Unable to get send buffer in Set PNO req %x %x %x",
24764 pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb);
24765 WDI_ASSERT(0);
24766 return WDI_STATUS_E_FAILURE;
24767 }
24768
24769 halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode;
24770 halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel;
24771
24772 wpalMemoryCopy( pSendBuffer+usDataOffset,
24773 &halTmMsg,
24774 sizeof(halTmMsg));
24775
24776 pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData;
24777 pWDICtx->pfncRspCB = NULL;
24778 /*-------------------------------------------------------------------------
24779 Send Get STA Request to HAL
24780 -------------------------------------------------------------------------*/
24781 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24782 wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP);
24783}
24784
24785/* Fill the value from the global features enabled array to the global capabilities
24786 * bitmap struct
24787 */
24788static void
24789FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len)
24790{
24791 wpt_int8 i;
24792 for (i=0; i<len; i++)
24793 {
24794 setFeatCaps(fCaps, enabledFeat[i]);
24795 }
24796}
24797
24798/**
24799 @brief WDI_featureCapsExchangeReq
24800 Post feature capability bitmap exchange event.
24801 Host will send its own capability to FW in this req and
24802 expect FW to send its capability back as a bitmap in Response
24803
24804 @param
24805
24806 wdiFeatureCapsExchangeCb: callback called on getting the response.
24807 It is kept to mantain similarity between WDI reqs and if needed, can
24808 be used in future. Currently, It is set to NULL
24809
24810 pUserData: user data will be passed back with the
24811 callback
24812
24813 @see
24814 @return Result of the function call
24815*/
24816WDI_Status
24817WDI_featureCapsExchangeReq
24818(
24819 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb,
24820 void* pUserData
24821)
24822{
24823 WDI_EventInfoType wdiEventData;
24824 wpt_int32 fCapsStructSize;
24825
24826 /*------------------------------------------------------------------------
24827 Sanity Check
24828 ------------------------------------------------------------------------*/
24829 if ( eWLAN_PAL_FALSE == gWDIInitialized )
24830 {
24831 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24832 "WDI API call before module is initialized - Fail request");
24833
24834 return WDI_STATUS_E_NOT_ALLOWED;
24835 }
24836
24837 /* Allocate memory separately for global variable carrying FW caps */
24838 fCapsStructSize = sizeof(tWlanFeatCaps);
24839 gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24840 if ( NULL == gpHostWlanFeatCaps )
24841 {
24842 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24843 "Cannot allocate memory for host capability info\n");
24844 WDI_ASSERT(0);
24845 return WDI_STATUS_MEM_FAILURE;
24846 }
24847
24848 wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize);
24849
24850 /*------------------------------------------------------------------------
24851 Fill in Event data and post to the Main FSM
24852 ------------------------------------------------------------------------*/
24853 FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures,
24854 (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0])));
Jeff Johnsone7245742012-09-05 17:12:55 -070024855 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24856 "Host caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024857 gpHostWlanFeatCaps->featCaps[0],
24858 gpHostWlanFeatCaps->featCaps[1],
24859 gpHostWlanFeatCaps->featCaps[2],
24860 gpHostWlanFeatCaps->featCaps[3]
24861 );
24862
24863 wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ;
24864 wdiEventData.pEventData = gpHostWlanFeatCaps;
24865 wdiEventData.uEventDataSize = fCapsStructSize;
24866 wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb;
24867 wdiEventData.pUserData = pUserData;
24868
24869 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
24870}
24871
24872/**
24873 @brief Process Host-FW Capability Exchange Request function
24874
24875 @param pWDICtx: pointer to the WLAN DAL context
24876 pEventData: pointer to the event information structure
24877
24878 @see
24879 @return Result of the function call
24880*/
24881WDI_Status
24882WDI_ProcessFeatureCapsExchangeReq
24883(
24884 WDI_ControlBlockType* pWDICtx,
24885 WDI_EventInfoType* pEventData
24886)
24887{
24888 wpt_uint8* pSendBuffer = NULL;
24889 wpt_uint16 usDataOffset = 0;
24890 wpt_uint16 usSendSize = 0;
24891 wpt_uint16 usLen = 0;
24892
24893 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24894
24895 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24896 "%s", __FUNCTION__);
24897
24898 /*-------------------------------------------------------------------------
24899 Sanity check
24900 -------------------------------------------------------------------------*/
24901 /* Call back function is NULL since not required for cap exchange req */
24902 if (( NULL == pEventData ) ||
24903 ( NULL == (tWlanFeatCaps *)pEventData->pEventData))
24904 {
24905 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24906 "%s: Invalid parameters", __FUNCTION__);
24907 WDI_ASSERT(0);
24908 return WDI_STATUS_E_FAILURE;
24909 }
24910
24911 /*-----------------------------------------------------------------------
24912 Get message buffer
24913 -----------------------------------------------------------------------*/
24914 usLen = sizeof(tWlanFeatCaps);
24915
24916 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
24917 WDI_FEATURE_CAPS_EXCHANGE_REQ,
24918 usLen,
24919 &pSendBuffer, &usDataOffset, &usSendSize))||
24920 ( usSendSize < (usDataOffset + usLen )))
24921 {
24922 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
24923 "Unable to get send buffer in feat caps exchange req %x %x",
24924 pEventData, (tWlanFeatCaps *)pEventData->pEventData);
24925 WDI_ASSERT(0);
24926 return WDI_STATUS_E_FAILURE;
24927 }
24928
24929 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Jeff Johnsone7245742012-09-05 17:12:55 -070024930 "Host Caps - %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070024931 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0],
24932 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1],
24933 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2],
24934 ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3]
24935 );
24936
24937 /* Copy host caps after the offset in the send buffer */
24938 wpalMemoryCopy( pSendBuffer+usDataOffset,
24939 (tWlanFeatCaps *)pEventData->pEventData,
24940 usLen);
24941
24942 /*-------------------------------------------------------------------------
24943 Send Start Request to HAL
24944 -------------------------------------------------------------------------*/
24945 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
24946 (WDI_StartRspCb)pEventData->pCBfnc,
24947 pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP);
24948
24949}/*WDI_ProcessFeatureCapsExchangeReq*/
24950
24951/**
24952 @brief Process Host-FW Capability Exchange Response function
24953
24954 @param pWDICtx: pointer to the WLAN DAL context
24955 pEventData: pointer to the event information structure
24956
24957 @see
24958 @return Result of the function call
24959*/
24960WDI_Status
24961WDI_ProcessFeatureCapsExchangeRsp
24962(
24963 WDI_ControlBlockType* pWDICtx,
24964 WDI_EventInfoType* pEventData
24965)
24966{
24967 WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb;
24968 wpt_int32 fCapsStructSize;
24969 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24970
24971 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
24972 "%s", __FUNCTION__);
24973
24974 /*-------------------------------------------------------------------------
24975 Sanity check
24976 -------------------------------------------------------------------------*/
24977 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
24978 ( NULL == pEventData->pEventData ))
24979 {
24980 /* It will go here when riva is old (doesn't understand this msg) and host is new */
24981 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
24982 "%s: Invalid parameters", __FUNCTION__);
24983 WDI_ASSERT(0);
24984 return WDI_STATUS_E_FAILURE;
24985 }
24986
24987 /* Allocate memory separately for global variable carrying FW caps */
24988 fCapsStructSize = sizeof(tWlanFeatCaps);
24989 gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize);
24990 if ( NULL == gpFwWlanFeatCaps )
24991 {
24992 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
24993 "Cannot allocate memory for host capability info\n");
24994 WDI_ASSERT(0);
24995 return WDI_STATUS_MEM_FAILURE;
24996 }
24997
24998 /*-------------------------------------------------------------------------
24999 Unpack HAL Response Message - the header was already extracted by the
25000 main Response Handling procedure
25001 -------------------------------------------------------------------------*/
25002 /*-------------------------------------------------------------------------
25003 Extract response and send it to UMAC
25004 -------------------------------------------------------------------------*/
25005
25006 wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData,
25007 fCapsStructSize);
Jeff Johnsone7245742012-09-05 17:12:55 -070025008 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
25009 "FW caps %x %x %x %x\n",
Jeff Johnson295189b2012-06-20 16:38:30 -070025010 gpFwWlanFeatCaps->featCaps[0],
25011 gpFwWlanFeatCaps->featCaps[1],
25012 gpFwWlanFeatCaps->featCaps[2],
25013 gpFwWlanFeatCaps->featCaps[3]
25014 );
Jeff Johnsone7245742012-09-05 17:12:55 -070025015
Jeff Johnson295189b2012-06-20 16:38:30 -070025016 wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB;
25017
25018 /*Notify UMAC - there is no callback right now but can be used in future if reqd */
25019 if (wdiFeatureCapsExchangeCb != NULL)
25020 wdiFeatureCapsExchangeCb(NULL, NULL);
25021
25022 return WDI_STATUS_SUCCESS;
25023}
25024
Mohit Khanna4a70d262012-09-11 16:30:12 -070025025#ifdef WLAN_FEATURE_11AC
25026WDI_Status
25027WDI_ProcessUpdateVHTOpModeRsp
25028(
25029 WDI_ControlBlockType* pWDICtx,
25030 WDI_EventInfoType* pEventData
25031)
25032{
25033 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
25034 WDI_Status wdiStatus;
25035 eHalStatus halStatus;
25036
25037 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
25038
25039 /*-------------------------------------------------------------------------
25040 Sanity check
25041 -------------------------------------------------------------------------*/
25042 if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
25043 ( NULL == pEventData->pEventData))
25044 {
25045 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25046 "%s: Invalid parameters", __FUNCTION__);
25047 WDI_ASSERT(0);
25048 return WDI_STATUS_E_FAILURE;
25049 }
25050 wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc;
25051
25052 /*-------------------------------------------------------------------------
25053 Extract response and send it to UMAC
25054 -------------------------------------------------------------------------*/
25055 halStatus = *((eHalStatus*)pEventData->pEventData);
25056 wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
25057
25058 /*Notify UMAC*/
25059 wdiVHTOpModeCb( wdiStatus, pEventData->pUserData);
25060
25061 return WDI_STATUS_SUCCESS;
25062}
25063#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070025064/**
25065 @brief WDI_getHostWlanFeatCaps
25066 WDI API that returns whether the feature passed to it as enum value in
25067 "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global
25068 variable storing host capability bitmap to find this. This can be used by
25069 other moduels to decide certain things like call different APIs based on
25070 whether a particular feature is supported.
25071
25072 @param
25073
25074 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h.
25075
25076 @see
25077 @return
25078 0 - if the feature is NOT supported in host
25079 any non-zero value - if the feature is SUPPORTED in host.
25080*/
25081wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value)
25082{
25083 wpt_uint8 featSupported = 0;
25084 if (gpHostWlanFeatCaps != NULL)
25085 {
25086 getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported);
25087 }
25088 else
25089 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025090 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070025091 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070025092 }
25093 return featSupported;
25094}
25095
25096/**
25097 @brief WDI_getFwWlanFeatCaps
25098 WDI API that returns whether the feature passed to it as enum value in
25099 "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global
25100 variable storing host capability bitmap to find this. This can be used by
25101 other moduels to decide certain things like call different APIs based on
25102 whether a particular feature is supported.
25103
25104 @param
25105
25106 feat_enum_value: enum value for the feature as in placeHolderInCapBitmap
25107 in wlan_hal_msg.h.
25108
25109 @see
25110 @return
25111 0 - if the feature is NOT supported in FW
25112 any non-zero value - if the feature is SUPPORTED in FW.
25113*/
25114wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value)
25115{
25116 wpt_uint8 featSupported = 0;
25117 if (gpFwWlanFeatCaps != NULL)
25118 {
25119 getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported);
25120 }
25121 else
25122 {
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025123 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -070025124 "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value);
Jeff Johnson295189b2012-06-20 16:38:30 -070025125 }
25126 return featSupported;
25127}
Mohit Khanna4a70d262012-09-11 16:30:12 -070025128
25129#ifdef WLAN_FEATURE_11AC
25130WDI_Status
25131WDI_ProcessUpdateVHTOpModeReq
25132(
25133 WDI_ControlBlockType* pWDICtx,
25134 WDI_EventInfoType* pEventData
25135)
25136{
25137 WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL;
25138 WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL;
25139 wpt_uint8* pSendBuffer = NULL;
25140 wpt_uint16 usDataOffset = 0;
25141 wpt_uint16 usSendSize = 0;
25142
25143 /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
25144
25145 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
25146 "%s", __FUNCTION__);
25147
25148 /*-------------------------------------------------------------------------
25149 Sanity check
25150 -------------------------------------------------------------------------*/
25151 if (( NULL == pEventData ) ||
25152 ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) ||
25153 ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc)))
25154 {
25155 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25156 "%s: Invalid parameters", __FUNCTION__);
25157 WDI_ASSERT(0);
25158 return WDI_STATUS_E_FAILURE;
25159 }
25160
25161 /*-----------------------------------------------------------------------
25162 Get message buffer
25163 -----------------------------------------------------------------------*/
25164 if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ,
25165 sizeof(WDI_UpdateVHTOpMode),
25166 &pSendBuffer, &usDataOffset, &usSendSize))||
25167 ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) )))
25168 {
25169 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25170 "Unable to get send buffer in update vht opMode req");
25171 WDI_ASSERT(0);
25172 return WDI_STATUS_E_FAILURE;
25173 }
25174
25175 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25176 "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId);
25177
25178 wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams,
25179 sizeof(WDI_UpdateVHTOpMode));
25180
25181 /*-------------------------------------------------------------------------
25182 Send Start Request to HAL
25183 -------------------------------------------------------------------------*/
25184 return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
25185 wdiVHTOpModeCb,
25186 pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP);
25187
25188}
25189
25190WDI_Status
25191WDI_UpdateVHTOpModeReq
25192(
25193 WDI_UpdateVHTOpMode *pData,
25194 WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb,
25195 void* pUserData
25196)
25197{
25198 WDI_EventInfoType wdiEventData;
25199
25200 /*------------------------------------------------------------------------
25201 Sanity Check
25202 ------------------------------------------------------------------------*/
25203 if ( eWLAN_PAL_FALSE == gWDIInitialized )
25204 {
25205 WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
25206 "WDI API call before module is initialized - Fail request");
25207
25208 return WDI_STATUS_E_NOT_ALLOWED;
25209 }
25210
25211 /*------------------------------------------------------------------------
25212 Fill in Event data and post to the Main FSM
25213 ------------------------------------------------------------------------*/
25214 wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ;
25215 wdiEventData.pEventData = pData;
25216 wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode);
25217 wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb;
25218 wdiEventData.pUserData = pUserData;
25219
25220 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
25221 "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId);
25222
25223 return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
25224
25225}
25226#endif
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025227
25228/**
25229 @brief WDI_TransportChannelDebug -
25230 Display DXE Channel debugging information
25231 User may request to display DXE channel snapshot
25232 Or if host driver detects any abnormal stcuk may display
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -070025233
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025234 @param displaySnapshot : Dispaly DXE snapshot option
25235 @param enableStallDetect : Enable stall detect feature
25236 This feature will take effect to data performance
25237 Not integrate till fully verification
25238 @see
25239 @return none
25240*/
25241void WDI_TransportChannelDebug
25242(
25243 wpt_boolean displaySnapshot,
Madan Mohan Koyyalamudi48139e32012-10-11 14:43:56 -070025244 wpt_boolean toggleStallDetect,
25245 wpt_boolean fullChannelsDump
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025246)
25247{
Madan Mohan Koyyalamudi48139e32012-10-11 14:43:56 -070025248 WDTS_ChannelDebug(displaySnapshot, toggleStallDetect, fullChannelsDump);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070025249 return;
Madan Mohan Koyyalamudi3352adb2012-09-28 14:57:24 -070025250}