blob: 867de34c67b32f5a0d1496329fa1cfd6c3356cb6 [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#if !defined( __WLAN_QCT_WTI_DS_H )
7#define __WLAN_QCT_WTI_DS_H
8
9/**=========================================================================
10 *
11 * \file wlan_qct_wdi_ds.h
12 *
13 * \brief define Dataservice API
14 *
15 * WLAN Device Abstraction layer External API for Dataservice
16 * DESCRIPTION
17 * This file contains the external API exposed by the
18 * wlan device abstarction layer module.
19 *
20 * Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved.
21 * Qualcomm Confidential and Proprietary
22 */
23
24
25#include "wlan_qct_pal_type.h"
26#include "wlan_qct_pal_status.h"
27#include "wlan_qct_pal_packet.h"
28#include "wlan_qct_wdi.h"
29
30
31typedef struct
32{
33 wpt_uint32 txFlags;
34 wpt_uint8 ac;
35 wpt_uint8 isEapol:1; //0 - not eapol 1 - eapol
36 wpt_uint8 isWai:1; //WAPI 0 - not WAI 1 WAI
37 wpt_uint8 fdisableFrmXlt:1; //0 - Let ADU do FT. 1 - bypass ADU FT
38 wpt_uint8 qosEnabled:1; //0 - non-Qos 1 - Qos
39 wpt_uint8 fenableWDS:1; //0 - not WDS 1 WDS
40 wpt_uint8 reserved1:3;
41 wpt_uint8 typeSubtype;
42 wpt_uint8 fUP;
43 wpt_uint8 fSTAMACAddress[6];
44 wpt_uint8 addr2MACAddress[6];
45 wpt_uint8 frmType;
46 wpt_uint8 fStaType;
Chet Lanctot4b088622013-05-22 16:09:22 -070047 wpt_uint8 fProtMgmtFrame;
Jeff Johnson295189b2012-06-20 16:38:30 -070048 wpt_uint16 fPktlen;
49 wpt_status txCompleteStatus;
Kumar Anand90ca3dd2013-01-18 15:24:47 -080050 wpt_uint8 staIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -070051} WDI_DS_TxMetaInfoType;
52
53
54typedef enum
55{
56 WDI_DS_OPCODE_INVALID = 0,
57 WDI_DS_OPCODE_QCUR_FWDBUF = 1,
58 WDI_DS_OPCODE_FWDBUF_FWDCUR = 2,
59 WDI_DS_OPCODE_QCUR = 3,
60 WDI_DS_OPCODE_FWDBUF_QUEUECUR = 4,
61 WDI_DS_OPCODE_FWDBUF_DROPCUR = 5,
62 WDI_DS_OPCODE_FWDALL_DROPCUR = 6,
63 WDI_DS_OPCODE_FWDALL_QCUR = 7,
64 WDI_DS_OPCODE_TEARDOWN = 8,
65 WDI_DS_OPCODE_DROPCUR = 9,
66 WDI_DS_OPCODE_MAX
67}WDI_DS_BAOpCodeEnumType;
68
69typedef struct
70{
71 wpt_uint8 staId;
72 wpt_uint8 addr3Idx;
73 wpt_uint8 rxChannel;
74 wpt_uint8 type:2;
75 wpt_uint8 subtype:4;
Kiran Kumar Lokere79540f92013-04-25 17:32:16 -070076 wpt_uint8 rfBand:2;
Jeff Johnson295189b2012-06-20 16:38:30 -070077
78 wpt_uint16 rtsf:1; //For beacon only. 1 ~V Riva TSF is bigger(later) than the one received
79 wpt_uint16 bsf:1; //1 Riva sends the last beacon, 0 not.
80 wpt_uint16 unknownUcastPkt:1; //1 ~V unicast frame received with unknown A2
81 wpt_uint16 scan:1; //1 frame received in scan state. 0 not.
82 wpt_uint16 dpuSig:3; //DPU signature
83 wpt_uint16 ft:1; //0~Wframe translation is not done. 1~Wdone
84 wpt_uint16 ne:1; //1 ~V frame is not encrypted OTA. This is for WAPI~Rs WAI packet.
85 wpt_uint16 llcr:1; // Has the LLC been stripped by H/W
86 wpt_uint16 bcast:1; //0 ~V unicast frame 1 ~V broadcast/multicast frame
87 wpt_uint16 tid:4;
88 wpt_uint16 reserved1:1;
89 wpt_uint8 dpuFeedback;
90 wpt_int8 snr;
91
92 wpt_uint32 currentPktSeqNo:12; /*current sequence number */
93 wpt_uint32 ampdu_reorderOpcode:4;
94 wpt_uint32 ampdu_reorderSlotIdx:6;
95 wpt_uint32 ampdu_reorderFwdIdx:6;
96 wpt_uint32 reserved3:4;
97
98 wpt_uint16 amsdu_size;
99 wpt_uint32 amsdu_asf:1;
100 wpt_uint32 amsdu_esf:1;
101 wpt_uint32 amsdu_lsf:1;
102 wpt_uint32 amsdu_aef:1;
103 wpt_uint32 reserved2:4;
104
105 wpt_uint8 *mpduHeaderPtr;
106 wpt_uint8 *mpduDataPtr;
107 wpt_uint32 mpduLength;
108 wpt_uint32 mpduHeaderLength;
109
110 wpt_uint32 rateIndex;
111 wpt_uint32 rxpFlags;
112 wpt_uint32 mclkRxTimestamp;
113
114 //Flow control frames
115 wpt_uint8 fc;
116 wpt_uint32 fcSTATxQStatus:16;
117 wpt_uint32 fcSTAThreshIndMask:16;
118 wpt_uint32 fcSTAPwrSaveStateMask:16;
119 wpt_uint32 fcSTAValidMask:16;
120
121 wpt_uint16 fcStaTxDisabledBitmap;
122 wpt_uint8 fcSTATxQLen[12]; // one byte per STA.
123 wpt_uint8 fcSTACurTxRate[12]; // current Tx rate for each sta.
124
125 wpt_uint64 replayCount;
126
127 wpt_uint32 rssi0;
128 wpt_uint32 rssi1;
Chet Lanctot186b5732013-03-18 10:26:30 -0700129
130#ifdef WLAN_FEATURE_11W
131 wpt_uint32 rmf:1;
132#endif
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700133#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
134 wpt_uint32 offloadScanLearn;
135 wpt_uint32 roamCandidateInd;
136#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700137} WDI_DS_RxMetaInfoType;
138
139typedef struct sPktMetaInfo
140{
141 union
142 {
143 WDI_DS_TxMetaInfoType txMetaInfo;
144 WDI_DS_RxMetaInfoType rxMetaInfo;
145 } u;
146} WDI_DS_MetaInfoType;
147
148WPT_STATIC WPT_INLINE WDI_DS_RxMetaInfoType* WDI_DS_ExtractRxMetaData (wpt_packet *pFrame)
149{
150 WDI_DS_RxMetaInfoType * pRxMetadata =
151 &((WDI_DS_MetaInfoType *)WPAL_PACKET_GET_METAINFO_POINTER(pFrame))->u.rxMetaInfo;
152 return pRxMetadata;
153}
154
155
156WPT_STATIC WPT_INLINE WDI_DS_TxMetaInfoType* WDI_DS_ExtractTxMetaData (wpt_packet *pFrame)
157{
158 WDI_DS_TxMetaInfoType * pTxMetadata =
159 &((WDI_DS_MetaInfoType *)WPAL_PACKET_GET_METAINFO_POINTER(pFrame))->u.txMetaInfo;
160 return pTxMetadata;
161}
162
163
164typedef void (*WDI_DS_TxCompleteCallback)(void *pContext, wpt_packet *pFrame);
165typedef void (*WDI_DS_RxPacketCallback) (void *pContext, wpt_packet *pFrame);
166typedef void (*WDI_DS_TxFlowControlCallback)(void *pContext, wpt_uint8 ac_mask);
167
168
169
170/* DAL registration function.
171 * Parameters:
172 * pContext:Cookie that should be passed back to the caller along
173 * with the callback.
174 * pfnTxCompleteCallback:Callback function that is to be invoked to return
175 * packets which have been transmitted.
176 * pfnRxPacketCallback:Callback function that is to be invoked to deliver
177 * packets which have been received
178 * pfnTxFlowControlCallback:Callback function that is to be invoked to
179 * indicate/clear congestion.
180 *
181 * Return Value: SUCCESS Completed successfully.
182 * FAILURE_XXX Request was rejected due XXX Reason.
183 *
184 */
185WDI_Status WDI_DS_Register( void *pContext,
186 WDI_DS_TxCompleteCallback pfnTxCompleteCallback,
187 WDI_DS_RxPacketCallback pfnRxPacketCallback,
188 WDI_DS_TxFlowControlCallback pfnTxFlowControlCallback,
189 void *pCallbackContext);
190
191
192
193/* DAL Transmit function.
194 * Parameters:
195 * pContext:Cookie that should be passed back to the caller along with the callback.
196 * pFrame:Refernce to PAL frame.
197 * more: Does the invokee have more than one packet pending?
198 * Return Value: SUCCESS Completed successfully.
199 * FAILURE_XXX Request was rejected due XXX Reason.
200 *
201 */
202
203
204WDI_Status WDI_DS_TxPacket(void *pContext,
205 wpt_packet *pFrame,
206 wpt_boolean more);
207
208
209/* DAL Transmit Complete function.
210 * Parameters:
211 * pContext:Cookie that should be passed back to the caller along with the callback.
212 * ucTxResReq:TX resource number required by TL
213 * Return Value: SUCCESS Completed successfully.
214 * FAILURE_XXX Request was rejected due XXX Reason.
215 *
216 */
217
218
219WDI_Status WDI_DS_TxComplete(void *pContext, wpt_uint32 ucTxResReq);
220
221/* DAL Suspend Transmit function.
222 * Parameters:
223 * pContext:Cookie that should be passed back to the caller along with the callback.
224 * Return Value: SUCCESS Completed successfully.
225 * FAILURE_XXX Request was rejected due XXX Reason.
226 *
227 */
228
229
230WDI_Status WDI_DS_TxSuspend(void *pContext);
231
232
233/* DAL Resume Transmit function.
234 * Parameters:
235 * pContext:Cookie that should be passed back to the caller along with the callback.
236 * Return Value: SUCCESS Completed successfully.
237 * FAILURE_XXX Request was rejected due XXX Reason.
238 *
239 */
240
241
242WDI_Status WDI_DS_TxResume(void *pContext);
243
244/* DAL Get Reserved resource by STA
245 * Parameters:
246 * pContext:Cookie that should be passed back to the caller along with the callback.
247 * wdiResPool: MemPool, MGMT ot DATA
248 * staId: STA ID
249 * Return Value: Number of reserved resouce count
250 *
251 */
252wpt_uint32 WDI_DS_GetReservedResCountPerSTA(void *pContext,
253 WDI_ResPoolType wdiResPool,
254 wpt_uint8 staId);
255
256/* DAL ADD STA into memPool
257 * Parameters:
258 * pContext:Cookie that should be passed back to the caller along with the callback.
259 * staId: STA ID
260 * Return Value: SUCCESS or FAIL
261 *
262 */
263WDI_Status WDI_DS_AddSTAMemPool(void *pContext, wpt_uint8 staIndex);
264
265/* DAL Remove STA from memPool
266 * Parameters:
267 * pContext:Cookie that should be passed back to the caller along with the callback.
268 * staId: STA ID
269 * Return Value: SUCCESS or FAIL
270 *
271 */
272WDI_Status WDI_DS_DelSTAMemPool(void *pContext, wpt_uint8 staIndex);
273
274/* DAL Set STA index associated with BSS index.
275 * Parameters:
276 * pContext:Cookie that should be passed back to the caller along with the callback.
277 * bssIdx: BSS index
278 * staId: STA index associated with BSS index
279 * Return Status: Found empty slot
280 *
281 */
282WDI_Status WDI_DS_SetStaIdxPerBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 staIdx);
283
284/* DAL Get STA index associated with BSS index.
285 * Parameters:
286 * pContext:Cookie that should be passed back to the caller along with the callback.
287 * bssIdx: BSS index
288 * staId: STA index associated with BSS index
289 * Return Status: Found empty slot
290 *
291 */
292WDI_Status WDI_DS_GetStaIdxFromBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 *staIdx);
293
294/* DAL Clear STA index associated with BSS index.
295 * Parameters:
296 * pContext:Cookie that should be passed back to the caller along with the callback.
297 * bssIdx: BSS index
298 * staId: STA index associated with BSS index
299 * Return Status: Found empty slot
300 *
301 */
302WDI_Status WDI_DS_ClearStaIdxPerBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 staIdx);
303
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800304/* @brief: WDI_DS_GetTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800305 * This function should be invoked to fetch the current stats
306 * Parameters:
307 * pStats:Pointer to the collected stats
308 * len: length of buffer pointed to by pStats
309 * Return Status: None
310 */
311void WDI_DS_GetTrafficStats(WDI_TrafficStatsType** pStats, wpt_uint32 *len);
312
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800313/* @brief: WDI_DS_DeactivateTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800314 * This function should be invoked to deactivate traffic stats collection
315 * Parameters: None
316 * Return Status: None
317 */
318void WDI_DS_DeactivateTrafficStats(void);
319
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800320/* @brief: WDI_DS_ActivateTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800321 * This function should be invoked to activate traffic stats collection
322 * Parameters: None
323 * Return Status: None
324 */
325void WDI_DS_ActivateTrafficStats(void);
326
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800327/* @brief: WDI_DS_ClearTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800328 * This function should be invoked to clear all past stats
329 * Parameters: None
330 * Return Status: None
331 */
332void WDI_DS_ClearTrafficStats(void);
333
Jeff Johnson295189b2012-06-20 16:38:30 -0700334#endif