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