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