Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 5 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6 | #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 | |
| 31 | typedef 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 Lanctot | 4b08862 | 2013-05-22 16:09:22 -0700 | [diff] [blame] | 47 | wpt_uint8 fProtMgmtFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | wpt_uint16 fPktlen; |
| 49 | wpt_status txCompleteStatus; |
Kumar Anand | 90ca3dd | 2013-01-18 15:24:47 -0800 | [diff] [blame] | 50 | wpt_uint8 staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 51 | } WDI_DS_TxMetaInfoType; |
| 52 | |
| 53 | |
| 54 | typedef 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 | |
| 69 | typedef 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 Lokere | 79540f9 | 2013-04-25 17:32:16 -0700 | [diff] [blame] | 76 | wpt_uint8 rfBand:2; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | |
| 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 Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 129 | |
| 130 | #ifdef WLAN_FEATURE_11W |
| 131 | wpt_uint32 rmf:1; |
| 132 | #endif |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 133 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 134 | wpt_uint32 offloadScanLearn; |
| 135 | wpt_uint32 roamCandidateInd; |
| 136 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 137 | } WDI_DS_RxMetaInfoType; |
| 138 | |
| 139 | typedef struct sPktMetaInfo |
| 140 | { |
| 141 | union |
| 142 | { |
| 143 | WDI_DS_TxMetaInfoType txMetaInfo; |
| 144 | WDI_DS_RxMetaInfoType rxMetaInfo; |
| 145 | } u; |
| 146 | } WDI_DS_MetaInfoType; |
| 147 | |
| 148 | WPT_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 | |
| 156 | WPT_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 | |
| 164 | typedef void (*WDI_DS_TxCompleteCallback)(void *pContext, wpt_packet *pFrame); |
| 165 | typedef void (*WDI_DS_RxPacketCallback) (void *pContext, wpt_packet *pFrame); |
| 166 | typedef 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 | */ |
| 185 | WDI_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 | |
| 204 | WDI_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 | |
| 219 | WDI_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 | |
| 230 | WDI_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 | |
| 242 | WDI_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 | */ |
| 252 | wpt_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 | */ |
| 263 | WDI_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 | */ |
| 272 | WDI_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 | */ |
| 282 | WDI_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 | */ |
| 292 | WDI_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 | */ |
| 302 | WDI_Status WDI_DS_ClearStaIdxPerBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 staIdx); |
| 303 | |
Kumar Anand | 90ca3dd | 2013-01-18 15:24:47 -0800 | [diff] [blame] | 304 | /* @brief: WDI_DS_GetTrafficStats |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 305 | * 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 | */ |
| 311 | void WDI_DS_GetTrafficStats(WDI_TrafficStatsType** pStats, wpt_uint32 *len); |
| 312 | |
Kumar Anand | 90ca3dd | 2013-01-18 15:24:47 -0800 | [diff] [blame] | 313 | /* @brief: WDI_DS_DeactivateTrafficStats |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 314 | * This function should be invoked to deactivate traffic stats collection |
| 315 | * Parameters: None |
| 316 | * Return Status: None |
| 317 | */ |
| 318 | void WDI_DS_DeactivateTrafficStats(void); |
| 319 | |
Kumar Anand | 90ca3dd | 2013-01-18 15:24:47 -0800 | [diff] [blame] | 320 | /* @brief: WDI_DS_ActivateTrafficStats |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 321 | * This function should be invoked to activate traffic stats collection |
| 322 | * Parameters: None |
| 323 | * Return Status: None |
| 324 | */ |
| 325 | void WDI_DS_ActivateTrafficStats(void); |
| 326 | |
Kumar Anand | 90ca3dd | 2013-01-18 15:24:47 -0800 | [diff] [blame] | 327 | /* @brief: WDI_DS_ClearTrafficStats |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 328 | * This function should be invoked to clear all past stats |
| 329 | * Parameters: None |
| 330 | * Return Status: None |
| 331 | */ |
| 332 | void WDI_DS_ClearTrafficStats(void); |
| 333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 334 | #endif |