blob: a4475cc3f41ff11b8b952e6888da443d2df179c6 [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.
38 Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved.
39 Qualcomm Confidential and Proprietary
40========================================================================*/
41
42/*===========================================================================
43
44 EDIT HISTORY FOR FILE
45
46
47 This section contains comments describing changes made to the module.
48 Notice that changes are listed in reverse chronological order.
49
50
51 $Header:$ $DateTime: $ $Author: $
52
53
54when who what, where, why
55-------- --- ----------------------------------------------------------
5608/03/10 schang Created module.
57
58===========================================================================*/
59
60/*===========================================================================
61
62 INCLUDE FILES FOR MODULE
63
64===========================================================================*/
65
66/*----------------------------------------------------------------------------
67 * Include Files
68 * -------------------------------------------------------------------------*/
69#include "wlan_qct_pal_api.h"
70#include "wlan_qct_pal_packet.h"
71#include "wlan_qct_pal_status.h"
72#include "wlan_qct_pal_type.h"
73#include "wlan_qct_pal_msg.h"
74#include "wlan_qct_pal_sync.h"
75#include "wlan_qct_wdi_dts.h"
76
77/*----------------------------------------------------------------------------
78 * Type Declarations
79 * -------------------------------------------------------------------------*/
80/* DXE Descriptor contents SWAP option flag */
81
82//#define WLANDXE_ENDIAN_SWAP_ENABLE
83
84/* Default RX OS frame buffer size
85 * Size must be same with Vos Packet Size */
86#define WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE (VPKT_SIZE_BUFFER)
87
88/*The maximum number of packets that can be chained in dxe for the Low
89 priority channel
90 Note: Increased it to 240 from 128 for Windows(EA) becase Windows is
91 able to push 2~6 packet chain in one NET_BUFFER. It causes TX low
92 resource condition more easily than LA. It ends up to cause low
93 throughut number and spend more CPU time*/
94#ifdef WINDOWS_DT
95#define WLANDXE_LO_PRI_RES_NUM 240
96#else
97#define WLANDXE_LO_PRI_RES_NUM 128
98#endif
99
100
101/*The maximum number of packets that can be chained in dxe for the HI
102 priority channel */
103#define WLANDXE_HI_PRI_RES_NUM 10
104
105typedef enum
106{
107 WLANDXE_POWER_STATE_FULL,
108 WLANDXE_POWER_STATE_IMPS,
109 WLANDXE_POWER_STATE_BMPS,
110 WLANDXE_POWER_STATE_BMPS_PENDING,
111 WLANDXE_POWER_STATE_DOWN,
112 WLANDXE_POWER_STATE_MAX
113} WLANDXE_PowerStateType;
114
115typedef enum
116{
117 WLANDXE_RIVA_POWER_STATE_ACTIVE,
118 WLANDXE_RIVA_POWER_STATE_IMPS_UNKNOWN,
119 WLANDXE_RIVA_POWER_STATE_BMPS_UNKNOWN,
120 WLANDXE_RIVA_POWER_STATE_DOWN_UNKNOWN,
121 WLANDXE_RIVA_POWER_STATE_MAX
122} WLANDXE_RivaPowerStateType;
123
124/*==========================================================================
125 @ Type Name
126 WLANDXE_RxFrameReadyCbType
127
128 @ Description
129 RX Frame Ready indication CB
130
131 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800132 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700133 palPacket pRXFramePtr : Received Frame Pointer
134 pVoid userCtxt : DTS user contect pointer
135
136 @ Return
137 wpt_status
138===========================================================================*/
139typedef WDTS_RxFrameReadyCbType WLANDXE_RxFrameReadyCbType;
140
141/*==========================================================================
142 @ Type Name
143 WLANDXE_TxCompleteCbType
144
145 @ Description
146 TX complete indication CB
147
148 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800149 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700150 void pTXFramePtr : Completed TX Frame Pointer
151 pVoid userCtxt : DTS user contect pointer
152
153 @ Return
154 wpt_status
155===========================================================================*/
156typedef WDTS_TxCompleteCbType WLANDXE_TxCompleteCbType;
157
158/*==========================================================================
159 @ Type Name
160 WLANDXE_LowResourceCbType
161
162 @ Description
163 DXE Low resource indication CB
164
165 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800166 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700167 BOOL lowResourceCondition : DXE low resource or not
168 pVoid userCtxt : DTS user contect pointer
169
170 @ Return
171 wpt_status
172===========================================================================*/
173typedef WDTS_LowResourceCbType WLANDXE_LowResourceCbType;
174
175/*==========================================================================
176 @ Type Name
177 WLANDXE_SetPowerStateCbType
178
179 @ Description
180 DXE Set power state ACK callback. This callback function should be
181 invoked by the DXE to notify WDI that set power state request is complete
182
183 @ Parameters
184 status status of the set operation
185 pUserData Cookie that should be passed back to the caller along with the
186 callback.
187
188 @ Return
189 None
190===========================================================================*/
191typedef WDTS_SetPSCbType WLANDXE_SetPowerStateCbType;
192
193/*-------------------------------------------------------------------------
194 *Function declarations and documenation
195 *-------------------------------------------------------------------------*/
196/*==========================================================================
197 @ Function Name
198 WLANDXE_Open
199
200 @ Description
201 Open host DXE driver, allocate DXE resources
202 Allocate, DXE local control block, DXE descriptor pool, DXE descriptor control block pool
203
204 @ Parameters
Jeff Johnsona8a1a482012-12-12 16:49:33 -0800205 pVoid pAdapter : Driver global control block pointer
Jeff Johnson295189b2012-06-20 16:38:30 -0700206
207 @ Return
208 pVoid DXE local module control block pointer
209===========================================================================*/
210void *WLANDXE_Open
211(
212 void
213);
214
215/*==========================================================================
216 @ Function Name
217 WLANDXE_ClientRegistration
218
219 @ Description
220 Make callback functions registration into DXE driver from DXE driver client
221
222 @ Parameters
223 pVoid pDXEContext : DXE module control block
224 WDTS_RxFrameReadyCbType rxFrameReadyCB : RX Frame ready CB function pointer
225 WDTS_TxCompleteCbType txCompleteCB : TX complete CB function pointer
226 WDTS_LowResourceCbType lowResourceCB : Low DXE resource notification CB function pointer
227 void *userContext : DXE Cliennt control block
228
229 @ Return
230 wpt_status
231===========================================================================*/
232wpt_status WLANDXE_ClientRegistration
233(
234 void *pDXEContext,
235 WDTS_RxFrameReadyCbType rxFrameReadyCB,
236 WDTS_TxCompleteCbType txCompleteCB,
237 WDTS_LowResourceCbType lowResourceCB,
238 void *userContext
239);
240
241/*==========================================================================
242 @ Function Name
243 WLANDXE_Start
244
245 @ Description
246 Start Host DXE driver
247 Initialize DXE channels and start channel
248
249 @ Parameters
250 pVoid pDXEContext : DXE module control block
251
252 @ Return
253 wpt_status
254===========================================================================*/
255wpt_status WLANDXE_Start
256(
257 void *pDXEContext
258);
259
260/*==========================================================================
261 @ Function Name
262 WLANDXE_TXFrame
263
264 @ Description
265 Trigger frame transmit from host to RIVA
266
267 @ Parameters
268 pVoid pDXEContext : DXE Control Block
269 wpt_packet pPacket : transmit packet structure
270 WDTS_ChannelType channel : TX channel
271
272 @ Return
273 wpt_status
274===========================================================================*/
275wpt_status WLANDXE_TxFrame
276(
277 void *pDXEContext,
278 wpt_packet *pPacket,
279 WDTS_ChannelType channel
280);
281
282
283/*==========================================================================
284 @ Function Name
285 WLANDXE_CompleteTX
286
287 @ Description
288 Informs DXE that the current series of Tx packets is complete
289
290 @ Parameters
291 pDXEContext : DXE Control Block
292 ucTxResReq TX resource number required by TL/WDI
293
294 @ Return
295 wpt_status
296===========================================================================*/
297wpt_status
298WLANDXE_CompleteTX
299(
300 void* pDXEContext,
301 wpt_uint32 ucTxResReq
302);
303
304/*==========================================================================
305 @ Function Name
306 WLANDXE_Stop
307
308 @ Description
309 Stop DXE channels and DXE engine operations
310
311 @ Parameters
312 pVoid pDXEContext : DXE Control Block
313
314 @ Return
315 wpt_status
316===========================================================================*/
317wpt_status WLANDXE_Stop
318(
319 void *pDXEContext
320);
321
322/*==========================================================================
323 @ Function Name
324 WLANDXE_Close
325
326 @ Description
327 Close DXE channels
328 Free DXE related resources
329 DXE descriptor free
330 Descriptor control block free
331 Pre allocated RX buffer free
332
333 @ Parameters
334 pVoid pDXEContext : DXE Control Block
335
336 @ Return
337 wpt_status
338===========================================================================*/
339wpt_status WLANDXE_Close
340(
341 void *pDXEContext
342);
343
344/*==========================================================================
345 @ Function Name
346 WLANDXE_TriggerTX
347
348 @ Description
349 TBD
350
351 @ Parameters
352 pVoid pDXEContext : DXE Control Block
353
354 @ Return
355 wpt_status
356===========================================================================*/
357wpt_status WLANDXE_TriggerTX
358(
359 void *pDXEContext
360);
361
362/*==========================================================================
363 @ Function Name
364 WLANDXE_SetPowerState
365
366 @ Description
367 From Client let DXE knows what is the WLAN HW(RIVA) power state
368
369 @ Parameters
370 pVoid pDXEContext : DXE Control Block
371 WLANDXE_PowerStateType powerState
372
373 @ Return
374 wpt_status
375===========================================================================*/
376wpt_status WLANDXE_SetPowerState
377(
378 void *pDXEContext,
379 WDTS_PowerStateType powerState,
380 WDTS_SetPSCbType cBack
381);
382
383/*==========================================================================
384 @ Function Name
385 WLANDXE_GetFreeTxDataResNumber
386
387 @ Description
388 Returns free descriptor numbers for TX data channel (TX high priority)
389
390 @ Parameters
391 pVoid pDXEContext : DXE Control Block
392
393 @ Return
394 wpt_uint32 Free descriptor number of TX high pri ch
395===========================================================================*/
396wpt_uint32 WLANDXE_GetFreeTxDataResNumber
397(
398 void *pDXEContext
399);
400
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700401/*==========================================================================
402 @ Function Name
403 WLANDXE_ChannelDebug
404
405 @ Description
406 Display DXE Channel debugging information
407 User may request to display DXE channel snapshot
408 Or if host driver detects any abnormal stcuk may display
409
410 @ Parameters
Jeff Johnsonb88db982012-12-10 13:34:59 -0800411 displaySnapshot : Display DXE snapshot option
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700412 enableStallDetect : Enable stall detect feature
413 This feature will take effect to data performance
414 Not integrate till fully verification
415
416 @ Return
417 NONE
418
419===========================================================================*/
420void WLANDXE_ChannelDebug
421(
422 wpt_boolean displaySnapshot,
Madan Mohan Koyyalamudi24a00f92012-10-22 15:21:02 -0700423 wpt_boolean enableStallDetect
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700424);
425
Jeff Johnson295189b2012-06-20 16:38:30 -0700426#ifdef WLANDXE_TEST_CHANNEL_ENABLE
427/*==========================================================================
428 @ Function Name
429 WLANDXE_UnitTest
430
431 @ Description
432 Temporary for the DXE module test
433
434 @ Parameters
435 NONE
436
437 @ Return
438 NONE
439
440===========================================================================*/
441void WLANDXE_UnitTestStartDXE
442(
443 void
444);
445
446/*==========================================================================
447 @ Function Name
448
449 @ Description
450
451 @ Parameters
452
453 @ Return
454
455===========================================================================*/
456void WLANDXE_UnitTestDataTransfer
457(
458 void
459);
460
461/*==========================================================================
462 @ Function Name
463
464 @ Description
465
466 @ Parameters
467
468 @ Return
469
470===========================================================================*/
471void WLANDXE_UnitTestEventHandle
472(
473 void *dxeCB
474);
475#endif /* WLANDXE_TEST_CHANNEL_ENABLE */
476#endif /* WLAN_QCT_DXE_H */