Changeset 92574f4 in mainline for uspace/lib/drv/include/usbhc_iface.h
- Timestamp:
- 2011-02-24T12:03:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e7b7ebd5
- Parents:
- 4837092 (diff), a80849c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/include/usbhc_iface.h
r4837092 r92574f4 38 38 #define LIBDRV_USBHC_IFACE_H_ 39 39 40 #include "d river.h"40 #include "ddf/driver.h" 41 41 #include <usb/usb.h> 42 #include <bool.h> 42 43 43 44 … … 52 53 * - argument #1 is target address 53 54 * - argument #2 is target endpoint 54 * - argument #3 is buffer size55 * - argument #3 is max packet size of the endpoint 55 56 * - this call is immediately followed by IPC data write (from caller) 56 57 * - the initial call (and the whole transaction) is answer after the … … 65 66 * - argument #1 is target address 66 67 * - argument #2 is target endpoint 67 * - argument #3 is buffer size 68 * - argument #3 is max packet size of the endpoint 69 * - this call is immediately followed by IPC data read (async version) 68 70 * - the call is not answered until the device returns some data (or until 69 71 * error occurs) 70 * - if the call is answered with EOK, first argument of the answer is buffer71 * hash that could be used to retrieve the actual data72 72 * 73 73 * Some special methods (NO-DATA transactions) do not send any data. These 74 74 * might behave as both OUT or IN transactions because communication parts 75 75 * where actual buffers are exchanged are omitted. 76 * 77 * The mentioned data retrieval can be done any time after receiving EOK 78 * answer to IN method. 79 * This retrieval is done using the IPC_M_USBHC_GET_BUFFER where 80 * the first argument is buffer hash from call answer. 81 * This call must be immediately followed by data read-in and after the 82 * data are transferred, the initial call (IPC_M_USBHC_GET_BUFFER) 83 * is answered. Each buffer can be retrieved only once. 84 * 76 ** 85 77 * For all these methods, wrap functions exists. Important rule: functions 86 78 * for IN transactions have (as parameters) buffers where retrieved data … … 93 85 */ 94 86 typedef enum { 95 /** Tell USB address assigned to device.96 * Parameters:97 * - devman handle id98 * Answer:99 * - EINVAL - unknown handle or handle not managed by this driver100 * - ENOTSUP - operation not supported by HC (shall not happen)101 * - arbitrary error code if returned by remote implementation102 * - EOK - handle found, first parameter contains the USB address103 */104 IPC_M_USBHC_GET_ADDRESS,105 106 /** Asks for data buffer.107 * See explanation at usb_iface_funcs_t.108 * This function does not have counter part in functional interface109 * as it is handled by the remote part itself.110 */111 IPC_M_USBHC_GET_BUFFER,112 113 114 87 /** Reserve usage of default address. 115 88 * This call informs the host controller that the caller will be … … 168 141 IPC_M_USBHC_INTERRUPT_IN, 169 142 170 171 /** Start WRITE control transfer. 143 /** Send bulk data to device. 172 144 * See explanation at usb_iface_funcs_t (OUT transaction). 173 145 */ 174 IPC_M_USBHC_CONTROL_WRITE_SETUP, 175 176 /** Send control-transfer data to device. 177 * See explanation at usb_iface_funcs_t (OUT transaction). 178 */ 179 IPC_M_USBHC_CONTROL_WRITE_DATA, 180 181 /** Terminate WRITE control transfer. 182 * See explanation at usb_iface_funcs_t (NO-DATA transaction). 183 */ 184 IPC_M_USBHC_CONTROL_WRITE_STATUS, 185 186 187 188 /** Start READ control transfer. 189 * See explanation at usb_iface_funcs_t (OUT transaction). 190 */ 191 IPC_M_USBHC_CONTROL_READ_SETUP, 192 193 /** Get control-transfer data from device. 146 IPC_M_USBHC_BULK_OUT, 147 148 /** Get bulk data from device. 194 149 * See explanation at usb_iface_funcs_t (IN transaction). 195 150 */ 196 IPC_M_USBHC_CONTROL_READ_DATA, 197 198 /** Terminate READ control transfer. 199 * See explanation at usb_iface_funcs_t (NO-DATA transaction). 200 */ 201 IPC_M_USBHC_CONTROL_READ_STATUS, 151 IPC_M_USBHC_BULK_IN, 202 152 203 153 /** Issue control WRITE transfer. … … 209 159 IPC_M_USBHC_CONTROL_WRITE, 210 160 211 /** Issue control WRITEtransfer.161 /** Issue control READ transfer. 212 162 * See explanation at usb_iface_funcs_t (IN transaction) for 213 163 * call parameters. 214 * This call is immediately followed by IPC data read from the caller 215 * (setup packet). 216 * Actual data are retrieved through IPC_M_USBHC_GET_BUFFER. 164 * This call is immediately followed by IPC data write from the caller 165 * (setup packet) and IPC data read (buffer that was read). 217 166 */ 218 167 IPC_M_USBHC_CONTROL_READ, … … 222 171 223 172 /** Callback for outgoing transfer. */ 224 typedef void (*usbhc_iface_transfer_out_callback_t)(d evice_t *,225 usb_transaction_outcome_t, void *);173 typedef void (*usbhc_iface_transfer_out_callback_t)(ddf_fun_t *, 174 int, void *); 226 175 227 176 /** Callback for incoming transfer. */ 228 typedef void (*usbhc_iface_transfer_in_callback_t)(d evice_t *,229 usb_transaction_outcome_t, size_t, void *);177 typedef void (*usbhc_iface_transfer_in_callback_t)(ddf_fun_t *, 178 int, size_t, void *); 230 179 231 180 232 181 /** Out transfer processing function prototype. */ 233 typedef int (*usbhc_iface_transfer_out_t)(d evice_t *, usb_target_t,182 typedef int (*usbhc_iface_transfer_out_t)(ddf_fun_t *, usb_target_t, size_t, 234 183 void *, size_t, 235 184 usbhc_iface_transfer_out_callback_t, void *); 236 185 237 /** Setup transfer processing function prototype. */186 /** Setup transfer processing function prototype. @deprecated */ 238 187 typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t; 239 188 240 189 /** In transfer processing function prototype. */ 241 typedef int (*usbhc_iface_transfer_in_t)(d evice_t *, usb_target_t,190 typedef int (*usbhc_iface_transfer_in_t)(ddf_fun_t *, usb_target_t, size_t, 242 191 void *, size_t, 243 192 usbhc_iface_transfer_in_callback_t, void *); … … 245 194 /** USB host controller communication interface. */ 246 195 typedef struct { 247 int (*tell_address)(device_t *, devman_handle_t, usb_address_t *); 248 249 int (*reserve_default_address)(device_t *); 250 int (*release_default_address)(device_t *); 251 int (*request_address)(device_t *, usb_address_t *); 252 int (*bind_address)(device_t *, usb_address_t, devman_handle_t); 253 int (*release_address)(device_t *, usb_address_t); 196 int (*reserve_default_address)(ddf_fun_t *, usb_speed_t); 197 int (*release_default_address)(ddf_fun_t *); 198 int (*request_address)(ddf_fun_t *, usb_speed_t, usb_address_t *); 199 int (*bind_address)(ddf_fun_t *, usb_address_t, devman_handle_t); 200 int (*release_address)(ddf_fun_t *, usb_address_t); 254 201 255 202 usbhc_iface_transfer_out_t interrupt_out; 256 203 usbhc_iface_transfer_in_t interrupt_in; 257 204 258 usbhc_iface_transfer_setup_t control_write_setup; 259 usbhc_iface_transfer_out_t control_write_data; 260 int (*control_write_status)(device_t *, usb_target_t, 261 usbhc_iface_transfer_in_callback_t, void *); 262 263 usbhc_iface_transfer_setup_t control_read_setup; 264 usbhc_iface_transfer_in_t control_read_data; 265 int (*control_read_status)(device_t *, usb_target_t, 266 usbhc_iface_transfer_out_callback_t, void *); 267 268 int (*control_write)(device_t *, usb_target_t, 205 usbhc_iface_transfer_out_t bulk_out; 206 usbhc_iface_transfer_in_t bulk_in; 207 208 int (*control_write)(ddf_fun_t *, usb_target_t, 209 size_t, 269 210 void *, size_t, void *, size_t, 270 211 usbhc_iface_transfer_out_callback_t, void *); 271 212 272 int (*control_read)(device_t *, usb_target_t, 213 int (*control_read)(ddf_fun_t *, usb_target_t, 214 size_t, 273 215 void *, size_t, void *, size_t, 274 216 usbhc_iface_transfer_in_callback_t, void *);
Note:
See TracChangeset
for help on using the changeset viewer.