Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 1ed83fc | 2014-02-19 01:15:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 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. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 1ed83fc | 2014-02-19 01:15:45 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | #ifndef WLAN_QCT_WDI_CTS_H |
| 29 | #define WLAN_QCT_WDI_CTS_H |
| 30 | |
| 31 | /*=========================================================================== |
| 32 | |
| 33 | W L A N C O N T R O L T R A N S P O R T S E R V I C E |
| 34 | E X T E R N A L A P I |
| 35 | |
| 36 | |
| 37 | DESCRIPTION |
| 38 | This file contains the external API exposed by the wlan control transport |
| 39 | service module. |
| 40 | |
| 41 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | ===========================================================================*/ |
| 43 | |
| 44 | |
| 45 | /*=========================================================================== |
| 46 | |
| 47 | EDIT HISTORY FOR FILE |
| 48 | |
| 49 | |
| 50 | This section contains comments describing changes made to the module. |
| 51 | Notice that changes are listed in reverse chronological order. |
| 52 | |
| 53 | |
| 54 | $Header:$ $DateTime: $ $Author: $ |
| 55 | |
| 56 | |
| 57 | when who what, where, why |
| 58 | -------- --- ---------------------------------------------------------- |
| 59 | 08/04/10 mss Created module. |
| 60 | |
| 61 | ===========================================================================*/ |
| 62 | |
| 63 | |
| 64 | |
| 65 | /*=========================================================================== |
| 66 | |
| 67 | INCLUDE FILES FOR MODULE |
| 68 | |
| 69 | ===========================================================================*/ |
| 70 | |
| 71 | /*---------------------------------------------------------------------------- |
| 72 | * Include Files |
| 73 | * -------------------------------------------------------------------------*/ |
| 74 | #include "wlan_qct_pal_type.h" |
| 75 | |
| 76 | /*---------------------------------------------------------------------------- |
| 77 | * Preprocessor Definitions and Constants |
| 78 | * -------------------------------------------------------------------------*/ |
| 79 | #ifdef __cplusplus |
| 80 | extern "C" { |
| 81 | #endif |
| 82 | |
| 83 | /*---------------------------------------------------------------------------- |
| 84 | * Type Declarations |
| 85 | * -------------------------------------------------------------------------*/ |
| 86 | |
| 87 | /* Control Transport Service Handle Type*/ |
| 88 | typedef void* WCTS_HandleType; |
| 89 | |
| 90 | /*--------------------------------------------------------------------------- |
| 91 | WCTS_NotifyEventType |
| 92 | ---------------------------------------------------------------------------*/ |
| 93 | typedef enum |
| 94 | { |
| 95 | WCTS_EVENT_OPEN, |
| 96 | WCTS_EVENT_CLOSE, |
| 97 | WCTS_EVENT_MAX |
| 98 | } WCTS_NotifyEventType; |
| 99 | |
| 100 | /*---------------------------------------------------------------------------- |
| 101 | * WDI callback types |
| 102 | *--------------------------------------------------------------------------*/ |
| 103 | |
| 104 | /*--------------------------------------------------------------------------- |
| 105 | WCTS_NotifyCBType |
| 106 | |
| 107 | DESCRIPTION |
| 108 | |
| 109 | This callback is invoked by the control transport when it wishes to send |
| 110 | up a notification like the ones mentioned above. |
| 111 | |
| 112 | PARAMETERS |
| 113 | |
| 114 | IN |
| 115 | wctsHandle: handle to the control transport service |
| 116 | wctsEvent: the event being notified |
| 117 | wctsNotifyCBData: the callback data of the user |
| 118 | |
| 119 | |
| 120 | RETURN VALUE |
| 121 | None |
| 122 | ---------------------------------------------------------------------------*/ |
| 123 | typedef void (*WCTS_NotifyCBType) (WCTS_HandleType wctsHandle, |
| 124 | WCTS_NotifyEventType wctsEvent, |
| 125 | void* wctsNotifyCBData); |
| 126 | |
| 127 | /*--------------------------------------------------------------------------- |
| 128 | WCTS_RxMsgCBType |
| 129 | |
| 130 | DESCRIPTION |
| 131 | |
| 132 | This callback is invoked by the control transport when it wishes to send |
| 133 | up a packet received over the bus. Upon return of Rx callback, the ownership |
| 134 | of the message belongs to the CT and this one is free to deallocate any |
| 135 | buffer that was used to get this message. If WDI wishes to maintain the |
| 136 | information beyond the lifetime of the call, it must make a copy of it. |
| 137 | |
| 138 | PARAMETERS |
| 139 | |
| 140 | IN |
| 141 | wctsHandle: handle to the control transport service |
| 142 | pMsg: the packet |
| 143 | uLen: the packet length |
| 144 | wctsRxMsgCBData: the callback data of the user |
| 145 | |
| 146 | |
| 147 | RETURN VALUE |
| 148 | None |
| 149 | ---------------------------------------------------------------------------*/ |
| 150 | typedef void (*WCTS_RxMsgCBType) (WCTS_HandleType wctsHandle, |
| 151 | void* pMsg, |
| 152 | wpt_uint32 uLen, |
| 153 | void* wctsRxMsgCBData); |
| 154 | |
| 155 | /*--------------------------------------------------------------------------- |
| 156 | WCTS Transport Callbacks holder type |
| 157 | ---------------------------------------------------------------------------*/ |
| 158 | typedef struct |
| 159 | { |
| 160 | WCTS_NotifyCBType wctsNotifyCB; |
| 161 | void* wctsNotifyCBData; |
| 162 | WCTS_RxMsgCBType wctsRxMsgCB; |
| 163 | void* wctsRxMsgCBData; |
| 164 | } WCTS_TransportCBsType; |
| 165 | |
| 166 | /*======================================================================== |
| 167 | * Function Declarations and Documentation |
| 168 | ==========================================================================*/ |
| 169 | /** |
| 170 | @brief This function is used by the DAL Core to initialize the Control |
| 171 | Transport for processing. It must be called prior to calling any |
| 172 | other APIs of the Control Transport. |
| 173 | |
| 174 | |
| 175 | @param szName: unique name for the channel that is to be opened |
| 176 | uSize: size of the channel that must be opened (should fit the |
| 177 | largest size of packet that the Dal Core wishes to send) |
| 178 | wctsCBs: a list of callbacks that the CT needs to use to send |
| 179 | notification and messages back to DAL |
| 180 | |
| 181 | @see |
| 182 | @return A handle that must be used for further communication with the CTS. |
| 183 | This is an opaque structure for the caller and it will be used in |
| 184 | all communications to and from the CTS. |
| 185 | |
| 186 | */ |
| 187 | WCTS_HandleType |
| 188 | WCTS_OpenTransport |
| 189 | ( |
| 190 | const wpt_uint8* szName, |
| 191 | wpt_uint32 uSize, |
| 192 | WCTS_TransportCBsType* wctsCBs |
| 193 | ); |
| 194 | |
| 195 | /** |
| 196 | @brief This function is used by the DAL Core to to close the |
| 197 | Control Transport when its services are no longer |
| 198 | needed. Full close notification will be receive |
| 199 | asynchronously on the notification callback |
| 200 | registered on Open |
| 201 | |
| 202 | |
| 203 | @param wctsHandlehandle: received upon open |
| 204 | |
| 205 | @see |
| 206 | @return 0 for success |
| 207 | */ |
| 208 | wpt_uint32 |
| 209 | WCTS_CloseTransport |
| 210 | ( |
| 211 | WCTS_HandleType wctsHandle |
| 212 | ); |
| 213 | |
| 214 | /** |
| 215 | @brief This function is used by the DAL Core to to send a |
| 216 | message over to the WLAN sub-system. |
| 217 | |
| 218 | Once a buffer has been passed into the Send Message |
| 219 | API, CT takes full ownership of it and it is responsible for |
| 220 | freeing the associated resources. (This prevents a memcpy in |
| 221 | case of a deffered write) |
| 222 | |
| 223 | The messages transported through the CT on both RX and TX are |
| 224 | flat memory buffers that can be accessed and manipulated |
| 225 | through standard memory functions. |
| 226 | |
| 227 | @param wctsHandlehandle: received upon open |
| 228 | pMsg: the message to be sent |
| 229 | uLen: the length of the message |
| 230 | |
| 231 | @see |
| 232 | @return 0 for success |
| 233 | */ |
| 234 | wpt_uint32 |
| 235 | WCTS_SendMessage |
| 236 | ( |
| 237 | WCTS_HandleType wctsHandle, |
| 238 | void* pMsg, |
| 239 | wpt_uint32 uLen |
| 240 | ); |
| 241 | |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 242 | /** |
| 243 | @brief This helper function is used to clean up the pending |
| 244 | messages in the transport queue |
| 245 | |
| 246 | @param wctsHandlehandle: transport handle |
| 247 | |
| 248 | @see |
| 249 | @return 0 for success |
| 250 | */ |
| 251 | wpt_uint32 |
| 252 | WCTS_ClearPendingQueue |
| 253 | ( |
| 254 | WCTS_HandleType wctsHandle |
| 255 | ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | #endif /* #ifndef WLAN_QCT_WDI_CTS_H */ |