blob: fdb7fab42c848f5e83fe1deaa94f5ef6e6ecb9df [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_DTS_H
23#define __WLAN_QCT_DTS_H
24/**=========================================================================
25 *
26 * \file wlan_qct_wdi_dts.h
27 *
28 * \brief define Datas Trnasport Service API
29 *
30 * WLAN Device Abstraction layer interface for Transport drivers (SDIO/DXE)
31 * DESCRIPTION
32 * This file contains the API exposed by the
33 * wlan device abstarction layer module for abstracting DXE/SDIO.
34 *
35 * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved.
36 * Qualcomm Confidential and Proprietary
37 *
38 * Example usage for DXE.
39 * ----------------------
40 * On Platform init
41 * DAL will then invoke WDTS_open
42 *
43 * On DAL init
44 * DAL will invike WDTS_start
45 *
46 * On transmit:
47 * DAL will invoke WDTS_TxPacket API
48 *
49 * On transmit complete:
50 * DXE will serialize into TX thread
51 * In TX thread it will invoke
52 *
53 * On receive:
54 * DXE will serialize into RX thread
55 * In TX thread it will invoke WDTS_RXPacket API
56 *
57 * On DXE ring full:
58 * DXE will serialize into TX thread
59 * In TX thread it will invoke WDTS_OOResourceNotification API
60 */
61
62typedef enum
63{
64 WDTS_CHANNEL_TX_LOW_PRI,
65 WDTS_CHANNEL_TX_HIGH_PRI,
66 WDTS_CHANNEL_RX_LOW_PRI,
67 WDTS_CHANNEL_RX_HIGH_PRI,
68 WDTS_CHANNEL_MAX
69} WDTS_ChannelType;
70
71typedef enum
72{
73 WDTS_POWER_STATE_FULL,
74 WDTS_POWER_STATE_IMPS,
75 WDTS_POWER_STATE_BMPS,
76 WDTS_POWER_STATE_DOWN,
77 WDTS_POWER_STATE_MAX
78} WDTS_PowerStateType;
79
80
81typedef wpt_status (*WDTS_TxCompleteCbType)(void *pContext, wpt_packet *pFrame, wpt_status status);
82typedef wpt_status (*WDTS_RxFrameReadyCbType) (void *pContext, wpt_packet *pFrame, WDTS_ChannelType channel);
83typedef wpt_status (*WDTS_LowResourceCbType)(void *pContext, WDTS_ChannelType channel, wpt_boolean on);
84typedef void (*WDTS_SetPSCbType)(wpt_status status, unsigned int dxePhyAddr);
85/* DTS Set power state ACK callback.
86 * This callback function should be invoked by the DTS to notify WDI that set
87 * power state request is complete.
88 * Parameters:
89 * status: status of the set operation
90 * pUserData:Cookie that should be passed back to the caller along with the callback.
91 * Return Value: None.
92 *
93 */
94typedef void (*WDTS_SetPowerStateCbType)(wpt_status status,
95 unsigned int dxePhyAddr,
96 void* pUserData);
97
98typedef struct {
99 void * (*open)(void);
100 wpt_status (*start) (void *pContext);
101 wpt_status (*register_client)(void *pContext, WDTS_RxFrameReadyCbType,
102 WDTS_TxCompleteCbType, WDTS_LowResourceCbType, void *clientData);
103 wpt_status (*xmit) (void *pContext, wpt_packet *packet, WDTS_ChannelType channel);
104 wpt_status (*txComplete) (void *pContext, wpt_uint32 ucTxResReq);
105 wpt_status (*setPowerState) (void *pContext, WDTS_PowerStateType powerState,
106 WDTS_SetPSCbType cBack);
107 wpt_status (*stop) (void *pContext);
108 wpt_status (*close) (void *pContext);
109 wpt_uint32 (*getFreeTxDataResNumber) (void *pContext);
110} WDTS_TransportDriverTrype;
111
112typedef struct {
113 WDTS_SetPowerStateCbType cback;
114 void* pUserData;
115} WDTS_SetPowerStateCbInfoType;
116
117/* DTS open function.
118 * On open the transport device should initialize itself.
119 * Parameters:
120 * pContext:Cookie that should be passed back to the caller along
121 * with the callback.
122 *
123 * Return Value: SUCCESS Completed successfully.
124 * FAILURE_XXX Request was rejected due XXX Reason.
125
126 */
127wpt_status WDTS_openTransport( void *pContext);
128
129
130
131
132/* DTS start function.
133 * On start the transport device should start running.
134 * Parameters:
135 * pContext:Cookie that should be passed back to the caller along
136 * with the callback.
137 *
138 * Return Value: SUCCESS Completed successfully.
139 * FAILURE_XXX Request was rejected due XXX Reason.
140 *
141 */
142wpt_status WDTS_startTransport( void *pContext);
143
144
145
146
147/* DTS Tx packet function.
148 * This function should be invoked by the DAL Dataservice to schedule transmit frame through DXE/SDIO.
149 * Parameters:
150 * pContext:Cookie that should be passed back to the caller along with the callback.
151 * pFrame:Refernce to PAL frame.
152 * Return Value: SUCCESS Completed successfully.
153 * FAILURE_XXX Request was rejected due XXX Reason.
154 *
155 */
156wpt_status WDTS_TxPacket(void *pContext, wpt_packet *pFrame);
157
158/* DTS Tx Complete function.
159 * This function should be invoked by the DAL Dataservice to notify tx completion to DXE/SDIO.
160 * Parameters:
161 * pContext:Cookie that should be passed back to the caller along with the callback.
162 * ucTxResReq:TX resource number required by TL
163 * Return Value: SUCCESS Completed successfully.
164 * FAILURE_XXX Request was rejected due XXX Reason.
165 *
166 */
167wpt_status WDTS_CompleteTx(void *pContext, wpt_uint32 ucTxResReq);
168
169/* DTS Set power state function.
170 * This function should be invoked by the DAL to notify the WLAN device power state.
171 * Parameters:
172 * pContext:Cookie that should be passed back to the caller along with the callback.
173 * powerState:Power state of the WLAN device.
174 * Return Value: SUCCESS Set successfully in DXE control blk.
175 * FAILURE_XXX Request was rejected due XXX Reason.
176 *
177 */
178wpt_status WDTS_SetPowerState(void *pContext, WDTS_PowerStateType powerState,
179 WDTS_SetPowerStateCbType cback);
180
181/* DTS Stop function.
182 * Stop Transport driver, ie DXE, SDIO
183 * Parameters:
184 * pContext:Cookie that should be passed back to the caller along with the callback.
185 * Return Value: SUCCESS Completed successfully.
186 * FAILURE_XXX Request was rejected due XXX Reason.
187 *
188 */
189wpt_status WDTS_Stop(void *pContext);
190
191/* DTS Close function.
192 * Close Transport driver, ie DXE, SDIO
193 * Parameters:
194 * pContext:Cookie that should be passed back to the caller along with the callback.
195 * Return Value: SUCCESS Completed successfully.
196 * FAILURE_XXX Request was rejected due XXX Reason.
197 *
198 */
199wpt_status WDTS_Close(void *pContext);
200
201/* Get free TX data descriptor number from DXE
202 * Parameters:
203 * pContext: Cookie that should be passed back to the caller along with the callback.
204 * Return Value: number of free descriptors for TX data channel
205 *
206 */
207wpt_uint32 WDTS_GetFreeTxDataResNumber(void *pContext);
208
209#endif