Changeset 5a6cc679 in mainline for uspace/lib/usbhost/src/ddf_helpers.c
- Timestamp:
- 2018-01-31T02:21:24Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0a9cc2
- Parents:
- 132ab5d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/ddf_helpers.c
r132ab5d1 r5a6cc679 63 63 * @return Error code. 64 64 */ 65 static int register_endpoint(ddf_fun_t *fun, usb_pipe_desc_t *pipe_desc,65 static errno_t register_endpoint(ddf_fun_t *fun, usb_pipe_desc_t *pipe_desc, 66 66 const usb_endpoint_descriptors_t *ep_desc) 67 67 { … … 97 97 * @return Error code. 98 98 */ 99 static int unregister_endpoint(ddf_fun_t *fun, const usb_pipe_desc_t *pipe_desc)99 static errno_t unregister_endpoint(ddf_fun_t *fun, const usb_pipe_desc_t *pipe_desc) 100 100 { 101 101 assert(fun); … … 118 118 * @param fun DDF function of the device (hub) requesting the address. 119 119 */ 120 static int default_address_reservation(ddf_fun_t *fun, bool reserve)120 static errno_t default_address_reservation(ddf_fun_t *fun, bool reserve) 121 121 { 122 122 assert(fun); … … 142 142 * @param speed USB speed of the new device 143 143 */ 144 static int device_enumerate(ddf_fun_t *fun, unsigned port, usb_speed_t speed)144 static errno_t device_enumerate(ddf_fun_t *fun, unsigned port, usb_speed_t speed) 145 145 { 146 146 assert(fun); … … 152 152 assert(hub); 153 153 154 int err;154 errno_t err; 155 155 156 156 if (!usb_speed_is_valid(speed)) … … 195 195 } 196 196 197 static int device_remove(ddf_fun_t *fun, unsigned port)197 static errno_t device_remove(ddf_fun_t *fun, unsigned port) 198 198 { 199 199 assert(fun); … … 235 235 * @return Error code. 236 236 */ 237 static int get_device_description(ddf_fun_t *fun, usb_device_desc_t *desc)237 static errno_t get_device_description(ddf_fun_t *fun, usb_device_desc_t *desc) 238 238 { 239 239 assert(fun); … … 264 264 * @return Error code. 265 265 */ 266 static int dev_read(ddf_fun_t *fun, usb_target_t target,266 static errno_t dev_read(ddf_fun_t *fun, usb_target_t target, 267 267 uint64_t setup_data, char *data, size_t size, 268 268 usbhc_iface_transfer_callback_t callback, void *arg) … … 298 298 * @return Error code. 299 299 */ 300 static int dev_write(ddf_fun_t *fun, usb_target_t target,300 static errno_t dev_write(ddf_fun_t *fun, usb_target_t target, 301 301 uint64_t setup_data, const char *data, size_t size, 302 302 usbhc_iface_transfer_callback_t callback, void *arg) … … 370 370 371 371 /* This is a copy of lib/usbdev/src/recognise.c */ 372 static int create_match_ids(match_id_list_t *l,372 static errno_t create_match_ids(match_id_list_t *l, 373 373 usb_standard_device_descriptor_t *d) 374 374 { … … 427 427 } 428 428 429 int hcd_ddf_setup_match_ids(device_t *device, usb_standard_device_descriptor_t *desc)430 { 431 int err;429 errno_t hcd_ddf_setup_match_ids(device_t *device, usb_standard_device_descriptor_t *desc) 430 { 431 errno_t err; 432 432 match_id_list_t mids; 433 433 … … 457 457 * This function does all the ddf work for hc driver. 458 458 */ 459 int hcd_ddf_setup_hc(ddf_dev_t *device, size_t size)459 errno_t hcd_ddf_setup_hc(ddf_dev_t *device, size_t size) 460 460 { 461 461 assert(device); … … 468 468 instance->ddf_dev = device; 469 469 470 int ret = ENOMEM;470 errno_t ret = ENOMEM; 471 471 instance->ctl_fun = ddf_fun_create(device, fun_exposed, "ctl"); 472 472 if (!instance->ctl_fun) { … … 510 510 * @return Error code. 511 511 */ 512 int hcd_ddf_enable_interrupt(hc_device_t *hcd, int inum)512 errno_t hcd_ddf_enable_interrupt(hc_device_t *hcd, int inum) 513 513 { 514 514 async_sess_t *parent_sess = ddf_dev_parent_sess_get(hcd->ddf_dev); … … 519 519 } 520 520 521 int hcd_ddf_get_registers(hc_device_t *hcd, hw_res_list_parsed_t *hw_res)521 errno_t hcd_ddf_get_registers(hc_device_t *hcd, hw_res_list_parsed_t *hw_res) 522 522 { 523 523 async_sess_t *parent_sess = ddf_dev_parent_sess_get(hcd->ddf_dev); … … 526 526 527 527 hw_res_list_parsed_init(hw_res); 528 const int ret = hw_res_get_list_parsed(parent_sess, hw_res, 0);528 const errno_t ret = hw_res_get_list_parsed(parent_sess, hw_res, 0); 529 529 if (ret != EOK) 530 530 hw_res_list_parsed_clean(hw_res);
Note:
See TracChangeset
for help on using the changeset viewer.