blob: b089ac96fd795ab8280882e98067f3c71446e094 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Satyanarayana Dashe5482b52015-04-06 16:36:08 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Jeff Johnson295189b2012-06-20 16:38:30 -070028#ifndef WLAN_QCT_DXE_H
29#define WLAN_QCT_DXE_H
30
31/**=========================================================================
32
33 @file wlan_qct_dxe.h
34
35 @brief
36
37 This file contains the external API exposed by the wlan data transfer abstraction layer module.
Jeff Johnson295189b2012-06-20 16:38:30 -070038========================================================================*/
39
40/*===========================================================================
41
42 EDIT HISTORY FOR FILE
43
44
45 This section contains comments describing changes made to the module.
46 Notice that changes are listed in reverse chronological order.
47
48
49 $Header:$ $DateTime: $ $Author: $
50
51
52when who what, where, why
53-------- --- ----------------------------------------------------------
5408/03/10 schang Created module.
55
56===========================================================================*/
57
58/*===========================================================================
59
60 INCLUDE FILES FOR MODULE
61
62===========================================================================*/
63
64/*----------------------------------------------------------------------------
65 * Include Files
66 * -------------------------------------------------------------------------*/
67#include "wlan_qct_pal_api.h"
68#include "wlan_qct_pal_packet.h"
69#include "wlan_qct_pal_status.h"
70#include "wlan_qct_pal_type.h"
71#include "wlan_qct_pal_msg.h"
72#include "wlan_qct_pal_sync.h"
73#include "wlan_qct_wdi_dts.h"
74
75/*----------------------------------------------------------------------------
76 * Type Declarations
77 * -------------------------------------------------------------------------*/
78/* DXE Descriptor contents SWAP option flag */
79
80//#define WLANDXE_ENDIAN_SWAP_ENABLE
81
82/* Default RX OS frame buffer size
83 * Size must be same with Vos Packet Size */
84#define WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE (VPKT_SIZE_BUFFER)
85
86/*The maximum number of packets that can be chained in dxe for the Low
87 priority channel
88 Note: Increased it to 240 from 128 for Windows(EA) becase Windows is
89 able to push 2~6 packet chain in one NET_BUFFER. It causes TX low
90 resource condition more easily than LA. It ends up to cause low
91 throughut number and spend more CPU time*/
92#ifdef WINDOWS_DT
93#define WLANDXE_LO_PRI_RES_NUM 240
94#else
95#define WLANDXE_LO_PRI_RES_NUM 128
96#endif
97
98
99/*The maximum number of packets that can be chained in dxe for the HI
100 priority channel */
101#define WLANDXE_HI_PRI_RES_NUM 10
102
103typedef enum
104{
105 WLANDXE_POWER_STATE_FULL,
106 WLANDXE_POWER_STATE_IMPS,
107 WLANDXE_POWER_STATE_BMPS,
108 WLANDXE_POWER_STATE_BMPS_PENDING,
109 WLANDXE_POWER_STATE_DOWN,
110 WLANDXE_POWER_STATE_MAX
111} WLANDXE_PowerStateType;
112
113typedef enum
114{
115 WLANDXE_RIVA_POWER_STATE_ACTIVE,
116 WLANDXE_RIVA_POWER_STATE_IMPS_UNKNOWN,
117 WLANDXE_RIVA_POWER_STATE_BMPS_UNKNOWN,
118 WLANDXE_RIVA_POWER_STATE_DOWN_UNKNOWN,
119 WLANDXE_RIVA_POWER_STATE_MAX
120} WLANDXE_RivaPowerStateType;
121
122/*==========================================================================
123 @ Type Name
124 WLANDXE_RxFrameReadyCbType
125
126 @ Description
127 RX Frame Ready indication CB
128
129 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800130 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700131 palPacket pRXFramePtr : Received Frame Pointer
132 pVoid userCtxt : DTS user contect pointer
133
134 @ Return
135 wpt_status
136===========================================================================*/
137typedef WDTS_RxFrameReadyCbType WLANDXE_RxFrameReadyCbType;
138
139/*==========================================================================
140 @ Type Name
141 WLANDXE_TxCompleteCbType
142
143 @ Description
144 TX complete indication CB
145
146 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800147 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700148 void pTXFramePtr : Completed TX Frame Pointer
149 pVoid userCtxt : DTS user contect pointer
150
151 @ Return
152 wpt_status
153===========================================================================*/
154typedef WDTS_TxCompleteCbType WLANDXE_TxCompleteCbType;
155
156/*==========================================================================
157 @ Type Name
158 WLANDXE_LowResourceCbType
159
160 @ Description
161 DXE Low resource indication CB
162
163 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800164 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700165 BOOL lowResourceCondition : DXE low resource or not
166 pVoid userCtxt : DTS user contect pointer
167
168 @ Return
169 wpt_status
170===========================================================================*/
171typedef WDTS_LowResourceCbType WLANDXE_LowResourceCbType;
172
173/*==========================================================================
174 @ Type Name
Mihir Shetec4093f92015-05-28 15:21:11 +0530175 WLANDXE_MbReceiveMsgCbType
176
177 @ Description
178 DXE Mailbox mes receive indiacation
179
180 @ Parameters
181 void
182
183 @ Return
184 void
185===========================================================================*/
186typedef WDTS_MbReceiveMsgType WLANDXE_MbReceiveMsgCbType;
187
188/*==========================================================================
189 @ Type Name
Jeff Johnson295189b2012-06-20 16:38:30 -0700190 WLANDXE_SetPowerStateCbType
191
192 @ Description
193 DXE Set power state ACK callback. This callback function should be
194 invoked by the DXE to notify WDI that set power state request is complete
195
196 @ Parameters
197 status status of the set operation
198 pUserData Cookie that should be passed back to the caller along with the
199 callback.
200
201 @ Return
202 None
203===========================================================================*/
204typedef WDTS_SetPSCbType WLANDXE_SetPowerStateCbType;
205
206/*-------------------------------------------------------------------------
207 *Function declarations and documenation
208 *-------------------------------------------------------------------------*/
209/*==========================================================================
210 @ Function Name
211 WLANDXE_Open
212
213 @ Description
214 Open host DXE driver, allocate DXE resources
215 Allocate, DXE local control block, DXE descriptor pool, DXE descriptor control block pool
216
217 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800218 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700219
220 @ Return
221 pVoid DXE local module control block pointer
222===========================================================================*/
223void *WLANDXE_Open
224(
225 void
226);
227
228/*==========================================================================
229 @ Function Name
230 WLANDXE_ClientRegistration
231
232 @ Description
233 Make callback functions registration into DXE driver from DXE driver client
234
235 @ Parameters
236 pVoid pDXEContext : DXE module control block
Mihir Shetec4093f92015-05-28 15:21:11 +0530237 WDTS_ClientCallbacks WDTSCb : Callbacks to WDTS to indicate various events
Jeff Johnson295189b2012-06-20 16:38:30 -0700238 void *userContext : DXE Cliennt control block
239
240 @ Return
241 wpt_status
242===========================================================================*/
243wpt_status WLANDXE_ClientRegistration
244(
245 void *pDXEContext,
Mihir Shetec4093f92015-05-28 15:21:11 +0530246 WDTS_ClientCallbacks WDTSCb,
Jeff Johnson295189b2012-06-20 16:38:30 -0700247 void *userContext
248);
249
250/*==========================================================================
251 @ Function Name
252 WLANDXE_Start
253
254 @ Description
255 Start Host DXE driver
256 Initialize DXE channels and start channel
257
258 @ Parameters
259 pVoid pDXEContext : DXE module control block
260
261 @ Return
262 wpt_status
263===========================================================================*/
264wpt_status WLANDXE_Start
265(
266 void *pDXEContext
267);
268
269/*==========================================================================
270 @ Function Name
271 WLANDXE_TXFrame
272
273 @ Description
274 Trigger frame transmit from host to RIVA
275
276 @ Parameters
277 pVoid pDXEContext : DXE Control Block
278 wpt_packet pPacket : transmit packet structure
279 WDTS_ChannelType channel : TX channel
280
281 @ Return
282 wpt_status
283===========================================================================*/
284wpt_status WLANDXE_TxFrame
285(
286 void *pDXEContext,
287 wpt_packet *pPacket,
288 WDTS_ChannelType channel
289);
290
291
292/*==========================================================================
293 @ Function Name
294 WLANDXE_CompleteTX
295
296 @ Description
297 Informs DXE that the current series of Tx packets is complete
298
299 @ Parameters
300 pDXEContext : DXE Control Block
301 ucTxResReq TX resource number required by TL/WDI
302
303 @ Return
304 wpt_status
305===========================================================================*/
306wpt_status
307WLANDXE_CompleteTX
308(
309 void* pDXEContext,
310 wpt_uint32 ucTxResReq
311);
312
313/*==========================================================================
314 @ Function Name
315 WLANDXE_Stop
316
317 @ Description
318 Stop DXE channels and DXE engine operations
319
320 @ Parameters
321 pVoid pDXEContext : DXE Control Block
322
323 @ Return
324 wpt_status
325===========================================================================*/
326wpt_status WLANDXE_Stop
327(
328 void *pDXEContext
329);
330
331/*==========================================================================
332 @ Function Name
333 WLANDXE_Close
334
335 @ Description
336 Close DXE channels
337 Free DXE related resources
338 DXE descriptor free
339 Descriptor control block free
340 Pre allocated RX buffer free
341
342 @ Parameters
343 pVoid pDXEContext : DXE Control Block
344
345 @ Return
346 wpt_status
347===========================================================================*/
348wpt_status WLANDXE_Close
349(
350 void *pDXEContext
351);
352
353/*==========================================================================
354 @ Function Name
355 WLANDXE_TriggerTX
356
357 @ Description
358 TBD
359
360 @ Parameters
361 pVoid pDXEContext : DXE Control Block
362
363 @ Return
364 wpt_status
365===========================================================================*/
366wpt_status WLANDXE_TriggerTX
367(
368 void *pDXEContext
369);
370
371/*==========================================================================
372 @ Function Name
373 WLANDXE_SetPowerState
374
375 @ Description
376 From Client let DXE knows what is the WLAN HW(RIVA) power state
377
378 @ Parameters
379 pVoid pDXEContext : DXE Control Block
380 WLANDXE_PowerStateType powerState
381
382 @ Return
383 wpt_status
384===========================================================================*/
385wpt_status WLANDXE_SetPowerState
386(
387 void *pDXEContext,
388 WDTS_PowerStateType powerState,
389 WDTS_SetPSCbType cBack
390);
391
392/*==========================================================================
393 @ Function Name
394 WLANDXE_GetFreeTxDataResNumber
395
396 @ Description
397 Returns free descriptor numbers for TX data channel (TX high priority)
398
399 @ Parameters
400 pVoid pDXEContext : DXE Control Block
401
402 @ Return
403 wpt_uint32 Free descriptor number of TX high pri ch
404===========================================================================*/
405wpt_uint32 WLANDXE_GetFreeTxDataResNumber
406(
407 void *pDXEContext
408);
409
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700410/*==========================================================================
411 @ Function Name
412 WLANDXE_ChannelDebug
413
414 @ Description
415 Display DXE Channel debugging information
416 User may request to display DXE channel snapshot
417 Or if host driver detects any abnormal stcuk may display
418
419 @ Parameters
Jeff Johnsonb88db982012-12-10 13:34:59 -0800420 displaySnapshot : Display DXE snapshot option
Mihir Shete40a55652014-03-02 14:14:47 +0530421 debugFlags : Enable stall detect features
422 defined by WPAL_DeviceDebugFlags
423 These features may effect
424 data performance.
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700425
426 @ Return
427 NONE
428
429===========================================================================*/
430void WLANDXE_ChannelDebug
431(
432 wpt_boolean displaySnapshot,
Mihir Shete40a55652014-03-02 14:14:47 +0530433 wpt_uint8 debugFlags
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700434);
435
Jeff Johnson295189b2012-06-20 16:38:30 -0700436#endif /* WLAN_QCT_DXE_H */