Changes in uspace/lib/drv/include/usbhc_iface.h [6edd494:357a302] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/include/usbhc_iface.h
r6edd494 r357a302 27 27 */ 28 28 29 /** @addtogroup libdrv usb 29 /** @addtogroup libdrv 30 * @addtogroup usb 30 31 * @{ 31 32 */ … … 39 40 #include "driver.h" 40 41 #include <usb/usb.h> 42 #include <bool.h> 41 43 42 44 … … 51 53 * - argument #1 is target address 52 54 * - argument #2 is target endpoint 53 * - argument #3 is buffer size55 * - argument #3 is max packet size of the endpoint 54 56 * - this call is immediately followed by IPC data write (from caller) 55 57 * - the initial call (and the whole transaction) is answer after the … … 64 66 * - argument #1 is target address 65 67 * - argument #2 is target endpoint 66 * - 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) 67 70 * - the call is not answered until the device returns some data (or until 68 71 * error occurs) 69 * - if the call is answered with EOK, first argument of the answer is buffer70 * hash that could be used to retrieve the actual data71 72 * 72 73 * Some special methods (NO-DATA transactions) do not send any data. These 73 74 * might behave as both OUT or IN transactions because communication parts 74 75 * where actual buffers are exchanged are omitted. 75 * 76 * The mentioned data retrieval can be done any time after receiving EOK 77 * answer to IN method. 78 * This retrieval is done using the IPC_M_USBHC_GET_BUFFER where 79 * the first argument is buffer hash from call answer. 80 * This call must be immediately followed by data read-in and after the 81 * data are transferred, the initial call (IPC_M_USBHC_GET_BUFFER) 82 * is answered. Each buffer can be retrieved only once. 83 * 76 ** 84 77 * For all these methods, wrap functions exists. Important rule: functions 85 78 * for IN transactions have (as parameters) buffers where retrieved data … … 92 85 */ 93 86 typedef enum { 94 /** Tell USB address assigned to device.95 * Parameters:96 * - devman handle id97 * Answer:98 * - EINVAL - unknown handle or handle not managed by this driver99 * - ENOTSUP - operation not supported by HC (shall not happen)100 * - arbitrary error code if returned by remote implementation101 * - EOK - handle found, first parameter contains the USB address102 */103 IPC_M_USBHC_GET_ADDRESS,104 105 /** Asks for data buffer.106 * See explanation at usb_iface_funcs_t.107 * This function does not have counter part in functional interface108 * as it is handled by the remote part itself.109 */110 IPC_M_USBHC_GET_BUFFER,111 112 113 87 /** Reserve usage of default address. 114 88 * This call informs the host controller that the caller will be … … 167 141 IPC_M_USBHC_INTERRUPT_IN, 168 142 169 170 /** Start WRITE control transfer. 143 /** Send bulk data to device. 171 144 * See explanation at usb_iface_funcs_t (OUT transaction). 172 145 */ 173 IPC_M_USBHC_CONTROL_WRITE_SETUP, 174 175 /** Send control-transfer data to device. 176 * See explanation at usb_iface_funcs_t (OUT transaction). 177 */ 178 IPC_M_USBHC_CONTROL_WRITE_DATA, 179 180 /** Terminate WRITE control transfer. 181 * See explanation at usb_iface_funcs_t (NO-DATA transaction). 182 */ 183 IPC_M_USBHC_CONTROL_WRITE_STATUS, 184 185 186 187 /** Start READ control transfer. 188 * See explanation at usb_iface_funcs_t (OUT transaction). 189 */ 190 IPC_M_USBHC_CONTROL_READ_SETUP, 191 192 /** Get control-transfer data from device. 146 IPC_M_USBHC_BULK_OUT, 147 148 /** Get bulk data from device. 193 149 * See explanation at usb_iface_funcs_t (IN transaction). 194 150 */ 195 IPC_M_USBHC_CONTROL_READ_DATA, 196 197 /** Terminate READ control transfer. 198 * See explanation at usb_iface_funcs_t (NO-DATA transaction). 199 */ 200 IPC_M_USBHC_CONTROL_READ_STATUS, 201 151 IPC_M_USBHC_BULK_IN, 152 153 /** Issue control WRITE transfer. 154 * See explanation at usb_iface_funcs_t (OUT transaction) for 155 * call parameters. 156 * This call is immediately followed by two IPC data writes 157 * from the caller (setup packet and actual data). 158 */ 159 IPC_M_USBHC_CONTROL_WRITE, 160 161 /** Issue control READ transfer. 162 * See explanation at usb_iface_funcs_t (IN transaction) for 163 * call parameters. 164 * This call is immediately followed by IPC data write from the caller 165 * (setup packet) and IPC data read (buffer that was read). 166 */ 167 IPC_M_USBHC_CONTROL_READ, 202 168 203 169 /* IPC_M_USB_ */ … … 206 172 /** Callback for outgoing transfer. */ 207 173 typedef void (*usbhc_iface_transfer_out_callback_t)(device_t *, 208 usb_transaction_outcome_t, void *);174 int, void *); 209 175 210 176 /** Callback for incoming transfer. */ 211 177 typedef void (*usbhc_iface_transfer_in_callback_t)(device_t *, 212 usb_transaction_outcome_t, size_t, void *);178 int, size_t, void *); 213 179 214 180 215 181 /** Out transfer processing function prototype. */ 216 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t, 182 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t, size_t, 217 183 void *, size_t, 218 184 usbhc_iface_transfer_out_callback_t, void *); 219 185 220 /** Setup transfer processing function prototype. */186 /** Setup transfer processing function prototype. @deprecated */ 221 187 typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t; 222 188 223 189 /** In transfer processing function prototype. */ 224 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t, 190 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t, size_t, 225 191 void *, size_t, 226 192 usbhc_iface_transfer_in_callback_t, void *); … … 228 194 /** USB host controller communication interface. */ 229 195 typedef struct { 230 int (*tell_address)(device_t *, devman_handle_t, usb_address_t *); 231 232 int (*reserve_default_address)(device_t *); 196 int (*reserve_default_address)(device_t *, usb_speed_t); 233 197 int (*release_default_address)(device_t *); 234 int (*request_address)(device_t *, usb_ address_t *);198 int (*request_address)(device_t *, usb_speed_t, usb_address_t *); 235 199 int (*bind_address)(device_t *, usb_address_t, devman_handle_t); 236 200 int (*release_address)(device_t *, usb_address_t); … … 239 203 usbhc_iface_transfer_in_t interrupt_in; 240 204 241 usbhc_iface_transfer_setup_t control_write_setup; 242 usbhc_iface_transfer_out_t control_write_data; 243 int (*control_write_status)(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)(device_t *, usb_target_t, 209 size_t, 210 void *, size_t, void *, size_t, 211 usbhc_iface_transfer_out_callback_t, void *); 212 213 int (*control_read)(device_t *, usb_target_t, 214 size_t, 215 void *, size_t, void *, size_t, 244 216 usbhc_iface_transfer_in_callback_t, void *); 245 246 usbhc_iface_transfer_setup_t control_read_setup;247 usbhc_iface_transfer_in_t control_read_data;248 int (*control_read_status)(device_t *, usb_target_t,249 usbhc_iface_transfer_out_callback_t, void *);250 217 } usbhc_iface_t; 251 218
Note:
See TracChangeset
for help on using the changeset viewer.