blob: 729a78ca4276ad39f744d5b5dbeac17cf53e7e5f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam1ed83fc2014-02-19 01:15:45 -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 Lam1ed83fc2014-02-19 01:15:45 -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_DTS_H
29#define __WLAN_QCT_DTS_H
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -080030
31#include "wlan_qct_wdi.h"
32
Jeff Johnson295189b2012-06-20 16:38:30 -070033/**=========================================================================
34 *
35 * \file wlan_qct_wdi_dts.h
36 *
37 * \brief define Datas Trnasport Service API
38 *
39 * WLAN Device Abstraction layer interface for Transport drivers (SDIO/DXE)
40 * DESCRIPTION
41 * This file contains the API exposed by the
42 * wlan device abstarction layer module for abstracting DXE/SDIO.
43 *
Jeff Johnson295189b2012-06-20 16:38:30 -070044 *
45 * Example usage for DXE.
46 * ----------------------
47 * On Platform init
48 * DAL will then invoke WDTS_open
49 *
50 * On DAL init
51 * DAL will invike WDTS_start
52 *
53 * On transmit:
54 * DAL will invoke WDTS_TxPacket API
55 *
56 * On transmit complete:
57 * DXE will serialize into TX thread
58 * In TX thread it will invoke
59 *
60 * On receive:
61 * DXE will serialize into RX thread
62 * In TX thread it will invoke WDTS_RXPacket API
63 *
64 * On DXE ring full:
65 * DXE will serialize into TX thread
66 * In TX thread it will invoke WDTS_OOResourceNotification API
67 */
68
69typedef enum
70{
71 WDTS_CHANNEL_TX_LOW_PRI,
72 WDTS_CHANNEL_TX_HIGH_PRI,
73 WDTS_CHANNEL_RX_LOW_PRI,
74 WDTS_CHANNEL_RX_HIGH_PRI,
75 WDTS_CHANNEL_MAX
76} WDTS_ChannelType;
77
78typedef enum
79{
80 WDTS_POWER_STATE_FULL,
81 WDTS_POWER_STATE_IMPS,
82 WDTS_POWER_STATE_BMPS,
83 WDTS_POWER_STATE_DOWN,
84 WDTS_POWER_STATE_MAX
85} WDTS_PowerStateType;
86
87
88typedef wpt_status (*WDTS_TxCompleteCbType)(void *pContext, wpt_packet *pFrame, wpt_status status);
89typedef wpt_status (*WDTS_RxFrameReadyCbType) (void *pContext, wpt_packet *pFrame, WDTS_ChannelType channel);
90typedef wpt_status (*WDTS_LowResourceCbType)(void *pContext, WDTS_ChannelType channel, wpt_boolean on);
91typedef void (*WDTS_SetPSCbType)(wpt_status status, unsigned int dxePhyAddr);
92/* DTS Set power state ACK callback.
93 * This callback function should be invoked by the DTS to notify WDI that set
94 * power state request is complete.
95 * Parameters:
96 * status: status of the set operation
97 * pUserData:Cookie that should be passed back to the caller along with the callback.
98 * Return Value: None.
99 *
100 */
101typedef void (*WDTS_SetPowerStateCbType)(wpt_status status,
102 unsigned int dxePhyAddr,
103 void* pUserData);
104
105typedef struct {
106 void * (*open)(void);
107 wpt_status (*start) (void *pContext);
108 wpt_status (*register_client)(void *pContext, WDTS_RxFrameReadyCbType,
109 WDTS_TxCompleteCbType, WDTS_LowResourceCbType, void *clientData);
110 wpt_status (*xmit) (void *pContext, wpt_packet *packet, WDTS_ChannelType channel);
111 wpt_status (*txComplete) (void *pContext, wpt_uint32 ucTxResReq);
112 wpt_status (*setPowerState) (void *pContext, WDTS_PowerStateType powerState,
113 WDTS_SetPSCbType cBack);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700114 void (*channelDebug)(wpt_boolean displaySnapshot,
Mihir Shete40a55652014-03-02 14:14:47 +0530115 wpt_uint8 debugFlags);
Jeff Johnson295189b2012-06-20 16:38:30 -0700116 wpt_status (*stop) (void *pContext);
117 wpt_status (*close) (void *pContext);
118 wpt_uint32 (*getFreeTxDataResNumber) (void *pContext);
119} WDTS_TransportDriverTrype;
120
121typedef struct {
122 WDTS_SetPowerStateCbType cback;
123 void* pUserData;
124} WDTS_SetPowerStateCbInfoType;
125
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800126/* Tx/Rx stats function
127 * This function should be invoked to fetch the current stats
128 * Parameters:
129 * pStats:Pointer to the collected stats
130 * len: length of buffer pointed to by pStats
131 * Return Status: None
132 */
133void WDTS_GetTrafficStats(WDI_TrafficStatsType** pStats, wpt_uint32 *len);
134
135/* WDTS_DeactivateTrafficStats
136 * This function should be invoked to suspend traffic stats collection
137 * Parameters: None
138 * Return Status: None
139 */
140void WDTS_DeactivateTrafficStats(void);
141
142/* WDTS_ActivateTrafficStats
143 * This function should be invoked to activate traffic stats collection
144 * Parameters: None
145 * Return Status: None
146 */
147void WDTS_ActivateTrafficStats(void);
148
149/* WDTS_ClearTrafficStats
150 * This function should be invoked to clear all past stats
151 * Parameters: None
152 * Return Status: None
153 */
154void WDTS_ClearTrafficStats(void);
155
Jeff Johnson295189b2012-06-20 16:38:30 -0700156/* DTS open function.
157 * On open the transport device should initialize itself.
158 * Parameters:
159 * pContext:Cookie that should be passed back to the caller along
160 * with the callback.
161 *
162 * Return Value: SUCCESS Completed successfully.
163 * FAILURE_XXX Request was rejected due XXX Reason.
164
165 */
166wpt_status WDTS_openTransport( void *pContext);
167
168
169
170
171/* DTS start function.
172 * On start the transport device should start running.
173 * Parameters:
174 * pContext:Cookie that should be passed back to the caller along
175 * with the callback.
176 *
177 * Return Value: SUCCESS Completed successfully.
178 * FAILURE_XXX Request was rejected due XXX Reason.
179 *
180 */
181wpt_status WDTS_startTransport( void *pContext);
182
183
184
185
186/* DTS Tx packet function.
187 * This function should be invoked by the DAL Dataservice to schedule transmit frame through DXE/SDIO.
188 * Parameters:
189 * pContext:Cookie that should be passed back to the caller along with the callback.
190 * pFrame:Refernce to PAL frame.
191 * Return Value: SUCCESS Completed successfully.
192 * FAILURE_XXX Request was rejected due XXX Reason.
193 *
194 */
195wpt_status WDTS_TxPacket(void *pContext, wpt_packet *pFrame);
196
197/* DTS Tx Complete function.
198 * This function should be invoked by the DAL Dataservice to notify tx completion to DXE/SDIO.
199 * Parameters:
200 * pContext:Cookie that should be passed back to the caller along with the callback.
201 * ucTxResReq:TX resource number required by TL
202 * Return Value: SUCCESS Completed successfully.
203 * FAILURE_XXX Request was rejected due XXX Reason.
204 *
205 */
206wpt_status WDTS_CompleteTx(void *pContext, wpt_uint32 ucTxResReq);
207
208/* DTS Set power state function.
209 * This function should be invoked by the DAL to notify the WLAN device power state.
210 * Parameters:
211 * pContext:Cookie that should be passed back to the caller along with the callback.
212 * powerState:Power state of the WLAN device.
213 * Return Value: SUCCESS Set successfully in DXE control blk.
214 * FAILURE_XXX Request was rejected due XXX Reason.
215 *
216 */
217wpt_status WDTS_SetPowerState(void *pContext, WDTS_PowerStateType powerState,
218 WDTS_SetPowerStateCbType cback);
219
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700220/* DTS Transport Channel Debug
221 * Display DXE Channel debugging information
222 * User may request to display DXE channel snapshot
223 * Or if host driver detects any abnormal stcuk may display
224 * Parameters:
Jeff Johnsonb88db982012-12-10 13:34:59 -0800225 * displaySnapshot : Display DXE snapshot option
Mihir Shete40a55652014-03-02 14:14:47 +0530226 * debugFlags : Enable stall detect features
227 * defined by WPAL_DeviceDebugFlags
228 * These features may effect
229 * data performance.
230 *
231 * Not integrate till fully verification
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700232 * Return Value: NONE
233 *
234 */
Mihir Shete40a55652014-03-02 14:14:47 +0530235void WDTS_ChannelDebug(wpt_boolean displaySnapshot, wpt_uint8 debugFlags);
Madan Mohan Koyyalamudi8cb53982012-09-28 14:34:47 -0700236
Jeff Johnson295189b2012-06-20 16:38:30 -0700237/* DTS Stop function.
238 * Stop Transport driver, ie DXE, SDIO
239 * Parameters:
240 * pContext:Cookie that should be passed back to the caller along with the callback.
241 * Return Value: SUCCESS Completed successfully.
242 * FAILURE_XXX Request was rejected due XXX Reason.
243 *
244 */
245wpt_status WDTS_Stop(void *pContext);
246
247/* DTS Close function.
248 * Close Transport driver, ie DXE, SDIO
249 * Parameters:
250 * pContext:Cookie that should be passed back to the caller along with the callback.
251 * Return Value: SUCCESS Completed successfully.
252 * FAILURE_XXX Request was rejected due XXX Reason.
253 *
254 */
255wpt_status WDTS_Close(void *pContext);
256
257/* Get free TX data descriptor number from DXE
258 * Parameters:
259 * pContext: Cookie that should be passed back to the caller along with the callback.
260 * Return Value: number of free descriptors for TX data channel
261 *
262 */
263wpt_uint32 WDTS_GetFreeTxDataResNumber(void *pContext);
264
Viral Modif45f7672013-09-06 13:29:06 -0700265/* API to fill Rate Info based on the mac efficiency passed to it
266 * macEff si used to caclulate mac throughput based on each rate index/PHY rate.
267 * This is eventually used by MAS to calculate RX stats periodically sent to FW
268 * The start and end Rate Index are the other arguments to this API - the new mac
269 * efficiency passed to this API (Arg1) is only applied between startRateIndex (arg2) and endRateIndex (arg3).
270 */
271void WDTS_FillRateInfo(wpt_uint8 macEff, wpt_int16 startRateIndex, wpt_int16 endRateIndex);
Jeff Johnson295189b2012-06-20 16:38:30 -0700272#endif