blob: aa4013c1a05cd365c48caf9ff98ab5109e39b4c6 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006#ifndef __WLAN_QCT_DTS_H
7#define __WLAN_QCT_DTS_H
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -08008
9#include "wlan_qct_wdi.h"
10
Jeff Johnson295189b2012-06-20 16:38:30 -070011/**=========================================================================
12 *
13 * \file wlan_qct_wdi_dts.h
14 *
15 * \brief define Datas Trnasport Service API
16 *
17 * WLAN Device Abstraction layer interface for Transport drivers (SDIO/DXE)
18 * DESCRIPTION
19 * This file contains the API exposed by the
20 * wlan device abstarction layer module for abstracting DXE/SDIO.
21 *
22 * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved.
23 * Qualcomm Confidential and Proprietary
24 *
25 * Example usage for DXE.
26 * ----------------------
27 * On Platform init
28 * DAL will then invoke WDTS_open
29 *
30 * On DAL init
31 * DAL will invike WDTS_start
32 *
33 * On transmit:
34 * DAL will invoke WDTS_TxPacket API
35 *
36 * On transmit complete:
37 * DXE will serialize into TX thread
38 * In TX thread it will invoke
39 *
40 * On receive:
41 * DXE will serialize into RX thread
42 * In TX thread it will invoke WDTS_RXPacket API
43 *
44 * On DXE ring full:
45 * DXE will serialize into TX thread
46 * In TX thread it will invoke WDTS_OOResourceNotification API
47 */
48
49typedef enum
50{
51 WDTS_CHANNEL_TX_LOW_PRI,
52 WDTS_CHANNEL_TX_HIGH_PRI,
53 WDTS_CHANNEL_RX_LOW_PRI,
54 WDTS_CHANNEL_RX_HIGH_PRI,
55 WDTS_CHANNEL_MAX
56} WDTS_ChannelType;
57
58typedef enum
59{
60 WDTS_POWER_STATE_FULL,
61 WDTS_POWER_STATE_IMPS,
62 WDTS_POWER_STATE_BMPS,
63 WDTS_POWER_STATE_DOWN,
64 WDTS_POWER_STATE_MAX
65} WDTS_PowerStateType;
66
67
68typedef wpt_status (*WDTS_TxCompleteCbType)(void *pContext, wpt_packet *pFrame, wpt_status status);
69typedef wpt_status (*WDTS_RxFrameReadyCbType) (void *pContext, wpt_packet *pFrame, WDTS_ChannelType channel);
70typedef wpt_status (*WDTS_LowResourceCbType)(void *pContext, WDTS_ChannelType channel, wpt_boolean on);
71typedef void (*WDTS_SetPSCbType)(wpt_status status, unsigned int dxePhyAddr);
72/* DTS Set power state ACK callback.
73 * This callback function should be invoked by the DTS to notify WDI that set
74 * power state request is complete.
75 * Parameters:
76 * status: status of the set operation
77 * pUserData:Cookie that should be passed back to the caller along with the callback.
78 * Return Value: None.
79 *
80 */
81typedef void (*WDTS_SetPowerStateCbType)(wpt_status status,
82 unsigned int dxePhyAddr,
83 void* pUserData);
84
85typedef struct {
86 void * (*open)(void);
87 wpt_status (*start) (void *pContext);
88 wpt_status (*register_client)(void *pContext, WDTS_RxFrameReadyCbType,
89 WDTS_TxCompleteCbType, WDTS_LowResourceCbType, void *clientData);
90 wpt_status (*xmit) (void *pContext, wpt_packet *packet, WDTS_ChannelType channel);
91 wpt_status (*txComplete) (void *pContext, wpt_uint32 ucTxResReq);
92 wpt_status (*setPowerState) (void *pContext, WDTS_PowerStateType powerState,
93 WDTS_SetPSCbType cBack);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -070094 void (*channelDebug)(wpt_boolean displaySnapshot,
Madan Mohan Koyyalamudi24a00f92012-10-22 15:21:02 -070095 wpt_boolean enableStallDetect);
Jeff Johnson295189b2012-06-20 16:38:30 -070096 wpt_status (*stop) (void *pContext);
97 wpt_status (*close) (void *pContext);
98 wpt_uint32 (*getFreeTxDataResNumber) (void *pContext);
99} WDTS_TransportDriverTrype;
100
101typedef struct {
102 WDTS_SetPowerStateCbType cback;
103 void* pUserData;
104} WDTS_SetPowerStateCbInfoType;
105
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800106/* Tx/Rx stats function
107 * This function should be invoked to fetch the current stats
108 * Parameters:
109 * pStats:Pointer to the collected stats
110 * len: length of buffer pointed to by pStats
111 * Return Status: None
112 */
113void WDTS_GetTrafficStats(WDI_TrafficStatsType** pStats, wpt_uint32 *len);
114
115/* WDTS_DeactivateTrafficStats
116 * This function should be invoked to suspend traffic stats collection
117 * Parameters: None
118 * Return Status: None
119 */
120void WDTS_DeactivateTrafficStats(void);
121
122/* WDTS_ActivateTrafficStats
123 * This function should be invoked to activate traffic stats collection
124 * Parameters: None
125 * Return Status: None
126 */
127void WDTS_ActivateTrafficStats(void);
128
129/* WDTS_ClearTrafficStats
130 * This function should be invoked to clear all past stats
131 * Parameters: None
132 * Return Status: None
133 */
134void WDTS_ClearTrafficStats(void);
135
Jeff Johnson295189b2012-06-20 16:38:30 -0700136/* DTS open function.
137 * On open the transport device should initialize itself.
138 * Parameters:
139 * pContext:Cookie that should be passed back to the caller along
140 * with the callback.
141 *
142 * Return Value: SUCCESS Completed successfully.
143 * FAILURE_XXX Request was rejected due XXX Reason.
144
145 */
146wpt_status WDTS_openTransport( void *pContext);
147
148
149
150
151/* DTS start function.
152 * On start the transport device should start running.
153 * Parameters:
154 * pContext:Cookie that should be passed back to the caller along
155 * with the callback.
156 *
157 * Return Value: SUCCESS Completed successfully.
158 * FAILURE_XXX Request was rejected due XXX Reason.
159 *
160 */
161wpt_status WDTS_startTransport( void *pContext);
162
163
164
165
166/* DTS Tx packet function.
167 * This function should be invoked by the DAL Dataservice to schedule transmit frame through DXE/SDIO.
168 * Parameters:
169 * pContext:Cookie that should be passed back to the caller along with the callback.
170 * pFrame:Refernce to PAL frame.
171 * Return Value: SUCCESS Completed successfully.
172 * FAILURE_XXX Request was rejected due XXX Reason.
173 *
174 */
175wpt_status WDTS_TxPacket(void *pContext, wpt_packet *pFrame);
176
177/* DTS Tx Complete function.
178 * This function should be invoked by the DAL Dataservice to notify tx completion to DXE/SDIO.
179 * Parameters:
180 * pContext:Cookie that should be passed back to the caller along with the callback.
181 * ucTxResReq:TX resource number required by TL
182 * Return Value: SUCCESS Completed successfully.
183 * FAILURE_XXX Request was rejected due XXX Reason.
184 *
185 */
186wpt_status WDTS_CompleteTx(void *pContext, wpt_uint32 ucTxResReq);
187
188/* DTS Set power state function.
189 * This function should be invoked by the DAL to notify the WLAN device power state.
190 * Parameters:
191 * pContext:Cookie that should be passed back to the caller along with the callback.
192 * powerState:Power state of the WLAN device.
193 * Return Value: SUCCESS Set successfully in DXE control blk.
194 * FAILURE_XXX Request was rejected due XXX Reason.
195 *
196 */
197wpt_status WDTS_SetPowerState(void *pContext, WDTS_PowerStateType powerState,
198 WDTS_SetPowerStateCbType cback);
199
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700200/* DTS Transport Channel Debug
201 * Display DXE Channel debugging information
202 * User may request to display DXE channel snapshot
203 * Or if host driver detects any abnormal stcuk may display
204 * Parameters:
Jeff Johnsonb88db982012-12-10 13:34:59 -0800205 * displaySnapshot : Display DXE snapshot option
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700206 * enableStallDetect : Enable stall detect feature
207 This feature will take effect to data performance
208 Not integrate till fully verification
209 * Return Value: NONE
210 *
211 */
Jeff Johnsonb88db982012-12-10 13:34:59 -0800212void WDTS_ChannelDebug(wpt_boolean displaySnapshot, wpt_boolean toggleStallDetect);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700213
Jeff Johnson295189b2012-06-20 16:38:30 -0700214/* DTS Stop function.
215 * Stop Transport driver, ie DXE, SDIO
216 * Parameters:
217 * pContext:Cookie that should be passed back to the caller along with the callback.
218 * Return Value: SUCCESS Completed successfully.
219 * FAILURE_XXX Request was rejected due XXX Reason.
220 *
221 */
222wpt_status WDTS_Stop(void *pContext);
223
224/* DTS Close function.
225 * Close Transport driver, ie DXE, SDIO
226 * Parameters:
227 * pContext:Cookie that should be passed back to the caller along with the callback.
228 * Return Value: SUCCESS Completed successfully.
229 * FAILURE_XXX Request was rejected due XXX Reason.
230 *
231 */
232wpt_status WDTS_Close(void *pContext);
233
234/* Get free TX data descriptor number from DXE
235 * Parameters:
236 * pContext: Cookie that should be passed back to the caller along with the callback.
237 * Return Value: number of free descriptors for TX data channel
238 *
239 */
240wpt_uint32 WDTS_GetFreeTxDataResNumber(void *pContext);
241
Viral Modif45f7672013-09-06 13:29:06 -0700242/* API to fill Rate Info based on the mac efficiency passed to it
243 * macEff si used to caclulate mac throughput based on each rate index/PHY rate.
244 * This is eventually used by MAS to calculate RX stats periodically sent to FW
245 * The start and end Rate Index are the other arguments to this API - the new mac
246 * efficiency passed to this API (Arg1) is only applied between startRateIndex (arg2) and endRateIndex (arg3).
247 */
248void WDTS_FillRateInfo(wpt_uint8 macEff, wpt_int16 startRateIndex, wpt_int16 endRateIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -0700249#endif