Changeset 5a6cc679 in mainline for uspace/lib/usbhost
- 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
- Location:
- uspace/lib/usbhost
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/ddf_helpers.h
r132ab5d1 r5a6cc679 45 45 46 46 47 int hcd_ddf_setup_hc(ddf_dev_t *, size_t);47 errno_t hcd_ddf_setup_hc(ddf_dev_t *, size_t); 48 48 void hcd_ddf_clean_hc(hc_device_t *); 49 49 … … 52 52 void hcd_ddf_fun_destroy(device_t *); 53 53 54 int hcd_ddf_setup_match_ids(device_t *, usb_standard_device_descriptor_t *);54 errno_t hcd_ddf_setup_match_ids(device_t *, usb_standard_device_descriptor_t *); 55 55 56 int hcd_ddf_enable_interrupt(hc_device_t *hcd, int);57 int hcd_ddf_get_registers(hc_device_t *hcd, hw_res_list_parsed_t *hw_res);56 errno_t hcd_ddf_enable_interrupt(hc_device_t *hcd, int); 57 errno_t hcd_ddf_get_registers(hc_device_t *hcd, hw_res_list_parsed_t *hw_res); 58 58 59 59 void hcd_ddf_gen_irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev); -
uspace/lib/usbhost/include/usb/host/hcd.h
r132ab5d1 r5a6cc679 108 108 } 109 109 110 int hc_driver_main(const hc_driver_t *);110 extern errno_t hc_driver_main(const hc_driver_t *); 111 111 112 112 #endif -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
r132ab5d1 r5a6cc679 83 83 84 84 /** Indicates success/failure of the communication */ 85 int error;85 errno_t error; 86 86 } usb_transfer_batch_t; 87 87 -
uspace/lib/usbhost/include/usb/host/utils/malloc32.h
r132ab5d1 r5a6cc679 59 59 { 60 60 uintptr_t result; 61 int ret = as_get_physical_mapping(addr, &result);61 errno_t ret = as_get_physical_mapping(addr, &result); 62 62 63 63 if (ret != EOK) … … 78 78 size_t real_size = ALIGN_UP(size, PAGE_SIZE); 79 79 80 const int ret = dmamem_map_anonymous(real_size,80 const errno_t ret = dmamem_map_anonymous(real_size, 81 81 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 82 82 &address); -
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); -
uspace/lib/usbhost/src/hcd.c
r132ab5d1 r5a6cc679 107 107 * Worker for the HW interrupt replacement fibril. 108 108 */ 109 static int interrupt_polling(void *arg)109 static errno_t interrupt_polling(void *arg) 110 110 { 111 111 bus_t *bus = arg; … … 154 154 * @return Negative error code. 155 155 */ 156 static int hcd_ddf_setup_interrupts(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)156 static errno_t hcd_ddf_setup_interrupts(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 157 157 { 158 158 assert(hcd); … … 163 163 164 164 int irq; 165 int ret;165 errno_t ret; 166 166 ret = hc_driver->irq_code_gen(&irq_code, hcd, hw_res, &irq); 167 167 if (ret != EOK) { … … 205 205 * @return Error code 206 206 */ 207 int hc_dev_add(ddf_dev_t *device)208 { 209 int ret = EOK;207 errno_t hc_dev_add(ddf_dev_t *device) 208 { 209 errno_t ret = EOK; 210 210 assert(device); 211 211 … … 311 311 } 312 312 313 int hc_dev_remove(ddf_dev_t *dev)314 { 315 int err;313 errno_t hc_dev_remove(ddf_dev_t *dev) 314 { 315 errno_t err; 316 316 hc_device_t *hcd = dev_to_hcd(dev); 317 317 … … 333 333 } 334 334 335 int hc_dev_gone(ddf_dev_t *dev)336 { 337 int err = ENOTSUP;335 errno_t hc_dev_gone(ddf_dev_t *dev) 336 { 337 errno_t err = ENOTSUP; 338 338 hc_device_t *hcd = dev_to_hcd(dev); 339 339 … … 346 346 } 347 347 348 int hc_fun_online(ddf_fun_t *fun)348 errno_t hc_fun_online(ddf_fun_t *fun) 349 349 { 350 350 assert(fun);
Note:
See TracChangeset
for help on using the changeset viewer.