Changeset 45457265 in mainline
- Timestamp:
- 2018-02-03T02:14:26Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eb862fd
- Parents:
- 961a5ee
- Location:
- uspace
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/bus.c
r961a5ee r45457265 68 68 * @return Error code. 69 69 */ 70 int xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc)70 errno_t xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc) 71 71 { 72 72 assert(bus); -
uspace/drv/bus/usb/xhci/bus.h
r961a5ee r45457265 52 52 } xhci_bus_t; 53 53 54 extern int xhci_bus_init(xhci_bus_t *, xhci_hc_t *);54 extern errno_t xhci_bus_init(xhci_bus_t *, xhci_hc_t *); 55 55 extern void xhci_bus_fini(xhci_bus_t *); 56 56 -
uspace/drv/bus/usb/xhci/commands.c
r961a5ee r45457265 72 72 * reset before starting. 73 73 */ 74 int xhci_init_commands(xhci_hc_t *hc)74 errno_t xhci_init_commands(xhci_hc_t *hc) 75 75 { 76 76 xhci_cmd_ring_t *cr = get_cmd_ring(hc); 77 int err;77 errno_t err; 78 78 79 79 if ((err = xhci_trb_ring_init(&cr->trb_ring, 0))) … … 172 172 } 173 173 174 static int wait_for_ring_open(xhci_cmd_ring_t *cr)174 static errno_t wait_for_ring_open(xhci_cmd_ring_t *cr) 175 175 { 176 176 assert(fibril_mutex_is_locked(&cr->guard)); … … 194 194 * Register the command as waiting for completion inside the command list. 195 195 */ 196 static inline int enqueue_command(xhci_hc_t *hc, xhci_cmd_t *cmd)196 static inline errno_t enqueue_command(xhci_hc_t *hc, xhci_cmd_t *cmd) 197 197 { 198 198 xhci_cmd_ring_t *cr = get_cmd_ring(hc); … … 210 210 list_append(&cmd->_header.link, &cr->cmd_list); 211 211 212 int err = EOK;212 errno_t err = EOK; 213 213 while (err == EOK) { 214 214 err = xhci_trb_ring_enqueue(&cr->trb_ring, … … 343 343 * @param trb The COMMAND_COMPLETION TRB found in event ring. 344 344 */ 345 int xhci_handle_command_completion(xhci_hc_t *hc, xhci_trb_t *trb)345 errno_t xhci_handle_command_completion(xhci_hc_t *hc, xhci_trb_t *trb) 346 346 { 347 347 xhci_cmd_ring_t *cr = get_cmd_ring(hc); … … 416 416 /* Command-issuing functions */ 417 417 418 static int no_op_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)418 static errno_t no_op_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 419 419 { 420 420 assert(hc); … … 427 427 } 428 428 429 static int enable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)429 static errno_t enable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 430 430 { 431 431 assert(hc); … … 440 440 } 441 441 442 static int disable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)442 static errno_t disable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 443 443 { 444 444 assert(hc); … … 453 453 } 454 454 455 static int address_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)455 static errno_t address_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 456 456 { 457 457 assert(hc); … … 483 483 } 484 484 485 static int configure_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)485 static errno_t configure_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 486 486 { 487 487 assert(hc); … … 504 504 } 505 505 506 static int evaluate_context_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)506 static errno_t evaluate_context_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 507 507 { 508 508 assert(hc); … … 526 526 } 527 527 528 static int reset_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)528 static errno_t reset_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 529 529 { 530 530 assert(hc); … … 541 541 } 542 542 543 static int stop_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)543 static errno_t stop_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 544 544 { 545 545 assert(hc); … … 556 556 } 557 557 558 static int set_tr_dequeue_pointer_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)558 static errno_t set_tr_dequeue_pointer_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 559 559 { 560 560 assert(hc); … … 572 572 } 573 573 574 static int reset_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)574 static errno_t reset_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 575 575 { 576 576 assert(hc); … … 585 585 } 586 586 587 static int get_port_bandwidth_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)587 static errno_t get_port_bandwidth_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd) 588 588 { 589 589 assert(hc); … … 603 603 /* The table of command-issuing functions. */ 604 604 605 typedef int (*cmd_handler) (xhci_hc_t *hc, xhci_cmd_t *cmd);605 typedef errno_t (*cmd_handler) (xhci_hc_t *hc, xhci_cmd_t *cmd); 606 606 607 607 static cmd_handler cmd_handlers [] = { … … 635 635 * COMMAND_ABORTED event. 636 636 */ 637 static int try_abort_current_command(xhci_hc_t *hc)637 static errno_t try_abort_current_command(xhci_hc_t *hc) 638 638 { 639 639 xhci_cmd_ring_t *cr = get_cmd_ring(hc); … … 694 694 * until COMMAND_COMPLETION event arrives. 695 695 */ 696 static int wait_for_cmd_completion(xhci_hc_t *hc, xhci_cmd_t *cmd)697 { 698 int rv = EOK;696 static errno_t wait_for_cmd_completion(xhci_hc_t *hc, xhci_cmd_t *cmd) 697 { 698 errno_t rv = EOK; 699 699 700 700 if (fibril_get_id() == hc->event_handler) { … … 731 731 * expires. Nothing is deallocated. Caller should always execute `xhci_cmd_fini`. 732 732 */ 733 int xhci_cmd_sync(xhci_hc_t *hc, xhci_cmd_t *cmd)734 { 735 assert(hc); 736 assert(cmd); 737 738 int err;733 errno_t xhci_cmd_sync(xhci_hc_t *hc, xhci_cmd_t *cmd) 734 { 735 assert(hc); 736 assert(cmd); 737 738 errno_t err; 739 739 740 740 if (!cmd_handlers[cmd->_header.cmd]) { … … 773 773 * is a useful shorthand for issuing commands without out parameters. 774 774 */ 775 int xhci_cmd_sync_fini(xhci_hc_t *hc, xhci_cmd_t *cmd)776 { 777 const int err = xhci_cmd_sync(hc, cmd);775 errno_t xhci_cmd_sync_fini(xhci_hc_t *hc, xhci_cmd_t *cmd) 776 { 777 const errno_t err = xhci_cmd_sync(hc, cmd); 778 778 xhci_cmd_fini(cmd); 779 779 … … 785 785 * fibril. The command is copied to stack memory and `fini` is called upon its completion. 786 786 */ 787 int xhci_cmd_async_fini(xhci_hc_t *hc, xhci_cmd_t *stack_cmd)787 errno_t xhci_cmd_async_fini(xhci_hc_t *hc, xhci_cmd_t *stack_cmd) 788 788 { 789 789 assert(hc); … … 801 801 802 802 /* Issue the command. */ 803 int err;803 errno_t err; 804 804 805 805 if (!cmd_handlers[heap_cmd->_header.cmd]) { -
uspace/drv/bus/usb/xhci/commands.h
r961a5ee r45457265 125 125 126 126 /* Command handling control */ 127 extern int xhci_init_commands(xhci_hc_t *);127 extern errno_t xhci_init_commands(xhci_hc_t *); 128 128 extern void xhci_fini_commands(xhci_hc_t *); 129 129 … … 133 133 extern void xhci_start_command_ring(xhci_hc_t *); 134 134 135 extern int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);135 extern errno_t xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *); 136 136 137 137 /* Command lifecycle */ … … 140 140 141 141 /* Issuing commands */ 142 extern int xhci_cmd_sync(xhci_hc_t *, xhci_cmd_t *);143 extern int xhci_cmd_sync_fini(xhci_hc_t *, xhci_cmd_t *);144 extern int xhci_cmd_async_fini(xhci_hc_t *, xhci_cmd_t *);142 extern errno_t xhci_cmd_sync(xhci_hc_t *, xhci_cmd_t *); 143 extern errno_t xhci_cmd_sync_fini(xhci_hc_t *, xhci_cmd_t *); 144 extern errno_t xhci_cmd_async_fini(xhci_hc_t *, xhci_cmd_t *); 145 145 146 static inline int xhci_cmd_sync_inline_wrapper(xhci_hc_t *hc, xhci_cmd_t cmd)146 static inline errno_t xhci_cmd_sync_inline_wrapper(xhci_hc_t *hc, xhci_cmd_t cmd) 147 147 { 148 148 /* Poor man's xhci_cmd_init (everything else is zeroed) */ … … 152 152 153 153 /* Issue the command */ 154 const int err = xhci_cmd_sync(hc, &cmd);154 const errno_t err = xhci_cmd_sync(hc, &cmd); 155 155 xhci_cmd_fini(&cmd); 156 156 … … 166 166 * 167 167 * Example: 168 * int err = xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = 42);168 * errno_t err = xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = 42); 169 169 */ 170 170 -
uspace/drv/bus/usb/xhci/device.c
r961a5ee r45457265 72 72 * @return Error code. 73 73 */ 74 static int address_device(xhci_device_t *dev)75 { 76 int err;74 static errno_t address_device(xhci_device_t *dev) 75 { 76 errno_t err; 77 77 78 78 /* Enable new slot. */ … … 115 115 * @return Error code. 116 116 */ 117 static int setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev)118 { 119 int err;117 static errno_t setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev) 118 { 119 errno_t err; 120 120 121 121 uint16_t max_packet_size; … … 144 144 * Just the TT will not work correctly. 145 145 */ 146 static int setup_hub(xhci_device_t *dev, usb_standard_device_descriptor_t *desc)146 static errno_t setup_hub(xhci_device_t *dev, usb_standard_device_descriptor_t *desc) 147 147 { 148 148 if (desc->device_class != USB_CLASS_HUB) … … 150 150 151 151 usb_hub_descriptor_header_t hub_desc = { 0 }; 152 const int err = hc_get_hub_desc(&dev->base, &hub_desc);152 const errno_t err = hc_get_hub_desc(&dev->base, &hub_desc); 153 153 if (err) 154 154 return err; … … 177 177 * @return Error code. 178 178 */ 179 int xhci_device_enumerate(device_t *dev)180 { 181 int err;179 errno_t xhci_device_enumerate(device_t *dev) 180 { 181 errno_t err; 182 182 xhci_bus_t *bus = bus_to_xhci_bus(dev->bus); 183 183 xhci_device_t *xhci_dev = xhci_device_get(dev); … … 258 258 void xhci_device_gone(device_t *dev) 259 259 { 260 int err;260 errno_t err; 261 261 xhci_bus_t *bus = bus_to_xhci_bus(dev->bus); 262 262 xhci_device_t *xhci_dev = xhci_device_get(dev); … … 277 277 * Bus callback. 278 278 */ 279 int xhci_device_online(device_t *dev_base)280 { 281 int err;279 errno_t xhci_device_online(device_t *dev_base) 280 { 281 errno_t err; 282 282 283 283 xhci_bus_t *bus = bus_to_xhci_bus(dev_base->bus); … … 305 305 void xhci_device_offline(device_t *dev_base) 306 306 { 307 int err;307 errno_t err; 308 308 309 309 xhci_bus_t *bus = bus_to_xhci_bus(dev_base->bus); -
uspace/drv/bus/usb/xhci/device.h
r961a5ee r45457265 65 65 66 66 /* Bus callbacks */ 67 int xhci_device_enumerate(device_t *);67 errno_t xhci_device_enumerate(device_t *); 68 68 void xhci_device_offline(device_t *); 69 int xhci_device_online(device_t *);69 errno_t xhci_device_online(device_t *); 70 70 void xhci_device_gone(device_t *); 71 71 -
uspace/drv/bus/usb/xhci/endpoint.c
r961a5ee r45457265 48 48 #include "streams.h" 49 49 50 static int alloc_transfer_ds(xhci_endpoint_t *);50 static errno_t alloc_transfer_ds(xhci_endpoint_t *); 51 51 52 52 /** … … 58 58 * @return Error code. 59 59 */ 60 static int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev,60 static errno_t xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, 61 61 const usb_endpoint_descriptors_t *desc) 62 62 { 63 int rc;63 errno_t rc; 64 64 assert(xhci_ep); 65 65 … … 180 180 * Bus callback. 181 181 */ 182 int xhci_endpoint_register(endpoint_t *ep_base)183 { 184 int err;182 errno_t xhci_endpoint_register(endpoint_t *ep_base) 183 { 184 errno_t err; 185 185 xhci_endpoint_t *ep = xhci_endpoint_get(ep_base); 186 186 … … 222 222 usb_transfer_batch_t * const batch = ep->active_batch; 223 223 224 const int err = hc_stop_endpoint(xhci_ep);224 const errno_t err = hc_stop_endpoint(xhci_ep); 225 225 if (err) { 226 226 usb_log_error("Failed to stop endpoint %u of device " … … 245 245 void xhci_endpoint_unregister(endpoint_t *ep_base) 246 246 { 247 int err;247 errno_t err; 248 248 xhci_endpoint_t *ep = xhci_endpoint_get(ep_base); 249 249 xhci_device_t *dev = xhci_device_get(ep_base->device); … … 300 300 * @return Error code. 301 301 */ 302 static int alloc_transfer_ds(xhci_endpoint_t *xhci_ep)302 static errno_t alloc_transfer_ds(xhci_endpoint_t *xhci_ep) 303 303 { 304 304 /* Can't use XHCI_EP_FMT because the endpoint may not have device. */ … … 309 309 xhci_ep->primary_stream_data_size = 0; 310 310 311 int err;311 errno_t err; 312 312 if ((err = xhci_trb_ring_init(&xhci_ep->ring, 0))) { 313 313 return err; … … 460 460 * offending transfer. 461 461 */ 462 int xhci_endpoint_clear_halt(xhci_endpoint_t *ep, uint32_t stream_id)463 { 464 int err;462 errno_t xhci_endpoint_clear_halt(xhci_endpoint_t *ep, uint32_t stream_id) 463 { 464 errno_t err; 465 465 466 466 if ((err = hc_reset_endpoint(ep))) -
uspace/drv/bus/usb/xhci/endpoint.h
r961a5ee r45457265 112 112 113 113 extern endpoint_t *xhci_endpoint_create(device_t *, const usb_endpoint_descriptors_t *); 114 extern int xhci_endpoint_register(endpoint_t *);114 extern errno_t xhci_endpoint_register(endpoint_t *); 115 115 extern void xhci_endpoint_unregister(endpoint_t *); 116 116 extern void xhci_endpoint_destroy(endpoint_t *); … … 120 120 121 121 extern void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *); 122 extern int xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned);122 extern errno_t xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned); 123 123 124 124 static inline xhci_endpoint_t * xhci_endpoint_get(endpoint_t *ep) -
uspace/drv/bus/usb/xhci/hc.c
r961a5ee r45457265 80 80 * ports to protocol versions and speeds. 81 81 */ 82 static int hc_parse_ec(xhci_hc_t *hc)82 static errno_t hc_parse_ec(xhci_hc_t *hc) 83 83 { 84 84 unsigned psic, major, minor; … … 186 186 * Initialize MMIO spaces of xHC. 187 187 */ 188 int hc_init_mmio(xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res)189 { 190 int err;188 errno_t hc_init_mmio(xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res) 189 { 190 errno_t err; 191 191 192 192 if (hw_res->mem_ranges.count != 1) { … … 257 257 * Initialize structures kept in allocated memory. 258 258 */ 259 int hc_init_memory(xhci_hc_t *hc, ddf_dev_t *device)260 { 261 int err = ENOMEM;259 errno_t hc_init_memory(xhci_hc_t *hc, ddf_dev_t *device) 260 { 261 errno_t err = ENOMEM; 262 262 263 263 if (dma_buffer_alloc(&hc->dcbaa_dma, (1 + hc->max_slots) * sizeof(uint64_t))) … … 362 362 * (except 0) are disabled. 363 363 */ 364 int hc_irq_code_gen(irq_code_t *code, xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res, int *irq)364 errno_t hc_irq_code_gen(irq_code_t *code, xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res, int *irq) 365 365 { 366 366 assert(code); … … 412 412 * Claim xHC from BIOS. Implements handoff as per Section 4.22.1 of xHCI spec. 413 413 */ 414 int hc_claim(xhci_hc_t *hc, ddf_dev_t *dev)414 errno_t hc_claim(xhci_hc_t *hc, ddf_dev_t *dev) 415 415 { 416 416 /* No legacy support capability, the controller is solely for us */ … … 440 440 * Ask the xHC to reset its state. Implements sequence 441 441 */ 442 static int hc_reset(xhci_hc_t *hc)442 static errno_t hc_reset(xhci_hc_t *hc) 443 443 { 444 444 if (xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_CNR), 0)) … … 466 466 * Initialize the HC: section 4.2 467 467 */ 468 int hc_start(xhci_hc_t *hc)469 { 470 int err;468 errno_t hc_start(xhci_hc_t *hc) 469 { 470 errno_t err; 471 471 472 472 if ((err = hc_reset(hc))) … … 565 565 * Used only when polling. Shall supplement the irq_commands. 566 566 */ 567 int hc_status(bus_t *bus, uint32_t *status)567 errno_t hc_status(bus_t *bus, uint32_t *status) 568 568 { 569 569 xhci_hc_t *hc = bus_to_hc(bus); … … 583 583 } 584 584 585 static int xhci_handle_mfindex_wrap_event(xhci_hc_t *hc, xhci_trb_t *trb)585 static errno_t xhci_handle_mfindex_wrap_event(xhci_hc_t *hc, xhci_trb_t *trb) 586 586 { 587 587 struct timeval tv; … … 594 594 } 595 595 596 typedef int (*event_handler) (xhci_hc_t *, xhci_trb_t *trb);596 typedef errno_t (*event_handler) (xhci_hc_t *, xhci_trb_t *trb); 597 597 598 598 /** … … 612 612 }; 613 613 614 static int hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb)614 static errno_t hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb) 615 615 { 616 616 const unsigned type = TRB_TYPE(*trb); … … 630 630 static int event_worker(void *arg) 631 631 { 632 int err;632 errno_t err; 633 633 xhci_trb_t trb; 634 634 xhci_hc_t * const hc = arg; … … 654 654 xhci_interrupter_regs_t *intr) 655 655 { 656 int err;656 errno_t err; 657 657 658 658 xhci_trb_t trb; … … 781 781 * DCBAA with the newly created slot. 782 782 */ 783 int hc_enable_slot(xhci_device_t *dev)784 { 785 int err;783 errno_t hc_enable_slot(xhci_device_t *dev) 784 { 785 errno_t err; 786 786 xhci_hc_t * const hc = bus_to_hc(dev->base.bus); 787 787 … … 815 815 * Frees the device context. 816 816 */ 817 int hc_disable_slot(xhci_device_t *dev)818 { 819 int err;817 errno_t hc_disable_slot(xhci_device_t *dev) 818 { 819 errno_t err; 820 820 xhci_hc_t * const hc = bus_to_hc(dev->base.bus); 821 821 … … 837 837 * Prepare an empty Endpoint Input Context inside a dma buffer. 838 838 */ 839 static int create_configure_ep_input_ctx(xhci_device_t *dev, dma_buffer_t *dma_buf)839 static errno_t create_configure_ep_input_ctx(xhci_device_t *dev, dma_buffer_t *dma_buf) 840 840 { 841 841 const xhci_hc_t * hc = bus_to_hc(dev->base.bus); 842 const int err = dma_buffer_alloc(dma_buf, XHCI_INPUT_CTX_SIZE(hc));842 const errno_t err = dma_buffer_alloc(dma_buf, XHCI_INPUT_CTX_SIZE(hc)); 843 843 if (err) 844 844 return err; … … 860 860 * @param dev Device to assing an address (unconfigured yet) 861 861 */ 862 int hc_address_device(xhci_device_t *dev)863 { 864 int err = ENOMEM;862 errno_t hc_address_device(xhci_device_t *dev) 863 { 864 errno_t err = ENOMEM; 865 865 xhci_hc_t * const hc = bus_to_hc(dev->base.bus); 866 866 xhci_endpoint_t *ep0 = xhci_endpoint_get(dev->base.endpoints[0]); … … 908 908 * @param slot_id Slot ID assigned to the device. 909 909 */ 910 int hc_configure_device(xhci_device_t *dev)910 errno_t hc_configure_device(xhci_device_t *dev) 911 911 { 912 912 xhci_hc_t * const hc = bus_to_hc(dev->base.bus); … … 914 914 /* Issue configure endpoint command (sec 4.3.5). */ 915 915 dma_buffer_t ictx_dma_buf; 916 const int err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);916 const errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf); 917 917 if (err) 918 918 return err; … … 929 929 * @param dev The owner of the device 930 930 */ 931 int hc_deconfigure_device(xhci_device_t *dev)931 errno_t hc_deconfigure_device(xhci_device_t *dev) 932 932 { 933 933 xhci_hc_t * const hc = bus_to_hc(dev->base.bus); … … 950 950 * @param ep_ctx Endpoint context of the endpoint 951 951 */ 952 int hc_add_endpoint(xhci_endpoint_t *ep)952 errno_t hc_add_endpoint(xhci_endpoint_t *ep) 953 953 { 954 954 xhci_device_t * const dev = xhci_ep_to_dev(ep); … … 957 957 /* Issue configure endpoint command (sec 4.3.5). */ 958 958 dma_buffer_t ictx_dma_buf; 959 const int err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);959 const errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf); 960 960 if (err) 961 961 return err; … … 981 981 * @param ep_idx Endpoint DCI in question 982 982 */ 983 int hc_drop_endpoint(xhci_endpoint_t *ep)983 errno_t hc_drop_endpoint(xhci_endpoint_t *ep) 984 984 { 985 985 xhci_device_t * const dev = xhci_ep_to_dev(ep); … … 992 992 /* Issue configure endpoint command (sec 4.3.5). */ 993 993 dma_buffer_t ictx_dma_buf; 994 const int err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);994 const errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf); 995 995 if (err) 996 996 return err; … … 1013 1013 * @param ep_ctx Endpoint context of the endpoint 1014 1014 */ 1015 int hc_update_endpoint(xhci_endpoint_t *ep)1015 errno_t hc_update_endpoint(xhci_endpoint_t *ep) 1016 1016 { 1017 1017 xhci_device_t * const dev = xhci_ep_to_dev(ep); … … 1021 1021 xhci_hc_t * const hc = bus_to_hc(dev->base.bus); 1022 1022 1023 const int err = dma_buffer_alloc(&ictx_dma_buf, XHCI_INPUT_CTX_SIZE(hc));1023 const errno_t err = dma_buffer_alloc(&ictx_dma_buf, XHCI_INPUT_CTX_SIZE(hc)); 1024 1024 if (err) 1025 1025 return err; … … 1044 1044 * @param ep_idx Endpoint DCI in question 1045 1045 */ 1046 int hc_stop_endpoint(xhci_endpoint_t *ep)1046 errno_t hc_stop_endpoint(xhci_endpoint_t *ep) 1047 1047 { 1048 1048 xhci_device_t * const dev = xhci_ep_to_dev(ep); … … 1065 1065 * @param ep_idx Endpoint DCI in question 1066 1066 */ 1067 int hc_reset_endpoint(xhci_endpoint_t *ep)1067 errno_t hc_reset_endpoint(xhci_endpoint_t *ep) 1068 1068 { 1069 1069 xhci_device_t * const dev = xhci_ep_to_dev(ep); … … 1081 1081 * @param dev The owner of the endpoint 1082 1082 */ 1083 int hc_reset_ring(xhci_endpoint_t *ep, uint32_t stream_id)1083 errno_t hc_reset_ring(xhci_endpoint_t *ep, uint32_t stream_id) 1084 1084 { 1085 1085 xhci_device_t * const dev = xhci_ep_to_dev(ep); -
uspace/drv/bus/usb/xhci/hc.h
r961a5ee r45457265 112 112 typedef struct xhci_device xhci_device_t; 113 113 114 extern int hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *);115 extern int hc_init_memory(xhci_hc_t *, ddf_dev_t *);116 extern int hc_claim(xhci_hc_t *, ddf_dev_t *);117 extern int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *, int *);118 extern int hc_start(xhci_hc_t *);114 extern errno_t hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *); 115 extern errno_t hc_init_memory(xhci_hc_t *, ddf_dev_t *); 116 extern errno_t hc_claim(xhci_hc_t *, ddf_dev_t *); 117 extern errno_t hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *, int *); 118 extern errno_t hc_start(xhci_hc_t *); 119 119 extern void hc_fini(xhci_hc_t *); 120 120 … … 123 123 extern unsigned hc_speed_to_psiv(usb_speed_t); 124 124 125 extern int hc_enable_slot(xhci_device_t *);126 extern int hc_disable_slot(xhci_device_t *);127 extern int hc_address_device(xhci_device_t *);128 extern int hc_configure_device(xhci_device_t *);129 extern int hc_deconfigure_device(xhci_device_t *);130 extern int hc_add_endpoint(xhci_endpoint_t *);131 extern int hc_drop_endpoint(xhci_endpoint_t *);132 extern int hc_update_endpoint(xhci_endpoint_t *);133 extern int hc_stop_endpoint(xhci_endpoint_t *);134 extern int hc_reset_endpoint(xhci_endpoint_t *);135 extern int hc_reset_ring(xhci_endpoint_t *, uint32_t);125 extern errno_t hc_enable_slot(xhci_device_t *); 126 extern errno_t hc_disable_slot(xhci_device_t *); 127 extern errno_t hc_address_device(xhci_device_t *); 128 extern errno_t hc_configure_device(xhci_device_t *); 129 extern errno_t hc_deconfigure_device(xhci_device_t *); 130 extern errno_t hc_add_endpoint(xhci_endpoint_t *); 131 extern errno_t hc_drop_endpoint(xhci_endpoint_t *); 132 extern errno_t hc_update_endpoint(xhci_endpoint_t *); 133 extern errno_t hc_stop_endpoint(xhci_endpoint_t *); 134 extern errno_t hc_reset_endpoint(xhci_endpoint_t *); 135 extern errno_t hc_reset_ring(xhci_endpoint_t *, uint32_t); 136 136 137 extern int hc_status(bus_t *, uint32_t *);137 extern errno_t hc_status(bus_t *, uint32_t *); 138 138 extern void hc_interrupt(bus_t *, uint32_t); 139 139 -
uspace/drv/bus/usb/xhci/isoch.c
r961a5ee r45457265 141 141 * Allocate isochronous buffers. Create the feeding timer. 142 142 */ 143 int isoch_alloc_transfers(xhci_endpoint_t *ep) {143 errno_t isoch_alloc_transfers(xhci_endpoint_t *ep) { 144 144 assert(ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS); 145 145 xhci_isoch_t * const isoch = ep->isoch; … … 171 171 } 172 172 173 static int schedule_isochronous_trb(xhci_endpoint_t *ep, xhci_isoch_transfer_t *it)173 static errno_t schedule_isochronous_trb(xhci_endpoint_t *ep, xhci_isoch_transfer_t *it) 174 174 { 175 175 xhci_trb_t trb; … … 193 193 TRB_ISOCH_SET_FRAMEID(trb, (it->mfindex / 8) % 2048); 194 194 195 const int err = xhci_trb_ring_enqueue(&ep->ring, &trb, &it->interrupt_trb_phys);195 const errno_t err = xhci_trb_ring_enqueue(&ep->ring, &trb, &it->interrupt_trb_phys); 196 196 return err; 197 197 } … … 472 472 * it to the xHC. 473 473 */ 474 int isoch_schedule_out(xhci_transfer_t *transfer)475 { 476 int err = EOK;474 errno_t isoch_schedule_out(xhci_transfer_t *transfer) 475 { 476 errno_t err = EOK; 477 477 478 478 xhci_endpoint_t *ep = xhci_endpoint_get(transfer->batch.ep); … … 540 540 * buffers, and fetch one filled buffer from the ring. 541 541 */ 542 int isoch_schedule_in(xhci_transfer_t *transfer)542 errno_t isoch_schedule_in(xhci_transfer_t *transfer) 543 543 { 544 544 xhci_endpoint_t *ep = xhci_endpoint_get(transfer->batch.ep); … … 595 595 fibril_mutex_lock(&ep->isoch->guard); 596 596 597 int err;597 errno_t err; 598 598 const xhci_trb_completion_code_t completion_code = TRB_COMPLETION_CODE(*trb); 599 599 -
uspace/drv/bus/usb/xhci/isoch.h
r961a5ee r45457265 68 68 69 69 /** Result of the transfer. Valid only if status == ISOCH_COMPLETE. */ 70 int error;70 errno_t error; 71 71 } xhci_isoch_transfer_t; 72 72 … … 119 119 extern void isoch_init(xhci_endpoint_t *, const usb_endpoint_descriptors_t *); 120 120 extern void isoch_fini(xhci_endpoint_t *); 121 extern int isoch_alloc_transfers(xhci_endpoint_t *);121 extern errno_t isoch_alloc_transfers(xhci_endpoint_t *); 122 122 123 extern int isoch_schedule_out(xhci_transfer_t *);124 extern int isoch_schedule_in(xhci_transfer_t *);123 extern errno_t isoch_schedule_out(xhci_transfer_t *); 124 extern errno_t isoch_schedule_in(xhci_transfer_t *); 125 125 extern void isoch_handle_transfer_event(xhci_hc_t *, xhci_endpoint_t *, xhci_trb_t *); 126 126 -
uspace/drv/bus/usb/xhci/main.c
r961a5ee r45457265 53 53 } 54 54 55 static int hcd_hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)55 static errno_t hcd_hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 56 56 { 57 int err;57 errno_t err; 58 58 xhci_hc_t *hc = hcd_to_hc(hcd); 59 59 hc_device_setup(hcd, (bus_t *) &hc->bus); … … 68 68 } 69 69 70 static int hcd_irq_code_gen(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)70 static errno_t hcd_irq_code_gen(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq) 71 71 { 72 72 xhci_hc_t *hc = hcd_to_hc(hcd); … … 74 74 } 75 75 76 static int hcd_claim(hc_device_t *hcd)76 static errno_t hcd_claim(hc_device_t *hcd) 77 77 { 78 78 xhci_hc_t *hc = hcd_to_hc(hcd); … … 80 80 } 81 81 82 static int hcd_start(hc_device_t *hcd)82 static errno_t hcd_start(hc_device_t *hcd) 83 83 { 84 84 xhci_hc_t *hc = hcd_to_hc(hcd); … … 86 86 } 87 87 88 static int hcd_hc_gone(hc_device_t *hcd)88 static errno_t hcd_hc_gone(hc_device_t *hcd) 89 89 { 90 90 xhci_hc_t *hc = hcd_to_hc(hcd); … … 112 112 * Driver debug level is set here. 113 113 */ 114 int main(int argc, char *argv[])114 errno_t main(int argc, char *argv[]) 115 115 { 116 116 log_init(NAME); -
uspace/drv/bus/usb/xhci/rh.c
r961a5ee r45457265 79 79 * Initialize the roothub subsystem. 80 80 */ 81 int xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc)81 errno_t xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc) 82 82 { 83 83 assert(rh); … … 90 90 return ENOMEM; 91 91 92 const int err = bus_device_init(&rh->device.base, &rh->hc->bus.base);92 const errno_t err = bus_device_init(&rh->device.base, &rh->hc->bus.base); 93 93 if (err) { 94 94 free(rh->ports); … … 119 119 * Finalize the RH subsystem. 120 120 */ 121 int xhci_rh_fini(xhci_rh_t *rh)121 errno_t xhci_rh_fini(xhci_rh_t *rh) 122 122 { 123 123 assert(rh); … … 139 139 * a virtual usbhub device for RH, this routine is called for devices directly. 140 140 */ 141 static int rh_enumerate_device(usb_port_t *usb_port)142 { 143 int err;141 static errno_t rh_enumerate_device(usb_port_t *usb_port) 142 { 143 errno_t err; 144 144 rh_port_t *port = get_rh_port(usb_port); 145 145 -
uspace/drv/bus/usb/xhci/rh.h
r961a5ee r45457265 81 81 } xhci_rh_t; 82 82 83 extern int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);84 extern int xhci_rh_fini(xhci_rh_t *);83 extern errno_t xhci_rh_init(xhci_rh_t *, xhci_hc_t *); 84 extern errno_t xhci_rh_fini(xhci_rh_t *); 85 85 86 86 extern void xhci_rh_set_ports_protocol(xhci_rh_t *, unsigned, unsigned, unsigned); -
uspace/drv/bus/usb/xhci/scratchpad.c
r961a5ee r45457265 57 57 * Allocate all scratchpad buffers, and configure the xHC. 58 58 */ 59 int xhci_scratchpad_alloc(xhci_hc_t *hc)59 errno_t xhci_scratchpad_alloc(xhci_hc_t *hc) 60 60 { 61 61 const unsigned num_bufs = xhci_scratchpad_count(hc); -
uspace/drv/bus/usb/xhci/scratchpad.h
r961a5ee r45457265 45 45 typedef struct xhci_hc xhci_hc_t; 46 46 47 extern int xhci_scratchpad_alloc(xhci_hc_t *);47 extern errno_t xhci_scratchpad_alloc(xhci_hc_t *); 48 48 extern void xhci_scratchpad_free(xhci_hc_t *); 49 49 -
uspace/drv/bus/usb/xhci/streams.c
r961a5ee r45457265 85 85 * @param[in] count Amount of primary streams. 86 86 */ 87 static int initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count)87 static errno_t initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count) 88 88 { 89 89 usb_log_debug("Allocating primary stream context array of size %u " … … 152 152 * @param[in] index index of the initialized stream structure. 153 153 */ 154 static int initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,155 154 static errno_t initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep, 155 unsigned index) 156 156 { 157 157 xhci_stream_ctx_t *ctx = &xhci_ep->primary_stream_ctx_array[index]; … … 159 159 memset(data, 0, sizeof(xhci_stream_data_t)); 160 160 161 int err = EOK;161 errno_t err = EOK; 162 162 163 163 /* Init and register TRB ring for the primary stream */ … … 178 178 * @param[in] xhci_ep XHCI bulk endpoint to use. 179 179 */ 180 static int initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep)181 { 182 int err = EOK;180 static errno_t initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep) 181 { 182 errno_t err = EOK; 183 183 size_t index; 184 184 for (index = 0; index < xhci_ep->primary_stream_data_size; ++index) { … … 205 205 * @param[in] count Number of secondary streams to initialize. 206 206 */ 207 static int initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,208 207 static errno_t initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep, 208 unsigned idx, unsigned count) 209 209 { 210 210 if (count == 0) { … … 243 243 244 244 /* Initialize all the rings. */ 245 int err = EOK;245 errno_t err = EOK; 246 246 size_t index; 247 247 for (index = 0; index < count; ++index) { … … 275 275 */ 276 276 static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx, 277 277 unsigned pstreams, unsigned lsa) 278 278 { 279 279 XHCI_EP_TYPE_SET(*ctx, xhci_endpoint_type(xhci_ep)); … … 294 294 * @param[in] count Amount of primary streams requested. 295 295 */ 296 static int verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev,296 static errno_t verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev, 297 297 xhci_endpoint_t *xhci_ep, unsigned count) 298 298 { … … 345 345 * @param[in] xhci_ep Associated XHCI bulk endpoint. 346 346 */ 347 int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,348 347 errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, 348 xhci_endpoint_t *xhci_ep) 349 349 { 350 350 if (!xhci_ep->primary_stream_data_size) { … … 357 357 358 358 /* Streams are now removed, proceed with reconfiguring endpoint. */ 359 int err;359 errno_t err; 360 360 if ((err = xhci_trb_ring_init(&xhci_ep->ring, 0))) { 361 361 usb_log_error("Failed to initialize a transfer ring."); … … 373 373 * @param[in] count Amount of primary streams requested. 374 374 */ 375 int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,375 errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev, 376 376 xhci_endpoint_t *xhci_ep, unsigned count) 377 377 { 378 int err = verify_stream_conditions(hc, dev, xhci_ep, count);378 errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count); 379 379 if (err) { 380 380 return err; … … 421 421 * @param[in] count Amount of primary streams requested. 422 422 */ 423 int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,423 errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev, 424 424 xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count) 425 425 { … … 430 430 } 431 431 432 int err = verify_stream_conditions(hc, dev, xhci_ep, count);432 errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count); 433 433 if (err) { 434 434 return err; -
uspace/drv/bus/usb/xhci/streams.h
r961a5ee r45457265 64 64 extern void xhci_stream_free_ds(xhci_endpoint_t *xhci_ep); 65 65 66 extern int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep);67 extern int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,66 extern errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep); 67 extern errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev, 68 68 xhci_endpoint_t *xhci_ep, unsigned count); 69 extern int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,69 extern errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev, 70 70 xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count); 71 71 -
uspace/drv/bus/usb/xhci/transfers.c
r961a5ee r45457265 150 150 } 151 151 152 static int schedule_control(xhci_hc_t* hc, xhci_transfer_t* transfer)152 static errno_t schedule_control(xhci_hc_t* hc, xhci_transfer_t* transfer) 153 153 { 154 154 usb_transfer_batch_t *batch = &transfer->batch; … … 213 213 // Issue a Configure Endpoint command, if needed. 214 214 if (configure_endpoint_needed(setup)) { 215 const int err = hc_configure_device(xhci_ep_to_dev(xhci_ep));215 const errno_t err = hc_configure_device(xhci_ep_to_dev(xhci_ep)); 216 216 if (err) 217 217 return err; … … 222 222 } 223 223 224 static int schedule_bulk(xhci_hc_t* hc, xhci_transfer_t *transfer)224 static errno_t schedule_bulk(xhci_hc_t* hc, xhci_transfer_t *transfer) 225 225 { 226 226 /* The stream-enabled endpoints need to chain ED trb */ … … 276 276 } 277 277 278 static int schedule_interrupt(xhci_hc_t* hc, xhci_transfer_t* transfer)278 static errno_t schedule_interrupt(xhci_hc_t* hc, xhci_transfer_t* transfer) 279 279 { 280 280 const size_t buffer_count = calculate_trb_count(transfer); … … 309 309 } 310 310 311 int xhci_handle_transfer_event(xhci_hc_t* hc, xhci_trb_t* trb)311 errno_t xhci_handle_transfer_event(xhci_hc_t* hc, xhci_trb_t* trb) 312 312 { 313 313 uintptr_t addr = trb->parameter; … … 430 430 } 431 431 432 typedef int (*transfer_handler)(xhci_hc_t *, xhci_transfer_t *);432 typedef errno_t (*transfer_handler)(xhci_hc_t *, xhci_transfer_t *); 433 433 434 434 static const transfer_handler transfer_handlers[] = { … … 444 444 * Bus callback. 445 445 */ 446 int xhci_transfer_schedule(usb_transfer_batch_t *batch)446 errno_t xhci_transfer_schedule(usb_transfer_batch_t *batch) 447 447 { 448 448 endpoint_t *ep = batch->ep; … … 504 504 * possible that we have to clear all of them. 505 505 */ 506 const int err = xhci_endpoint_clear_halt(xhci_endpoint_get(halted_ep), 0);506 const errno_t err = xhci_endpoint_clear_halt(xhci_endpoint_get(halted_ep), 0); 507 507 endpoint_del_ref(halted_ep); 508 508 if (err) { … … 526 526 527 527 528 int err;528 errno_t err; 529 529 fibril_mutex_lock(&xhci_ep->guard); 530 530 -
uspace/drv/bus/usb/xhci/transfers.h
r961a5ee r45457265 56 56 57 57 extern usb_transfer_batch_t* xhci_transfer_create(endpoint_t *); 58 extern int xhci_transfer_schedule(usb_transfer_batch_t *);58 extern errno_t xhci_transfer_schedule(usb_transfer_batch_t *); 59 59 60 extern int xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *);60 extern errno_t xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *); 61 61 extern void xhci_transfer_destroy(usb_transfer_batch_t *); 62 62 -
uspace/drv/bus/usb/xhci/trb_ring.c
r961a5ee r45457265 87 87 * to DMAMEM_4GiB. 88 88 */ 89 static int trb_segment_alloc(trb_segment_t **segment)89 static errno_t trb_segment_alloc(trb_segment_t **segment) 90 90 { 91 91 dma_buffer_t dbuf; 92 92 93 const int err = dma_buffer_alloc(&dbuf, PAGE_SIZE);93 const errno_t err = dma_buffer_alloc(&dbuf, PAGE_SIZE); 94 94 if (err) 95 95 return err; … … 114 114 * choice on a reasonable default (one page-sized segment). 115 115 */ 116 int xhci_trb_ring_init(xhci_trb_ring_t *ring, size_t initial_size)117 { 118 int err;116 errno_t xhci_trb_ring_init(xhci_trb_ring_t *ring, size_t initial_size) 117 { 118 errno_t err; 119 119 if (initial_size == 0) 120 120 initial_size = SEGMENT_TRB_USEFUL_COUNT; … … 218 218 * EAGAIN when the ring is too full to fit all TRBs (temporary) 219 219 */ 220 int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *ring, xhci_trb_t *first_trb,220 errno_t xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *ring, xhci_trb_t *first_trb, 221 221 size_t trbs, uintptr_t *phys) 222 222 { 223 int err;223 errno_t err; 224 224 assert(trbs > 0); 225 225 fibril_mutex_lock(&ring->guard); … … 294 294 * Enqueue TD composed of a single TRB. See: `xhci_trb_ring_enqueue_multiple` 295 295 */ 296 int xhci_trb_ring_enqueue(xhci_trb_ring_t *ring, xhci_trb_t *td, uintptr_t *phys)296 errno_t xhci_trb_ring_enqueue(xhci_trb_ring_t *ring, xhci_trb_t *td, uintptr_t *phys) 297 297 { 298 298 return xhci_trb_ring_enqueue_multiple(ring, td, 1, phys); … … 315 315 * choice on a reasonable default (one page-sized segment). 316 316 */ 317 int xhci_event_ring_init(xhci_event_ring_t *ring, size_t initial_size)318 { 319 int err;317 errno_t xhci_event_ring_init(xhci_event_ring_t *ring, size_t initial_size) 318 { 319 errno_t err; 320 320 if (initial_size == 0) 321 321 initial_size = SEGMENT_TRB_COUNT; … … 390 390 * ENOENT when the ring is empty 391 391 */ 392 int xhci_event_ring_dequeue(xhci_event_ring_t *ring, xhci_trb_t *event)392 errno_t xhci_event_ring_dequeue(xhci_event_ring_t *ring, xhci_trb_t *event) 393 393 { 394 394 fibril_mutex_lock(&ring->guard); … … 445 445 } 446 446 447 int xhci_sw_ring_enqueue(xhci_sw_ring_t *ring, xhci_trb_t *trb)447 errno_t xhci_sw_ring_enqueue(xhci_sw_ring_t *ring, xhci_trb_t *trb) 448 448 { 449 449 assert(ring); … … 464 464 } 465 465 466 int xhci_sw_ring_dequeue(xhci_sw_ring_t *ring, xhci_trb_t *trb)466 errno_t xhci_sw_ring_dequeue(xhci_sw_ring_t *ring, xhci_trb_t *trb) 467 467 { 468 468 assert(ring); -
uspace/drv/bus/usb/xhci/trb_ring.h
r961a5ee r45457265 74 74 } xhci_trb_ring_t; 75 75 76 extern int xhci_trb_ring_init(xhci_trb_ring_t *, size_t);76 extern errno_t xhci_trb_ring_init(xhci_trb_ring_t *, size_t); 77 77 extern void xhci_trb_ring_fini(xhci_trb_ring_t *); 78 extern int xhci_trb_ring_enqueue(xhci_trb_ring_t *, xhci_trb_t *, uintptr_t *);79 extern int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *);78 extern errno_t xhci_trb_ring_enqueue(xhci_trb_ring_t *, xhci_trb_t *, uintptr_t *); 79 extern errno_t xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *); 80 80 81 81 extern void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr); … … 107 107 } xhci_event_ring_t; 108 108 109 extern int xhci_event_ring_init(xhci_event_ring_t *, size_t);109 extern errno_t xhci_event_ring_init(xhci_event_ring_t *, size_t); 110 110 extern void xhci_event_ring_fini(xhci_event_ring_t *); 111 111 extern void xhci_event_ring_reset(xhci_event_ring_t *); 112 extern int xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *);112 extern errno_t xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *); 113 113 114 114 /** … … 128 128 129 129 /* Both may block if the ring is full/empty. */ 130 extern int xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *);131 extern int xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *);130 extern errno_t xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *); 131 extern errno_t xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *); 132 132 133 133 extern void xhci_sw_ring_restart(xhci_sw_ring_t *); -
uspace/lib/drv/generic/driver.c
r961a5ee r45457265 971 971 } 972 972 973 int ddf_driver_main(const driver_t *drv)973 errno_t ddf_driver_main(const driver_t *drv) 974 974 { 975 975 /*
Note:
See TracChangeset
for help on using the changeset viewer.