Changes in uspace/lib/drv/include/usbhc_iface.h [357a302:6edd494] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/include/usbhc_iface.h
r357a302 r6edd494 27 27 */ 28 28 29 /** @addtogroup libdrv 30 * @addtogroup usb 29 /** @addtogroup libdrv usb 31 30 * @{ 32 31 */ … … 40 39 #include "driver.h" 41 40 #include <usb/usb.h> 42 #include <bool.h>43 41 44 42 … … 53 51 * - argument #1 is target address 54 52 * - argument #2 is target endpoint 55 * - argument #3 is max packet size of the endpoint53 * - argument #3 is buffer size 56 54 * - this call is immediately followed by IPC data write (from caller) 57 55 * - the initial call (and the whole transaction) is answer after the … … 66 64 * - argument #1 is target address 67 65 * - argument #2 is target endpoint 68 * - argument #3 is max packet size of the endpoint 69 * - this call is immediately followed by IPC data read (async version) 66 * - argument #3 is buffer size 70 67 * - the call is not answered until the device returns some data (or until 71 68 * error occurs) 69 * - if the call is answered with EOK, first argument of the answer is buffer 70 * hash that could be used to retrieve the actual data 72 71 * 73 72 * Some special methods (NO-DATA transactions) do not send any data. These 74 73 * might behave as both OUT or IN transactions because communication parts 75 74 * where actual buffers are exchanged are omitted. 76 ** 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 * 77 84 * For all these methods, wrap functions exists. Important rule: functions 78 85 * for IN transactions have (as parameters) buffers where retrieved data … … 85 92 */ 86 93 typedef enum { 94 /** Tell USB address assigned to device. 95 * Parameters: 96 * - devman handle id 97 * Answer: 98 * - EINVAL - unknown handle or handle not managed by this driver 99 * - ENOTSUP - operation not supported by HC (shall not happen) 100 * - arbitrary error code if returned by remote implementation 101 * - EOK - handle found, first parameter contains the USB address 102 */ 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 interface 108 * as it is handled by the remote part itself. 109 */ 110 IPC_M_USBHC_GET_BUFFER, 111 112 87 113 /** Reserve usage of default address. 88 114 * This call informs the host controller that the caller will be … … 141 167 IPC_M_USBHC_INTERRUPT_IN, 142 168 143 /** Send bulk data to device. 144 * See explanation at usb_iface_funcs_t (OUT transaction). 145 */ 146 IPC_M_USBHC_BULK_OUT, 147 148 /** Get bulk data from device. 169 170 /** Start WRITE control transfer. 171 * See explanation at usb_iface_funcs_t (OUT transaction). 172 */ 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. 149 193 * See explanation at usb_iface_funcs_t (IN transaction). 150 194 */ 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, 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 168 202 169 203 /* IPC_M_USB_ */ … … 172 206 /** Callback for outgoing transfer. */ 173 207 typedef void (*usbhc_iface_transfer_out_callback_t)(device_t *, 174 int, void *);208 usb_transaction_outcome_t, void *); 175 209 176 210 /** Callback for incoming transfer. */ 177 211 typedef void (*usbhc_iface_transfer_in_callback_t)(device_t *, 178 int, size_t, void *);212 usb_transaction_outcome_t, size_t, void *); 179 213 180 214 181 215 /** Out transfer processing function prototype. */ 182 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t, size_t,216 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t, 183 217 void *, size_t, 184 218 usbhc_iface_transfer_out_callback_t, void *); 185 219 186 /** Setup transfer processing function prototype. @deprecated*/220 /** Setup transfer processing function prototype. */ 187 221 typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t; 188 222 189 223 /** In transfer processing function prototype. */ 190 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t, size_t,224 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t, 191 225 void *, size_t, 192 226 usbhc_iface_transfer_in_callback_t, void *); … … 194 228 /** USB host controller communication interface. */ 195 229 typedef struct { 196 int (*reserve_default_address)(device_t *, usb_speed_t); 230 int (*tell_address)(device_t *, devman_handle_t, usb_address_t *); 231 232 int (*reserve_default_address)(device_t *); 197 233 int (*release_default_address)(device_t *); 198 int (*request_address)(device_t *, usb_ speed_t, usb_address_t *);234 int (*request_address)(device_t *, usb_address_t *); 199 235 int (*bind_address)(device_t *, usb_address_t, devman_handle_t); 200 236 int (*release_address)(device_t *, usb_address_t); … … 203 239 usbhc_iface_transfer_in_t interrupt_in; 204 240 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, 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, 244 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, 211 249 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,216 usbhc_iface_transfer_in_callback_t, void *);217 250 } usbhc_iface_t; 218 251
Note:
See TracChangeset
for help on using the changeset viewer.