blob: f0626679074f81734593bf8ed5a9d2d9684a6ac9 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
3 *
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
175 WLANDXE_SetPowerStateCbType
176
177 @ Description
178 DXE Set power state ACK callback. This callback function should be
179 invoked by the DXE to notify WDI that set power state request is complete
180
181 @ Parameters
182 status status of the set operation
183 pUserData Cookie that should be passed back to the caller along with the
184 callback.
185
186 @ Return
187 None
188===========================================================================*/
189typedef WDTS_SetPSCbType WLANDXE_SetPowerStateCbType;
190
191/*-------------------------------------------------------------------------
192 *Function declarations and documenation
193 *-------------------------------------------------------------------------*/
194/*==========================================================================
195 @ Function Name
196 WLANDXE_Open
197
198 @ Description
199 Open host DXE driver, allocate DXE resources
200 Allocate, DXE local control block, DXE descriptor pool, DXE descriptor control block pool
201
202 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800203 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700204
205 @ Return
206 pVoid DXE local module control block pointer
207===========================================================================*/
208void *WLANDXE_Open
209(
210 void
211);
212
213/*==========================================================================
214 @ Function Name
215 WLANDXE_ClientRegistration
216
217 @ Description
218 Make callback functions registration into DXE driver from DXE driver client
219
220 @ Parameters
221 pVoid pDXEContext : DXE module control block
222 WDTS_RxFrameReadyCbType rxFrameReadyCB : RX Frame ready CB function pointer
223 WDTS_TxCompleteCbType txCompleteCB : TX complete CB function pointer
224 WDTS_LowResourceCbType lowResourceCB : Low DXE resource notification CB function pointer
225 void *userContext : DXE Cliennt control block
226
227 @ Return
228 wpt_status
229===========================================================================*/
230wpt_status WLANDXE_ClientRegistration
231(
232 void *pDXEContext,
233 WDTS_RxFrameReadyCbType rxFrameReadyCB,
234 WDTS_TxCompleteCbType txCompleteCB,
235 WDTS_LowResourceCbType lowResourceCB,
236 void *userContext
237);
238
239/*==========================================================================
240 @ Function Name
241 WLANDXE_Start
242
243 @ Description
244 Start Host DXE driver
245 Initialize DXE channels and start channel
246
247 @ Parameters
248 pVoid pDXEContext : DXE module control block
249
250 @ Return
251 wpt_status
252===========================================================================*/
253wpt_status WLANDXE_Start
254(
255 void *pDXEContext
256);
257
258/*==========================================================================
259 @ Function Name
260 WLANDXE_TXFrame
261
262 @ Description
263 Trigger frame transmit from host to RIVA
264
265 @ Parameters
266 pVoid pDXEContext : DXE Control Block
267 wpt_packet pPacket : transmit packet structure
268 WDTS_ChannelType channel : TX channel
269
270 @ Return
271 wpt_status
272===========================================================================*/
273wpt_status WLANDXE_TxFrame
274(
275 void *pDXEContext,
276 wpt_packet *pPacket,
277 WDTS_ChannelType channel
278);
279
280
281/*==========================================================================
282 @ Function Name
283 WLANDXE_CompleteTX
284
285 @ Description
286 Informs DXE that the current series of Tx packets is complete
287
288 @ Parameters
289 pDXEContext : DXE Control Block
290 ucTxResReq TX resource number required by TL/WDI
291
292 @ Return
293 wpt_status
294===========================================================================*/
295wpt_status
296WLANDXE_CompleteTX
297(
298 void* pDXEContext,
299 wpt_uint32 ucTxResReq
300);
301
302/*==========================================================================
303 @ Function Name
304 WLANDXE_Stop
305
306 @ Description
307 Stop DXE channels and DXE engine operations
308
309 @ Parameters
310 pVoid pDXEContext : DXE Control Block
311
312 @ Return
313 wpt_status
314===========================================================================*/
315wpt_status WLANDXE_Stop
316(
317 void *pDXEContext
318);
319
320/*==========================================================================
321 @ Function Name
322 WLANDXE_Close
323
324 @ Description
325 Close DXE channels
326 Free DXE related resources
327 DXE descriptor free
328 Descriptor control block free
329 Pre allocated RX buffer free
330
331 @ Parameters
332 pVoid pDXEContext : DXE Control Block
333
334 @ Return
335 wpt_status
336===========================================================================*/
337wpt_status WLANDXE_Close
338(
339 void *pDXEContext
340);
341
342/*==========================================================================
343 @ Function Name
344 WLANDXE_TriggerTX
345
346 @ Description
347 TBD
348
349 @ Parameters
350 pVoid pDXEContext : DXE Control Block
351
352 @ Return
353 wpt_status
354===========================================================================*/
355wpt_status WLANDXE_TriggerTX
356(
357 void *pDXEContext
358);
359
360/*==========================================================================
361 @ Function Name
362 WLANDXE_SetPowerState
363
364 @ Description
365 From Client let DXE knows what is the WLAN HW(RIVA) power state
366
367 @ Parameters
368 pVoid pDXEContext : DXE Control Block
369 WLANDXE_PowerStateType powerState
370
371 @ Return
372 wpt_status
373===========================================================================*/
374wpt_status WLANDXE_SetPowerState
375(
376 void *pDXEContext,
377 WDTS_PowerStateType powerState,
378 WDTS_SetPSCbType cBack
379);
380
381/*==========================================================================
382 @ Function Name
383 WLANDXE_GetFreeTxDataResNumber
384
385 @ Description
386 Returns free descriptor numbers for TX data channel (TX high priority)
387
388 @ Parameters
389 pVoid pDXEContext : DXE Control Block
390
391 @ Return
392 wpt_uint32 Free descriptor number of TX high pri ch
393===========================================================================*/
394wpt_uint32 WLANDXE_GetFreeTxDataResNumber
395(
396 void *pDXEContext
397);
398
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700399/*==========================================================================
400 @ Function Name
401 WLANDXE_ChannelDebug
402
403 @ Description
404 Display DXE Channel debugging information
405 User may request to display DXE channel snapshot
406 Or if host driver detects any abnormal stcuk may display
407
408 @ Parameters
Jeff Johnsonb88db982012-12-10 13:34:59 -0800409 displaySnapshot : Display DXE snapshot option
Mihir Shete40a55652014-03-02 14:14:47 +0530410 debugFlags : Enable stall detect features
411 defined by WPAL_DeviceDebugFlags
412 These features may effect
413 data performance.
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700414
415 @ Return
416 NONE
417
418===========================================================================*/
419void WLANDXE_ChannelDebug
420(
421 wpt_boolean displaySnapshot,
Mihir Shete40a55652014-03-02 14:14:47 +0530422 wpt_uint8 debugFlags
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700423);
424
Jeff Johnson295189b2012-06-20 16:38:30 -0700425#ifdef WLANDXE_TEST_CHANNEL_ENABLE
426/*==========================================================================
427 @ Function Name
428 WLANDXE_UnitTest
429
430 @ Description
431 Temporary for the DXE module test
432
433 @ Parameters
434 NONE
435
436 @ Return
437 NONE
438
439===========================================================================*/
440void WLANDXE_UnitTestStartDXE
441(
442 void
443);
444
445/*==========================================================================
446 @ Function Name
447
448 @ Description
449
450 @ Parameters
451
452 @ Return
453
454===========================================================================*/
455void WLANDXE_UnitTestDataTransfer
456(
457 void
458);
459
460/*==========================================================================
461 @ Function Name
462
463 @ Description
464
465 @ Parameters
466
467 @ Return
468
469===========================================================================*/
470void WLANDXE_UnitTestEventHandle
471(
472 void *dxeCB
473);
474#endif /* WLANDXE_TEST_CHANNEL_ENABLE */
475#endif /* WLAN_QCT_DXE_H */