Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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. |
| 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 | |
| 62 | typedef 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 | |
| 71 | typedef 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 | |
| 81 | typedef wpt_status (*WDTS_TxCompleteCbType)(void *pContext, wpt_packet *pFrame, wpt_status status); |
| 82 | typedef wpt_status (*WDTS_RxFrameReadyCbType) (void *pContext, wpt_packet *pFrame, WDTS_ChannelType channel); |
| 83 | typedef wpt_status (*WDTS_LowResourceCbType)(void *pContext, WDTS_ChannelType channel, wpt_boolean on); |
| 84 | typedef 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 | */ |
| 94 | typedef void (*WDTS_SetPowerStateCbType)(wpt_status status, |
| 95 | unsigned int dxePhyAddr, |
| 96 | void* pUserData); |
| 97 | |
| 98 | typedef 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); |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame^] | 107 | void (*channelDebug)(wpt_boolean displaySnapshot, |
| 108 | wpt_boolean enableStallDetect); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | wpt_status (*stop) (void *pContext); |
| 110 | wpt_status (*close) (void *pContext); |
| 111 | wpt_uint32 (*getFreeTxDataResNumber) (void *pContext); |
| 112 | } WDTS_TransportDriverTrype; |
| 113 | |
| 114 | typedef struct { |
| 115 | WDTS_SetPowerStateCbType cback; |
| 116 | void* pUserData; |
| 117 | } WDTS_SetPowerStateCbInfoType; |
| 118 | |
| 119 | /* DTS open function. |
| 120 | * On open the transport device should initialize itself. |
| 121 | * Parameters: |
| 122 | * pContext:Cookie that should be passed back to the caller along |
| 123 | * with the callback. |
| 124 | * |
| 125 | * Return Value: SUCCESS Completed successfully. |
| 126 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 127 | |
| 128 | */ |
| 129 | wpt_status WDTS_openTransport( void *pContext); |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | /* DTS start function. |
| 135 | * On start the transport device should start running. |
| 136 | * Parameters: |
| 137 | * pContext:Cookie that should be passed back to the caller along |
| 138 | * with the callback. |
| 139 | * |
| 140 | * Return Value: SUCCESS Completed successfully. |
| 141 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 142 | * |
| 143 | */ |
| 144 | wpt_status WDTS_startTransport( void *pContext); |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | /* DTS Tx packet function. |
| 150 | * This function should be invoked by the DAL Dataservice to schedule transmit frame through DXE/SDIO. |
| 151 | * Parameters: |
| 152 | * pContext:Cookie that should be passed back to the caller along with the callback. |
| 153 | * pFrame:Refernce to PAL frame. |
| 154 | * Return Value: SUCCESS Completed successfully. |
| 155 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 156 | * |
| 157 | */ |
| 158 | wpt_status WDTS_TxPacket(void *pContext, wpt_packet *pFrame); |
| 159 | |
| 160 | /* DTS Tx Complete function. |
| 161 | * This function should be invoked by the DAL Dataservice to notify tx completion to DXE/SDIO. |
| 162 | * Parameters: |
| 163 | * pContext:Cookie that should be passed back to the caller along with the callback. |
| 164 | * ucTxResReq:TX resource number required by TL |
| 165 | * Return Value: SUCCESS Completed successfully. |
| 166 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 167 | * |
| 168 | */ |
| 169 | wpt_status WDTS_CompleteTx(void *pContext, wpt_uint32 ucTxResReq); |
| 170 | |
| 171 | /* DTS Set power state function. |
| 172 | * This function should be invoked by the DAL to notify the WLAN device power state. |
| 173 | * Parameters: |
| 174 | * pContext:Cookie that should be passed back to the caller along with the callback. |
| 175 | * powerState:Power state of the WLAN device. |
| 176 | * Return Value: SUCCESS Set successfully in DXE control blk. |
| 177 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 178 | * |
| 179 | */ |
| 180 | wpt_status WDTS_SetPowerState(void *pContext, WDTS_PowerStateType powerState, |
| 181 | WDTS_SetPowerStateCbType cback); |
| 182 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame^] | 183 | /* DTS Transport Channel Debug |
| 184 | * Display DXE Channel debugging information |
| 185 | * User may request to display DXE channel snapshot |
| 186 | * Or if host driver detects any abnormal stcuk may display |
| 187 | * Parameters: |
| 188 | * displaySnapshot : Dispaly DXE snapshot option |
| 189 | * enableStallDetect : Enable stall detect feature |
| 190 | This feature will take effect to data performance |
| 191 | Not integrate till fully verification |
| 192 | * Return Value: NONE |
| 193 | * |
| 194 | */ |
| 195 | void WDTS_ChannelDebug(wpt_boolean dispalySnapshot, wpt_boolean toggleStallDetect); |
| 196 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 197 | /* DTS Stop function. |
| 198 | * Stop Transport driver, ie DXE, SDIO |
| 199 | * Parameters: |
| 200 | * pContext:Cookie that should be passed back to the caller along with the callback. |
| 201 | * Return Value: SUCCESS Completed successfully. |
| 202 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 203 | * |
| 204 | */ |
| 205 | wpt_status WDTS_Stop(void *pContext); |
| 206 | |
| 207 | /* DTS Close function. |
| 208 | * Close Transport driver, ie DXE, SDIO |
| 209 | * Parameters: |
| 210 | * pContext:Cookie that should be passed back to the caller along with the callback. |
| 211 | * Return Value: SUCCESS Completed successfully. |
| 212 | * FAILURE_XXX Request was rejected due XXX Reason. |
| 213 | * |
| 214 | */ |
| 215 | wpt_status WDTS_Close(void *pContext); |
| 216 | |
| 217 | /* Get free TX data descriptor number from DXE |
| 218 | * Parameters: |
| 219 | * pContext: Cookie that should be passed back to the caller along with the callback. |
| 220 | * Return Value: number of free descriptors for TX data channel |
| 221 | * |
| 222 | */ |
| 223 | wpt_uint32 WDTS_GetFreeTxDataResNumber(void *pContext); |
| 224 | |
| 225 | #endif |