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