Changeset 5a6cc679 in mainline for uspace/drv/bus/usb/uhci/hc.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/drv/bus/usb/uhci/hc.c
r132ab5d1 r5a6cc679 97 97 98 98 static void hc_init_hw(const hc_t *instance); 99 static int hc_init_mem_structures(hc_t *instance);100 static int hc_init_transfer_lists(hc_t *instance);101 102 static int hc_debug_checker(void *arg);99 static errno_t hc_init_mem_structures(hc_t *instance); 100 static errno_t hc_init_transfer_lists(hc_t *instance); 101 102 static errno_t hc_debug_checker(void *arg); 103 103 104 104 … … 110 110 * @return Error code. 111 111 */ 112 int hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)112 errno_t hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq) 113 113 { 114 114 assert(code); … … 207 207 * interrupt fibrils. 208 208 */ 209 int hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)209 errno_t hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 210 210 { 211 211 hc_t *instance = hcd_to_hc(hcd); … … 218 218 219 219 /* allow access to hc control registers */ 220 int ret = pio_enable_range(&hw_res->io_ranges.ranges[0],220 errno_t ret = pio_enable_range(&hw_res->io_ranges.ranges[0], 221 221 (void **) &instance->registers); 222 222 if (ret != EOK) { … … 327 327 } 328 328 329 static int endpoint_register(endpoint_t *ep)329 static errno_t endpoint_register(endpoint_t *ep) 330 330 { 331 331 hc_t * const hc = bus_to_hc(endpoint_get_bus(ep)); 332 332 333 const int err = usb2_bus_endpoint_register(&hc->bus_helper, ep);333 const errno_t err = usb2_bus_endpoint_register(&hc->bus_helper, ep); 334 334 if (err) 335 335 return err; … … 449 449 * - frame list page (needs to be one UHCI hw accessible 4K page) 450 450 */ 451 int hc_init_mem_structures(hc_t *instance)451 errno_t hc_init_mem_structures(hc_t *instance) 452 452 { 453 453 assert(instance); … … 468 468 469 469 /* Init transfer lists */ 470 int ret = hc_init_transfer_lists(instance);470 errno_t ret = hc_init_transfer_lists(instance); 471 471 if (ret != EOK) { 472 472 usb_log_error("Failed to initialize transfer lists."); … … 498 498 * USB scheduling. Sets pointer table for quick access. 499 499 */ 500 int hc_init_transfer_lists(hc_t *instance)500 errno_t hc_init_transfer_lists(hc_t *instance) 501 501 { 502 502 assert(instance); 503 503 #define SETUP_TRANSFER_LIST(type, name) \ 504 504 do { \ 505 int ret = transfer_list_init(&instance->transfers_##type, name); \505 errno_t ret = transfer_list_init(&instance->transfers_##type, name); \ 506 506 if (ret != EOK) { \ 507 507 usb_log_error("Failed to setup %s transfer list: %s.", \ … … 550 550 } 551 551 552 static int hc_status(bus_t *bus, uint32_t *status)552 static errno_t hc_status(bus_t *bus, uint32_t *status) 553 553 { 554 554 hc_t *instance = bus_to_hc(bus); … … 571 571 * @return Error code 572 572 */ 573 static int hc_schedule(usb_transfer_batch_t *batch)573 static errno_t hc_schedule(usb_transfer_batch_t *batch) 574 574 { 575 575 uhci_transfer_batch_t *uhci_batch = uhci_transfer_batch_get(batch); … … 586 586 return ENOTSUP; 587 587 588 int err;588 errno_t err; 589 589 if ((err = uhci_transfer_batch_prepare(uhci_batch))) 590 590 return err; … … 598 598 * @return EOK (should never return) 599 599 */ 600 int hc_debug_checker(void *arg)600 errno_t hc_debug_checker(void *arg) 601 601 { 602 602 hc_t *instance = arg;
Note:
See TracChangeset
for help on using the changeset viewer.