blob: 398b8b21a48450f3ea5ecb4b54e9a6b32baceb0c [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -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.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42#ifndef __WLAN_QCT_DTS_H
43#define __WLAN_QCT_DTS_H
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -080044
45#include "wlan_qct_wdi.h"
46
Jeff Johnson295189b2012-06-20 16:38:30 -070047/**=========================================================================
48 *
49 * \file wlan_qct_wdi_dts.h
50 *
51 * \brief define Datas Trnasport Service API
52 *
53 * WLAN Device Abstraction layer interface for Transport drivers (SDIO/DXE)
54 * DESCRIPTION
55 * This file contains the API exposed by the
56 * wlan device abstarction layer module for abstracting DXE/SDIO.
57 *
58 * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved.
59 * Qualcomm Confidential and Proprietary
60 *
61 * Example usage for DXE.
62 * ----------------------
63 * On Platform init
64 * DAL will then invoke WDTS_open
65 *
66 * On DAL init
67 * DAL will invike WDTS_start
68 *
69 * On transmit:
70 * DAL will invoke WDTS_TxPacket API
71 *
72 * On transmit complete:
73 * DXE will serialize into TX thread
74 * In TX thread it will invoke
75 *
76 * On receive:
77 * DXE will serialize into RX thread
78 * In TX thread it will invoke WDTS_RXPacket API
79 *
80 * On DXE ring full:
81 * DXE will serialize into TX thread
82 * In TX thread it will invoke WDTS_OOResourceNotification API
83 */
84
85typedef enum
86{
87 WDTS_CHANNEL_TX_LOW_PRI,
88 WDTS_CHANNEL_TX_HIGH_PRI,
89 WDTS_CHANNEL_RX_LOW_PRI,
90 WDTS_CHANNEL_RX_HIGH_PRI,
91 WDTS_CHANNEL_MAX
92} WDTS_ChannelType;
93
94typedef enum
95{
96 WDTS_POWER_STATE_FULL,
97 WDTS_POWER_STATE_IMPS,
98 WDTS_POWER_STATE_BMPS,
99 WDTS_POWER_STATE_DOWN,
100 WDTS_POWER_STATE_MAX
101} WDTS_PowerStateType;
102
103
104typedef wpt_status (*WDTS_TxCompleteCbType)(void *pContext, wpt_packet *pFrame, wpt_status status);
105typedef wpt_status (*WDTS_RxFrameReadyCbType) (void *pContext, wpt_packet *pFrame, WDTS_ChannelType channel);
106typedef wpt_status (*WDTS_LowResourceCbType)(void *pContext, WDTS_ChannelType channel, wpt_boolean on);
107typedef void (*WDTS_SetPSCbType)(wpt_status status, unsigned int dxePhyAddr);
108/* DTS Set power state ACK callback.
109 * This callback function should be invoked by the DTS to notify WDI that set
110 * power state request is complete.
111 * Parameters:
112 * status: status of the set operation
113 * pUserData:Cookie that should be passed back to the caller along with the callback.
114 * Return Value: None.
115 *
116 */
117typedef void (*WDTS_SetPowerStateCbType)(wpt_status status,
118 unsigned int dxePhyAddr,
119 void* pUserData);
120
121typedef struct {
122 void * (*open)(void);
123 wpt_status (*start) (void *pContext);
124 wpt_status (*register_client)(void *pContext, WDTS_RxFrameReadyCbType,
125 WDTS_TxCompleteCbType, WDTS_LowResourceCbType, void *clientData);
126 wpt_status (*xmit) (void *pContext, wpt_packet *packet, WDTS_ChannelType channel);
127 wpt_status (*txComplete) (void *pContext, wpt_uint32 ucTxResReq);
128 wpt_status (*setPowerState) (void *pContext, WDTS_PowerStateType powerState,
129 WDTS_SetPSCbType cBack);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700130 void (*channelDebug)(wpt_boolean displaySnapshot,
Madan Mohan Koyyalamudi24a00f92012-10-22 15:21:02 -0700131 wpt_boolean enableStallDetect);
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 wpt_status (*stop) (void *pContext);
133 wpt_status (*close) (void *pContext);
134 wpt_uint32 (*getFreeTxDataResNumber) (void *pContext);
135} WDTS_TransportDriverTrype;
136
137typedef struct {
138 WDTS_SetPowerStateCbType cback;
139 void* pUserData;
140} WDTS_SetPowerStateCbInfoType;
141
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800142/* Tx/Rx stats function
143 * This function should be invoked to fetch the current stats
144 * Parameters:
145 * pStats:Pointer to the collected stats
146 * len: length of buffer pointed to by pStats
147 * Return Status: None
148 */
149void WDTS_GetTrafficStats(WDI_TrafficStatsType** pStats, wpt_uint32 *len);
150
151/* WDTS_DeactivateTrafficStats
152 * This function should be invoked to suspend traffic stats collection
153 * Parameters: None
154 * Return Status: None
155 */
156void WDTS_DeactivateTrafficStats(void);
157
158/* WDTS_ActivateTrafficStats
159 * This function should be invoked to activate traffic stats collection
160 * Parameters: None
161 * Return Status: None
162 */
163void WDTS_ActivateTrafficStats(void);
164
165/* WDTS_ClearTrafficStats
166 * This function should be invoked to clear all past stats
167 * Parameters: None
168 * Return Status: None
169 */
170void WDTS_ClearTrafficStats(void);
171
Jeff Johnson295189b2012-06-20 16:38:30 -0700172/* DTS open function.
173 * On open the transport device should initialize itself.
174 * Parameters:
175 * pContext:Cookie that should be passed back to the caller along
176 * with the callback.
177 *
178 * Return Value: SUCCESS Completed successfully.
179 * FAILURE_XXX Request was rejected due XXX Reason.
180
181 */
182wpt_status WDTS_openTransport( void *pContext);
183
184
185
186
187/* DTS start function.
188 * On start the transport device should start running.
189 * Parameters:
190 * pContext:Cookie that should be passed back to the caller along
191 * with the callback.
192 *
193 * Return Value: SUCCESS Completed successfully.
194 * FAILURE_XXX Request was rejected due XXX Reason.
195 *
196 */
197wpt_status WDTS_startTransport( void *pContext);
198
199
200
201
202/* DTS Tx packet function.
203 * This function should be invoked by the DAL Dataservice to schedule transmit frame through DXE/SDIO.
204 * Parameters:
205 * pContext:Cookie that should be passed back to the caller along with the callback.
206 * pFrame:Refernce to PAL frame.
207 * Return Value: SUCCESS Completed successfully.
208 * FAILURE_XXX Request was rejected due XXX Reason.
209 *
210 */
211wpt_status WDTS_TxPacket(void *pContext, wpt_packet *pFrame);
212
213/* DTS Tx Complete function.
214 * This function should be invoked by the DAL Dataservice to notify tx completion to DXE/SDIO.
215 * Parameters:
216 * pContext:Cookie that should be passed back to the caller along with the callback.
217 * ucTxResReq:TX resource number required by TL
218 * Return Value: SUCCESS Completed successfully.
219 * FAILURE_XXX Request was rejected due XXX Reason.
220 *
221 */
222wpt_status WDTS_CompleteTx(void *pContext, wpt_uint32 ucTxResReq);
223
224/* DTS Set power state function.
225 * This function should be invoked by the DAL to notify the WLAN device power state.
226 * Parameters:
227 * pContext:Cookie that should be passed back to the caller along with the callback.
228 * powerState:Power state of the WLAN device.
229 * Return Value: SUCCESS Set successfully in DXE control blk.
230 * FAILURE_XXX Request was rejected due XXX Reason.
231 *
232 */
233wpt_status WDTS_SetPowerState(void *pContext, WDTS_PowerStateType powerState,
234 WDTS_SetPowerStateCbType cback);
235
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700236/* DTS Transport Channel Debug
237 * Display DXE Channel debugging information
238 * User may request to display DXE channel snapshot
239 * Or if host driver detects any abnormal stcuk may display
240 * Parameters:
Jeff Johnsonb88db982012-12-10 13:34:59 -0800241 * displaySnapshot : Display DXE snapshot option
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700242 * enableStallDetect : Enable stall detect feature
243 This feature will take effect to data performance
244 Not integrate till fully verification
245 * Return Value: NONE
246 *
247 */
Jeff Johnsonb88db982012-12-10 13:34:59 -0800248void WDTS_ChannelDebug(wpt_boolean displaySnapshot, wpt_boolean toggleStallDetect);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700249
Jeff Johnson295189b2012-06-20 16:38:30 -0700250/* DTS Stop function.
251 * Stop Transport driver, ie DXE, SDIO
252 * Parameters:
253 * pContext:Cookie that should be passed back to the caller along with the callback.
254 * Return Value: SUCCESS Completed successfully.
255 * FAILURE_XXX Request was rejected due XXX Reason.
256 *
257 */
258wpt_status WDTS_Stop(void *pContext);
259
260/* DTS Close function.
261 * Close Transport driver, ie DXE, SDIO
262 * Parameters:
263 * pContext:Cookie that should be passed back to the caller along with the callback.
264 * Return Value: SUCCESS Completed successfully.
265 * FAILURE_XXX Request was rejected due XXX Reason.
266 *
267 */
268wpt_status WDTS_Close(void *pContext);
269
270/* Get free TX data descriptor number from DXE
271 * Parameters:
272 * pContext: Cookie that should be passed back to the caller along with the callback.
273 * Return Value: number of free descriptors for TX data channel
274 *
275 */
276wpt_uint32 WDTS_GetFreeTxDataResNumber(void *pContext);
277
278#endif