Changeset 5c69377 in mainline
- Timestamp:
- 2018-02-03T10:56:48Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc63815
- Parents:
- 98b1d30
- Location:
- uspace/lib/drv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r98b1d30 r5c69377 59 59 * @return Error code. 60 60 */ 61 int usbhc_reserve_default_address(async_exch_t *exch)61 errno_t usbhc_reserve_default_address(async_exch_t *exch) 62 62 { 63 63 if (!exch) … … 72 72 * @return Error code. 73 73 */ 74 int usbhc_release_default_address(async_exch_t *exch)74 errno_t usbhc_release_default_address(async_exch_t *exch) 75 75 { 76 76 if (!exch) … … 88 88 * @return Error code. 89 89 */ 90 int usbhc_device_enumerate(async_exch_t *exch, unsigned port, usb_speed_t speed)91 { 92 if (!exch) 93 return EBADMEM; 94 const int ret = async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),90 errno_t usbhc_device_enumerate(async_exch_t *exch, unsigned port, usb_speed_t speed) 91 { 92 if (!exch) 93 return EBADMEM; 94 const errno_t ret = async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 95 95 IPC_M_USB_DEVICE_ENUMERATE, port, speed); 96 96 return ret; … … 129 129 } 130 130 131 int ret = async_data_write_start(exch, desc, sizeof(*desc));131 errno_t ret = async_data_write_start(exch, desc, sizeof(*desc)); 132 132 if (ret != EOK) { 133 133 async_forget(opening_request); … … 136 136 137 137 /* Wait for the answer. */ 138 int opening_request_rc;138 errno_t opening_request_rc; 139 139 async_wait_for(opening_request, &opening_request_rc); 140 140 141 141 if (opening_request_rc) 142 return ( int) opening_request_rc;142 return (errno_t) opening_request_rc; 143 143 144 144 usb_pipe_desc_t dest; … … 166 166 } 167 167 168 const int ret = async_data_write_start(exch, pipe_desc, sizeof(*pipe_desc));168 const errno_t ret = async_data_write_start(exch, pipe_desc, sizeof(*pipe_desc)); 169 169 if (ret != EOK) { 170 170 async_forget(opening_request); … … 173 173 174 174 /* Wait for the answer. */ 175 int opening_request_rc;175 errno_t opening_request_rc; 176 176 async_wait_for(opening_request, &opening_request_rc); 177 177 178 return ( int) opening_request_rc;178 return (errno_t) opening_request_rc; 179 179 } 180 180 … … 313 313 314 314 const bool reserve = IPC_GET_ARG2(*call); 315 const int ret = usbhc_iface->default_address_reservation(fun, reserve);315 const errno_t ret = usbhc_iface->default_address_reservation(fun, reserve); 316 316 async_answer_0(callid, ret); 317 317 } … … 330 330 const unsigned port = DEV_IPC_GET_ARG1(*call); 331 331 usb_speed_t speed = DEV_IPC_GET_ARG2(*call); 332 const int ret = usbhc_iface->device_enumerate(fun, port, speed);332 const errno_t ret = usbhc_iface->device_enumerate(fun, port, speed); 333 333 async_answer_0(callid, ret); 334 334 } … … 345 345 346 346 const unsigned port = DEV_IPC_GET_ARG1(*call); 347 const int ret = usbhc_iface->device_remove(fun, port);347 const errno_t ret = usbhc_iface->device_remove(fun, port); 348 348 async_answer_0(callid, ret); 349 349 } … … 376 376 usb_pipe_desc_t pipe_desc; 377 377 378 const int rc = usbhc_iface->register_endpoint(fun, &pipe_desc, &ep_desc);378 const errno_t rc = usbhc_iface->register_endpoint(fun, &pipe_desc, &ep_desc); 379 379 async_answer_0(callid, rc); 380 380 … … 411 411 async_data_write_finalize(data_callid, &pipe_desc, sizeof(pipe_desc)); 412 412 413 const int rc = usbhc_iface->unregister_endpoint(fun, &pipe_desc);413 const errno_t rc = usbhc_iface->unregister_endpoint(fun, &pipe_desc); 414 414 async_answer_0(callid, rc); 415 415 } … … 440 440 } 441 441 442 static errno_t transfer_finished(void *arg, int error, size_t transferred_size)442 static errno_t transfer_finished(void *arg, errno_t error, size_t transferred_size) 443 443 { 444 444 async_transaction_t *trans = arg; -
uspace/lib/drv/include/usbhc_iface.h
r98b1d30 r5c69377 160 160 /** USB device communication interface. */ 161 161 typedef struct { 162 int (*default_address_reservation)(ddf_fun_t *, bool);162 errno_t (*default_address_reservation)(ddf_fun_t *, bool); 163 163 164 int (*device_enumerate)(ddf_fun_t *, unsigned, usb_speed_t);165 int (*device_remove)(ddf_fun_t *, unsigned);164 errno_t (*device_enumerate)(ddf_fun_t *, unsigned, usb_speed_t); 165 errno_t (*device_remove)(ddf_fun_t *, unsigned); 166 166 167 int (*register_endpoint)(ddf_fun_t *, usb_pipe_desc_t *, const usb_endpoint_descriptors_t *);168 int (*unregister_endpoint)(ddf_fun_t *, const usb_pipe_desc_t *);167 errno_t (*register_endpoint)(ddf_fun_t *, usb_pipe_desc_t *, const usb_endpoint_descriptors_t *); 168 errno_t (*unregister_endpoint)(ddf_fun_t *, const usb_pipe_desc_t *); 169 169 170 170 errno_t (*transfer)(ddf_fun_t *, usb_target_t,
Note:
See TracChangeset
for help on using the changeset viewer.