Changeset 45457265 in mainline


Ignore:
Timestamp:
2018-02-03T02:14:26Z (6 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eb862fd
Parents:
961a5ee
Message:

errno_t all the things!

Location:
uspace
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/bus.c

    r961a5ee r45457265  
    6868 * @return Error code.
    6969 */
    70 int xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc)
     70errno_t xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc)
    7171{
    7272        assert(bus);
  • uspace/drv/bus/usb/xhci/bus.h

    r961a5ee r45457265  
    5252} xhci_bus_t;
    5353
    54 extern int xhci_bus_init(xhci_bus_t *, xhci_hc_t *);
     54extern errno_t xhci_bus_init(xhci_bus_t *, xhci_hc_t *);
    5555extern void xhci_bus_fini(xhci_bus_t *);
    5656
  • uspace/drv/bus/usb/xhci/commands.c

    r961a5ee r45457265  
    7272 * reset before starting.
    7373 */
    74 int xhci_init_commands(xhci_hc_t *hc)
     74errno_t xhci_init_commands(xhci_hc_t *hc)
    7575{
    7676        xhci_cmd_ring_t *cr = get_cmd_ring(hc);
    77         int err;
     77        errno_t err;
    7878
    7979        if ((err = xhci_trb_ring_init(&cr->trb_ring, 0)))
     
    172172}
    173173
    174 static int wait_for_ring_open(xhci_cmd_ring_t *cr)
     174static errno_t wait_for_ring_open(xhci_cmd_ring_t *cr)
    175175{
    176176        assert(fibril_mutex_is_locked(&cr->guard));
     
    194194 * Register the command as waiting for completion inside the command list.
    195195 */
    196 static inline int enqueue_command(xhci_hc_t *hc, xhci_cmd_t *cmd)
     196static inline errno_t enqueue_command(xhci_hc_t *hc, xhci_cmd_t *cmd)
    197197{
    198198        xhci_cmd_ring_t *cr = get_cmd_ring(hc);
     
    210210        list_append(&cmd->_header.link, &cr->cmd_list);
    211211
    212         int err = EOK;
     212        errno_t err = EOK;
    213213        while (err == EOK) {
    214214                err = xhci_trb_ring_enqueue(&cr->trb_ring,
     
    343343 * @param trb The COMMAND_COMPLETION TRB found in event ring.
    344344 */
    345 int xhci_handle_command_completion(xhci_hc_t *hc, xhci_trb_t *trb)
     345errno_t xhci_handle_command_completion(xhci_hc_t *hc, xhci_trb_t *trb)
    346346{
    347347        xhci_cmd_ring_t *cr = get_cmd_ring(hc);
     
    416416/* Command-issuing functions */
    417417
    418 static int no_op_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     418static errno_t no_op_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    419419{
    420420        assert(hc);
     
    427427}
    428428
    429 static int enable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     429static errno_t enable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    430430{
    431431        assert(hc);
     
    440440}
    441441
    442 static int disable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     442static errno_t disable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    443443{
    444444        assert(hc);
     
    453453}
    454454
    455 static int address_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     455static errno_t address_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    456456{
    457457        assert(hc);
     
    483483}
    484484
    485 static int configure_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     485static errno_t configure_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    486486{
    487487        assert(hc);
     
    504504}
    505505
    506 static int evaluate_context_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     506static errno_t evaluate_context_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    507507{
    508508        assert(hc);
     
    526526}
    527527
    528 static int reset_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     528static errno_t reset_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    529529{
    530530        assert(hc);
     
    541541}
    542542
    543 static int stop_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     543static errno_t stop_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    544544{
    545545        assert(hc);
     
    556556}
    557557
    558 static int set_tr_dequeue_pointer_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     558static errno_t set_tr_dequeue_pointer_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    559559{
    560560        assert(hc);
     
    572572}
    573573
    574 static int reset_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     574static errno_t reset_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    575575{
    576576        assert(hc);
     
    585585}
    586586
    587 static int get_port_bandwidth_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     587static errno_t get_port_bandwidth_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    588588{
    589589        assert(hc);
     
    603603/* The table of command-issuing functions. */
    604604
    605 typedef int (*cmd_handler) (xhci_hc_t *hc, xhci_cmd_t *cmd);
     605typedef errno_t (*cmd_handler) (xhci_hc_t *hc, xhci_cmd_t *cmd);
    606606
    607607static cmd_handler cmd_handlers [] = {
     
    635635 * COMMAND_ABORTED event.
    636636 */
    637 static int try_abort_current_command(xhci_hc_t *hc)
     637static errno_t try_abort_current_command(xhci_hc_t *hc)
    638638{
    639639        xhci_cmd_ring_t *cr = get_cmd_ring(hc);
     
    694694 * until COMMAND_COMPLETION event arrives.
    695695 */
    696 static int wait_for_cmd_completion(xhci_hc_t *hc, xhci_cmd_t *cmd)
    697 {
    698         int rv = EOK;
     696static errno_t wait_for_cmd_completion(xhci_hc_t *hc, xhci_cmd_t *cmd)
     697{
     698        errno_t rv = EOK;
    699699
    700700        if (fibril_get_id() == hc->event_handler) {
     
    731731 * expires. Nothing is deallocated. Caller should always execute `xhci_cmd_fini`.
    732732 */
    733 int xhci_cmd_sync(xhci_hc_t *hc, xhci_cmd_t *cmd)
    734 {
    735         assert(hc);
    736         assert(cmd);
    737 
    738         int err;
     733errno_t xhci_cmd_sync(xhci_hc_t *hc, xhci_cmd_t *cmd)
     734{
     735        assert(hc);
     736        assert(cmd);
     737
     738        errno_t err;
    739739
    740740        if (!cmd_handlers[cmd->_header.cmd]) {
     
    773773 * is a useful shorthand for issuing commands without out parameters.
    774774 */
    775 int xhci_cmd_sync_fini(xhci_hc_t *hc, xhci_cmd_t *cmd)
    776 {
    777         const int err = xhci_cmd_sync(hc, cmd);
     775errno_t xhci_cmd_sync_fini(xhci_hc_t *hc, xhci_cmd_t *cmd)
     776{
     777        const errno_t err = xhci_cmd_sync(hc, cmd);
    778778        xhci_cmd_fini(cmd);
    779779
     
    785785 * fibril. The command is copied to stack memory and `fini` is called upon its completion.
    786786 */
    787 int xhci_cmd_async_fini(xhci_hc_t *hc, xhci_cmd_t *stack_cmd)
     787errno_t xhci_cmd_async_fini(xhci_hc_t *hc, xhci_cmd_t *stack_cmd)
    788788{
    789789        assert(hc);
     
    801801
    802802        /* Issue the command. */
    803         int err;
     803        errno_t err;
    804804
    805805        if (!cmd_handlers[heap_cmd->_header.cmd]) {
  • uspace/drv/bus/usb/xhci/commands.h

    r961a5ee r45457265  
    125125
    126126/* Command handling control */
    127 extern int xhci_init_commands(xhci_hc_t *);
     127extern errno_t xhci_init_commands(xhci_hc_t *);
    128128extern void xhci_fini_commands(xhci_hc_t *);
    129129
     
    133133extern void xhci_start_command_ring(xhci_hc_t *);
    134134
    135 extern int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);
     135extern errno_t xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);
    136136
    137137/* Command lifecycle */
     
    140140
    141141/* 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 *);
     142extern errno_t xhci_cmd_sync(xhci_hc_t *, xhci_cmd_t *);
     143extern errno_t xhci_cmd_sync_fini(xhci_hc_t *, xhci_cmd_t *);
     144extern errno_t xhci_cmd_async_fini(xhci_hc_t *, xhci_cmd_t *);
    145145
    146 static inline int xhci_cmd_sync_inline_wrapper(xhci_hc_t *hc, xhci_cmd_t cmd)
     146static inline errno_t xhci_cmd_sync_inline_wrapper(xhci_hc_t *hc, xhci_cmd_t cmd)
    147147{
    148148        /* Poor man's xhci_cmd_init (everything else is zeroed) */
     
    152152
    153153        /* Issue the command */
    154         const int err = xhci_cmd_sync(hc, &cmd);
     154        const errno_t err = xhci_cmd_sync(hc, &cmd);
    155155        xhci_cmd_fini(&cmd);
    156156
     
    166166 *
    167167 *  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);
    169169 */
    170170
  • uspace/drv/bus/usb/xhci/device.c

    r961a5ee r45457265  
    7272 * @return Error code.
    7373 */
    74 static int address_device(xhci_device_t *dev)
    75 {
    76         int err;
     74static errno_t address_device(xhci_device_t *dev)
     75{
     76        errno_t err;
    7777
    7878        /* Enable new slot. */
     
    115115 * @return Error code.
    116116 */
    117 static int setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev)
    118 {
    119         int err;
     117static errno_t setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev)
     118{
     119        errno_t err;
    120120
    121121        uint16_t max_packet_size;
     
    144144 * Just the TT will not work correctly.
    145145 */
    146 static int setup_hub(xhci_device_t *dev, usb_standard_device_descriptor_t *desc)
     146static errno_t setup_hub(xhci_device_t *dev, usb_standard_device_descriptor_t *desc)
    147147{
    148148        if (desc->device_class != USB_CLASS_HUB)
     
    150150
    151151        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);
    153153        if (err)
    154154                return err;
     
    177177 * @return Error code.
    178178 */
    179 int xhci_device_enumerate(device_t *dev)
    180 {
    181         int err;
     179errno_t xhci_device_enumerate(device_t *dev)
     180{
     181        errno_t err;
    182182        xhci_bus_t *bus = bus_to_xhci_bus(dev->bus);
    183183        xhci_device_t *xhci_dev = xhci_device_get(dev);
     
    258258void xhci_device_gone(device_t *dev)
    259259{
    260         int err;
     260        errno_t err;
    261261        xhci_bus_t *bus = bus_to_xhci_bus(dev->bus);
    262262        xhci_device_t *xhci_dev = xhci_device_get(dev);
     
    277277 * Bus callback.
    278278 */
    279 int xhci_device_online(device_t *dev_base)
    280 {
    281         int err;
     279errno_t xhci_device_online(device_t *dev_base)
     280{
     281        errno_t err;
    282282
    283283        xhci_bus_t *bus = bus_to_xhci_bus(dev_base->bus);
     
    305305void xhci_device_offline(device_t *dev_base)
    306306{
    307         int err;
     307        errno_t err;
    308308
    309309        xhci_bus_t *bus = bus_to_xhci_bus(dev_base->bus);
  • uspace/drv/bus/usb/xhci/device.h

    r961a5ee r45457265  
    6565
    6666/* Bus callbacks */
    67 int xhci_device_enumerate(device_t *);
     67errno_t xhci_device_enumerate(device_t *);
    6868void xhci_device_offline(device_t *);
    69 int xhci_device_online(device_t *);
     69errno_t xhci_device_online(device_t *);
    7070void xhci_device_gone(device_t *);
    7171
  • uspace/drv/bus/usb/xhci/endpoint.c

    r961a5ee r45457265  
    4848#include "streams.h"
    4949
    50 static int alloc_transfer_ds(xhci_endpoint_t *);
     50static errno_t alloc_transfer_ds(xhci_endpoint_t *);
    5151
    5252/**
     
    5858 * @return Error code.
    5959 */
    60 static int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev,
     60static errno_t xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev,
    6161    const usb_endpoint_descriptors_t *desc)
    6262{
    63         int rc;
     63        errno_t rc;
    6464        assert(xhci_ep);
    6565
     
    180180 * Bus callback.
    181181 */
    182 int xhci_endpoint_register(endpoint_t *ep_base)
    183 {
    184         int err;
     182errno_t xhci_endpoint_register(endpoint_t *ep_base)
     183{
     184        errno_t err;
    185185        xhci_endpoint_t *ep = xhci_endpoint_get(ep_base);
    186186
     
    222222        usb_transfer_batch_t * const batch = ep->active_batch;
    223223
    224         const int err = hc_stop_endpoint(xhci_ep);
     224        const errno_t err = hc_stop_endpoint(xhci_ep);
    225225        if (err) {
    226226                usb_log_error("Failed to stop endpoint %u of device "
     
    245245void xhci_endpoint_unregister(endpoint_t *ep_base)
    246246{
    247         int err;
     247        errno_t err;
    248248        xhci_endpoint_t *ep = xhci_endpoint_get(ep_base);
    249249        xhci_device_t *dev = xhci_device_get(ep_base->device);
     
    300300 * @return Error code.
    301301 */
    302 static int alloc_transfer_ds(xhci_endpoint_t *xhci_ep)
     302static errno_t alloc_transfer_ds(xhci_endpoint_t *xhci_ep)
    303303{
    304304        /* Can't use XHCI_EP_FMT because the endpoint may not have device. */
     
    309309        xhci_ep->primary_stream_data_size = 0;
    310310
    311         int err;
     311        errno_t err;
    312312        if ((err = xhci_trb_ring_init(&xhci_ep->ring, 0))) {
    313313                return err;
     
    460460 * offending transfer.
    461461 */
    462 int xhci_endpoint_clear_halt(xhci_endpoint_t *ep, uint32_t stream_id)
    463 {
    464         int err;
     462errno_t xhci_endpoint_clear_halt(xhci_endpoint_t *ep, uint32_t stream_id)
     463{
     464        errno_t err;
    465465
    466466        if ((err = hc_reset_endpoint(ep)))
  • uspace/drv/bus/usb/xhci/endpoint.h

    r961a5ee r45457265  
    112112
    113113extern endpoint_t *xhci_endpoint_create(device_t *, const usb_endpoint_descriptors_t *);
    114 extern int xhci_endpoint_register(endpoint_t *);
     114extern errno_t xhci_endpoint_register(endpoint_t *);
    115115extern void xhci_endpoint_unregister(endpoint_t *);
    116116extern void xhci_endpoint_destroy(endpoint_t *);
     
    120120
    121121extern void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *);
    122 extern int xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned);
     122extern errno_t xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned);
    123123
    124124static inline xhci_endpoint_t * xhci_endpoint_get(endpoint_t *ep)
  • uspace/drv/bus/usb/xhci/hc.c

    r961a5ee r45457265  
    8080 * ports to protocol versions and speeds.
    8181 */
    82 static int hc_parse_ec(xhci_hc_t *hc)
     82static errno_t hc_parse_ec(xhci_hc_t *hc)
    8383{
    8484        unsigned psic, major, minor;
     
    186186 * Initialize MMIO spaces of xHC.
    187187 */
    188 int hc_init_mmio(xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res)
    189 {
    190         int err;
     188errno_t hc_init_mmio(xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res)
     189{
     190        errno_t err;
    191191
    192192        if (hw_res->mem_ranges.count != 1) {
     
    257257 * Initialize structures kept in allocated memory.
    258258 */
    259 int hc_init_memory(xhci_hc_t *hc, ddf_dev_t *device)
    260 {
    261         int err = ENOMEM;
     259errno_t hc_init_memory(xhci_hc_t *hc, ddf_dev_t *device)
     260{
     261        errno_t err = ENOMEM;
    262262
    263263        if (dma_buffer_alloc(&hc->dcbaa_dma, (1 + hc->max_slots) * sizeof(uint64_t)))
     
    362362 * (except 0) are disabled.
    363363 */
    364 int hc_irq_code_gen(irq_code_t *code, xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res, int *irq)
     364errno_t hc_irq_code_gen(irq_code_t *code, xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res, int *irq)
    365365{
    366366        assert(code);
     
    412412 * Claim xHC from BIOS. Implements handoff as per Section 4.22.1 of xHCI spec.
    413413 */
    414 int hc_claim(xhci_hc_t *hc, ddf_dev_t *dev)
     414errno_t hc_claim(xhci_hc_t *hc, ddf_dev_t *dev)
    415415{
    416416        /* No legacy support capability, the controller is solely for us */
     
    440440 * Ask the xHC to reset its state. Implements sequence
    441441 */
    442 static int hc_reset(xhci_hc_t *hc)
     442static errno_t hc_reset(xhci_hc_t *hc)
    443443{
    444444        if (xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_CNR), 0))
     
    466466 * Initialize the HC: section 4.2
    467467 */
    468 int hc_start(xhci_hc_t *hc)
    469 {
    470         int err;
     468errno_t hc_start(xhci_hc_t *hc)
     469{
     470        errno_t err;
    471471
    472472        if ((err = hc_reset(hc)))
     
    565565 * Used only when polling. Shall supplement the irq_commands.
    566566 */
    567 int hc_status(bus_t *bus, uint32_t *status)
     567errno_t hc_status(bus_t *bus, uint32_t *status)
    568568{
    569569        xhci_hc_t *hc = bus_to_hc(bus);
     
    583583}
    584584
    585 static int xhci_handle_mfindex_wrap_event(xhci_hc_t *hc, xhci_trb_t *trb)
     585static errno_t xhci_handle_mfindex_wrap_event(xhci_hc_t *hc, xhci_trb_t *trb)
    586586{
    587587        struct timeval tv;
     
    594594}
    595595
    596 typedef int (*event_handler) (xhci_hc_t *, xhci_trb_t *trb);
     596typedef errno_t (*event_handler) (xhci_hc_t *, xhci_trb_t *trb);
    597597
    598598/**
     
    612612};
    613613
    614 static int hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb)
     614static errno_t hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb)
    615615{
    616616        const unsigned type = TRB_TYPE(*trb);
     
    630630static int event_worker(void *arg)
    631631{
    632         int err;
     632        errno_t err;
    633633        xhci_trb_t trb;
    634634        xhci_hc_t * const hc = arg;
     
    654654    xhci_interrupter_regs_t *intr)
    655655{
    656         int err;
     656        errno_t err;
    657657
    658658        xhci_trb_t trb;
     
    781781 * DCBAA with the newly created slot.
    782782 */
    783 int hc_enable_slot(xhci_device_t *dev)
    784 {
    785         int err;
     783errno_t hc_enable_slot(xhci_device_t *dev)
     784{
     785        errno_t err;
    786786        xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
    787787
     
    815815 * Frees the device context.
    816816 */
    817 int hc_disable_slot(xhci_device_t *dev)
    818 {
    819         int err;
     817errno_t hc_disable_slot(xhci_device_t *dev)
     818{
     819        errno_t err;
    820820        xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
    821821
     
    837837 * Prepare an empty Endpoint Input Context inside a dma buffer.
    838838 */
    839 static int create_configure_ep_input_ctx(xhci_device_t *dev, dma_buffer_t *dma_buf)
     839static errno_t create_configure_ep_input_ctx(xhci_device_t *dev, dma_buffer_t *dma_buf)
    840840{
    841841        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));
    843843        if (err)
    844844                return err;
     
    860860 * @param dev Device to assing an address (unconfigured yet)
    861861 */
    862 int hc_address_device(xhci_device_t *dev)
    863 {
    864         int err = ENOMEM;
     862errno_t hc_address_device(xhci_device_t *dev)
     863{
     864        errno_t err = ENOMEM;
    865865        xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
    866866        xhci_endpoint_t *ep0 = xhci_endpoint_get(dev->base.endpoints[0]);
     
    908908 * @param slot_id Slot ID assigned to the device.
    909909 */
    910 int hc_configure_device(xhci_device_t *dev)
     910errno_t hc_configure_device(xhci_device_t *dev)
    911911{
    912912        xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
     
    914914        /* Issue configure endpoint command (sec 4.3.5). */
    915915        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);
    917917        if (err)
    918918                return err;
     
    929929 * @param dev The owner of the device
    930930 */
    931 int hc_deconfigure_device(xhci_device_t *dev)
     931errno_t hc_deconfigure_device(xhci_device_t *dev)
    932932{
    933933        xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
     
    950950 * @param ep_ctx Endpoint context of the endpoint
    951951 */
    952 int hc_add_endpoint(xhci_endpoint_t *ep)
     952errno_t hc_add_endpoint(xhci_endpoint_t *ep)
    953953{
    954954        xhci_device_t * const dev = xhci_ep_to_dev(ep);
     
    957957        /* Issue configure endpoint command (sec 4.3.5). */
    958958        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);
    960960        if (err)
    961961                return err;
     
    981981 * @param ep_idx Endpoint DCI in question
    982982 */
    983 int hc_drop_endpoint(xhci_endpoint_t *ep)
     983errno_t hc_drop_endpoint(xhci_endpoint_t *ep)
    984984{
    985985        xhci_device_t * const dev = xhci_ep_to_dev(ep);
     
    992992        /* Issue configure endpoint command (sec 4.3.5). */
    993993        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);
    995995        if (err)
    996996                return err;
     
    10131013 * @param ep_ctx Endpoint context of the endpoint
    10141014 */
    1015 int hc_update_endpoint(xhci_endpoint_t *ep)
     1015errno_t hc_update_endpoint(xhci_endpoint_t *ep)
    10161016{
    10171017        xhci_device_t * const dev = xhci_ep_to_dev(ep);
     
    10211021        xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
    10221022
    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));
    10241024        if (err)
    10251025                return err;
     
    10441044 * @param ep_idx Endpoint DCI in question
    10451045 */
    1046 int hc_stop_endpoint(xhci_endpoint_t *ep)
     1046errno_t hc_stop_endpoint(xhci_endpoint_t *ep)
    10471047{
    10481048        xhci_device_t * const dev = xhci_ep_to_dev(ep);
     
    10651065 * @param ep_idx Endpoint DCI in question
    10661066 */
    1067 int hc_reset_endpoint(xhci_endpoint_t *ep)
     1067errno_t hc_reset_endpoint(xhci_endpoint_t *ep)
    10681068{
    10691069        xhci_device_t * const dev = xhci_ep_to_dev(ep);
     
    10811081 * @param dev The owner of the endpoint
    10821082 */
    1083 int hc_reset_ring(xhci_endpoint_t *ep, uint32_t stream_id)
     1083errno_t hc_reset_ring(xhci_endpoint_t *ep, uint32_t stream_id)
    10841084{
    10851085        xhci_device_t * const dev = xhci_ep_to_dev(ep);
  • uspace/drv/bus/usb/xhci/hc.h

    r961a5ee r45457265  
    112112typedef struct xhci_device xhci_device_t;
    113113
    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 *);
     114extern errno_t hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *);
     115extern errno_t hc_init_memory(xhci_hc_t *, ddf_dev_t *);
     116extern errno_t hc_claim(xhci_hc_t *, ddf_dev_t *);
     117extern errno_t hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *, int *);
     118extern errno_t hc_start(xhci_hc_t *);
    119119extern void hc_fini(xhci_hc_t *);
    120120
     
    123123extern unsigned hc_speed_to_psiv(usb_speed_t);
    124124
    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);
     125extern errno_t hc_enable_slot(xhci_device_t *);
     126extern errno_t hc_disable_slot(xhci_device_t *);
     127extern errno_t hc_address_device(xhci_device_t *);
     128extern errno_t hc_configure_device(xhci_device_t *);
     129extern errno_t hc_deconfigure_device(xhci_device_t *);
     130extern errno_t hc_add_endpoint(xhci_endpoint_t *);
     131extern errno_t hc_drop_endpoint(xhci_endpoint_t *);
     132extern errno_t hc_update_endpoint(xhci_endpoint_t *);
     133extern errno_t hc_stop_endpoint(xhci_endpoint_t *);
     134extern errno_t hc_reset_endpoint(xhci_endpoint_t *);
     135extern errno_t hc_reset_ring(xhci_endpoint_t *, uint32_t);
    136136
    137 extern int hc_status(bus_t *, uint32_t *);
     137extern errno_t hc_status(bus_t *, uint32_t *);
    138138extern void hc_interrupt(bus_t *, uint32_t);
    139139
  • uspace/drv/bus/usb/xhci/isoch.c

    r961a5ee r45457265  
    141141 * Allocate isochronous buffers. Create the feeding timer.
    142142 */
    143 int isoch_alloc_transfers(xhci_endpoint_t *ep) {
     143errno_t isoch_alloc_transfers(xhci_endpoint_t *ep) {
    144144        assert(ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS);
    145145        xhci_isoch_t * const isoch = ep->isoch;
     
    171171}
    172172
    173 static int schedule_isochronous_trb(xhci_endpoint_t *ep, xhci_isoch_transfer_t *it)
     173static errno_t schedule_isochronous_trb(xhci_endpoint_t *ep, xhci_isoch_transfer_t *it)
    174174{
    175175        xhci_trb_t trb;
     
    193193        TRB_ISOCH_SET_FRAMEID(trb, (it->mfindex / 8) % 2048);
    194194
    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);
    196196        return err;
    197197}
     
    472472 * it to the xHC.
    473473 */
    474 int isoch_schedule_out(xhci_transfer_t *transfer)
    475 {
    476         int err = EOK;
     474errno_t isoch_schedule_out(xhci_transfer_t *transfer)
     475{
     476        errno_t err = EOK;
    477477
    478478        xhci_endpoint_t *ep = xhci_endpoint_get(transfer->batch.ep);
     
    540540 * buffers, and fetch one filled buffer from the ring.
    541541 */
    542 int isoch_schedule_in(xhci_transfer_t *transfer)
     542errno_t isoch_schedule_in(xhci_transfer_t *transfer)
    543543{
    544544        xhci_endpoint_t *ep = xhci_endpoint_get(transfer->batch.ep);
     
    595595        fibril_mutex_lock(&ep->isoch->guard);
    596596
    597         int err;
     597        errno_t err;
    598598        const xhci_trb_completion_code_t completion_code = TRB_COMPLETION_CODE(*trb);
    599599
  • uspace/drv/bus/usb/xhci/isoch.h

    r961a5ee r45457265  
    6868
    6969        /** Result of the transfer. Valid only if status == ISOCH_COMPLETE. */
    70         int error;
     70        errno_t error;
    7171} xhci_isoch_transfer_t;
    7272
     
    119119extern void isoch_init(xhci_endpoint_t *, const usb_endpoint_descriptors_t *);
    120120extern void isoch_fini(xhci_endpoint_t *);
    121 extern int isoch_alloc_transfers(xhci_endpoint_t *);
     121extern errno_t isoch_alloc_transfers(xhci_endpoint_t *);
    122122
    123 extern int isoch_schedule_out(xhci_transfer_t *);
    124 extern int isoch_schedule_in(xhci_transfer_t *);
     123extern errno_t isoch_schedule_out(xhci_transfer_t *);
     124extern errno_t isoch_schedule_in(xhci_transfer_t *);
    125125extern void isoch_handle_transfer_event(xhci_hc_t *, xhci_endpoint_t *, xhci_trb_t *);
    126126
  • uspace/drv/bus/usb/xhci/main.c

    r961a5ee r45457265  
    5353}
    5454
    55 static int hcd_hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)
     55static errno_t hcd_hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)
    5656{
    57         int err;
     57        errno_t err;
    5858        xhci_hc_t *hc = hcd_to_hc(hcd);
    5959        hc_device_setup(hcd, (bus_t *) &hc->bus);
     
    6868}
    6969
    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)
     70static errno_t hcd_irq_code_gen(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)
    7171{
    7272        xhci_hc_t *hc = hcd_to_hc(hcd);
     
    7474}
    7575
    76 static int hcd_claim(hc_device_t *hcd)
     76static errno_t hcd_claim(hc_device_t *hcd)
    7777{
    7878        xhci_hc_t *hc = hcd_to_hc(hcd);
     
    8080}
    8181
    82 static int hcd_start(hc_device_t *hcd)
     82static errno_t hcd_start(hc_device_t *hcd)
    8383{
    8484        xhci_hc_t *hc = hcd_to_hc(hcd);
     
    8686}
    8787
    88 static int hcd_hc_gone(hc_device_t *hcd)
     88static errno_t hcd_hc_gone(hc_device_t *hcd)
    8989{
    9090        xhci_hc_t *hc = hcd_to_hc(hcd);
     
    112112 * Driver debug level is set here.
    113113 */
    114 int main(int argc, char *argv[])
     114errno_t main(int argc, char *argv[])
    115115{
    116116        log_init(NAME);
  • uspace/drv/bus/usb/xhci/rh.c

    r961a5ee r45457265  
    7979 * Initialize the roothub subsystem.
    8080 */
    81 int xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc)
     81errno_t xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc)
    8282{
    8383        assert(rh);
     
    9090                return ENOMEM;
    9191
    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);
    9393        if (err) {
    9494                free(rh->ports);
     
    119119 * Finalize the RH subsystem.
    120120 */
    121 int xhci_rh_fini(xhci_rh_t *rh)
     121errno_t xhci_rh_fini(xhci_rh_t *rh)
    122122{
    123123        assert(rh);
     
    139139 * a virtual usbhub device for RH, this routine is called for devices directly.
    140140 */
    141 static int rh_enumerate_device(usb_port_t *usb_port)
    142 {
    143         int err;
     141static errno_t rh_enumerate_device(usb_port_t *usb_port)
     142{
     143        errno_t err;
    144144        rh_port_t *port = get_rh_port(usb_port);
    145145
  • uspace/drv/bus/usb/xhci/rh.h

    r961a5ee r45457265  
    8181} xhci_rh_t;
    8282
    83 extern int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);
    84 extern int xhci_rh_fini(xhci_rh_t *);
     83extern errno_t xhci_rh_init(xhci_rh_t *, xhci_hc_t *);
     84extern errno_t xhci_rh_fini(xhci_rh_t *);
    8585
    8686extern void xhci_rh_set_ports_protocol(xhci_rh_t *, unsigned, unsigned, unsigned);
  • uspace/drv/bus/usb/xhci/scratchpad.c

    r961a5ee r45457265  
    5757 * Allocate all scratchpad buffers, and configure the xHC.
    5858 */
    59 int xhci_scratchpad_alloc(xhci_hc_t *hc)
     59errno_t xhci_scratchpad_alloc(xhci_hc_t *hc)
    6060{
    6161        const unsigned num_bufs = xhci_scratchpad_count(hc);
  • uspace/drv/bus/usb/xhci/scratchpad.h

    r961a5ee r45457265  
    4545typedef struct xhci_hc xhci_hc_t;
    4646
    47 extern int xhci_scratchpad_alloc(xhci_hc_t *);
     47extern errno_t xhci_scratchpad_alloc(xhci_hc_t *);
    4848extern void xhci_scratchpad_free(xhci_hc_t *);
    4949
  • uspace/drv/bus/usb/xhci/streams.c

    r961a5ee r45457265  
    8585 * @param[in] count Amount of primary streams.
    8686 */
    87 static int initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count)
     87static errno_t initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count)
    8888{
    8989        usb_log_debug("Allocating primary stream context array of size %u "
     
    152152 * @param[in] index index of the initialized stream structure.
    153153 */
    154 static int initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
    155     unsigned index)
     154static errno_t initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
     155        unsigned index)
    156156{
    157157        xhci_stream_ctx_t *ctx = &xhci_ep->primary_stream_ctx_array[index];
     
    159159        memset(data, 0, sizeof(xhci_stream_data_t));
    160160
    161         int err = EOK;
     161        errno_t err = EOK;
    162162
    163163        /* Init and register TRB ring for the primary stream */
     
    178178 * @param[in] xhci_ep XHCI bulk endpoint to use.
    179179 */
    180 static int initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep)
    181 {
    182         int err = EOK;
     180static errno_t initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep)
     181{
     182        errno_t err = EOK;
    183183        size_t index;
    184184        for (index = 0; index < xhci_ep->primary_stream_data_size; ++index) {
     
    205205 * @param[in] count Number of secondary streams to initialize.
    206206 */
    207 static int initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
    208     unsigned idx, unsigned count)
     207static errno_t initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
     208        unsigned idx, unsigned count)
    209209{
    210210        if (count == 0) {
     
    243243
    244244        /* Initialize all the rings. */
    245         int err = EOK;
     245        errno_t err = EOK;
    246246        size_t index;
    247247        for (index = 0; index < count; ++index) {
     
    275275 */
    276276static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx,
    277     unsigned pstreams, unsigned lsa)
     277        unsigned pstreams, unsigned lsa)
    278278{
    279279        XHCI_EP_TYPE_SET(*ctx, xhci_endpoint_type(xhci_ep));
     
    294294 * @param[in] count Amount of primary streams requested.
    295295 */
    296 static int verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev,
     296static errno_t verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev,
    297297        xhci_endpoint_t *xhci_ep, unsigned count)
    298298{
     
    345345 * @param[in] xhci_ep Associated XHCI bulk endpoint.
    346346 */
    347 int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,
    348     xhci_endpoint_t *xhci_ep)
     347errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,
     348        xhci_endpoint_t *xhci_ep)
    349349{
    350350        if (!xhci_ep->primary_stream_data_size) {
     
    357357
    358358        /* Streams are now removed, proceed with reconfiguring endpoint. */
    359         int err;
     359        errno_t err;
    360360        if ((err = xhci_trb_ring_init(&xhci_ep->ring, 0))) {
    361361                usb_log_error("Failed to initialize a transfer ring.");
     
    373373 * @param[in] count Amount of primary streams requested.
    374374 */
    375 int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
     375errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    376376        xhci_endpoint_t *xhci_ep, unsigned count)
    377377{
    378         int err = verify_stream_conditions(hc, dev, xhci_ep, count);
     378        errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count);
    379379        if (err) {
    380380                return err;
     
    421421 * @param[in] count Amount of primary streams requested.
    422422 */
    423 int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
     423errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    424424        xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count)
    425425{
     
    430430        }
    431431
    432         int err = verify_stream_conditions(hc, dev, xhci_ep, count);
     432        errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count);
    433433        if (err) {
    434434                return err;
  • uspace/drv/bus/usb/xhci/streams.h

    r961a5ee r45457265  
    6464extern void xhci_stream_free_ds(xhci_endpoint_t *xhci_ep);
    6565
    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,
     66extern errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep);
     67extern errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    6868        xhci_endpoint_t *xhci_ep, unsigned count);
    69 extern int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
     69extern errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    7070        xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count);
    7171
  • uspace/drv/bus/usb/xhci/transfers.c

    r961a5ee r45457265  
    150150}
    151151
    152 static int schedule_control(xhci_hc_t* hc, xhci_transfer_t* transfer)
     152static errno_t schedule_control(xhci_hc_t* hc, xhci_transfer_t* transfer)
    153153{
    154154        usb_transfer_batch_t *batch = &transfer->batch;
     
    213213        // Issue a Configure Endpoint command, if needed.
    214214        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));
    216216                if (err)
    217217                        return err;
     
    222222}
    223223
    224 static int schedule_bulk(xhci_hc_t* hc, xhci_transfer_t *transfer)
     224static errno_t schedule_bulk(xhci_hc_t* hc, xhci_transfer_t *transfer)
    225225{
    226226        /* The stream-enabled endpoints need to chain ED trb */
     
    276276}
    277277
    278 static int schedule_interrupt(xhci_hc_t* hc, xhci_transfer_t* transfer)
     278static errno_t schedule_interrupt(xhci_hc_t* hc, xhci_transfer_t* transfer)
    279279{
    280280        const size_t buffer_count = calculate_trb_count(transfer);
     
    309309}
    310310
    311 int xhci_handle_transfer_event(xhci_hc_t* hc, xhci_trb_t* trb)
     311errno_t xhci_handle_transfer_event(xhci_hc_t* hc, xhci_trb_t* trb)
    312312{
    313313        uintptr_t addr = trb->parameter;
     
    430430}
    431431
    432 typedef int (*transfer_handler)(xhci_hc_t *, xhci_transfer_t *);
     432typedef errno_t (*transfer_handler)(xhci_hc_t *, xhci_transfer_t *);
    433433
    434434static const transfer_handler transfer_handlers[] = {
     
    444444 * Bus callback.
    445445 */
    446 int xhci_transfer_schedule(usb_transfer_batch_t *batch)
     446errno_t xhci_transfer_schedule(usb_transfer_batch_t *batch)
    447447{
    448448        endpoint_t *ep = batch->ep;
     
    504504                                 * possible that we have to clear all of them.
    505505                                 */
    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);
    507507                                endpoint_del_ref(halted_ep);
    508508                                if (err) {
     
    526526
    527527
    528         int err;
     528        errno_t err;
    529529        fibril_mutex_lock(&xhci_ep->guard);
    530530
  • uspace/drv/bus/usb/xhci/transfers.h

    r961a5ee r45457265  
    5656
    5757extern usb_transfer_batch_t* xhci_transfer_create(endpoint_t *);
    58 extern int xhci_transfer_schedule(usb_transfer_batch_t *);
     58extern errno_t xhci_transfer_schedule(usb_transfer_batch_t *);
    5959
    60 extern int xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *);
     60extern errno_t xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *);
    6161extern void xhci_transfer_destroy(usb_transfer_batch_t *);
    6262
  • uspace/drv/bus/usb/xhci/trb_ring.c

    r961a5ee r45457265  
    8787 * to DMAMEM_4GiB.
    8888 */
    89 static int trb_segment_alloc(trb_segment_t **segment)
     89static errno_t trb_segment_alloc(trb_segment_t **segment)
    9090{
    9191        dma_buffer_t dbuf;
    9292
    93         const int err = dma_buffer_alloc(&dbuf, PAGE_SIZE);
     93        const errno_t err = dma_buffer_alloc(&dbuf, PAGE_SIZE);
    9494        if (err)
    9595                return err;
     
    114114 * choice on a reasonable default (one page-sized segment).
    115115 */
    116 int xhci_trb_ring_init(xhci_trb_ring_t *ring, size_t initial_size)
    117 {
    118         int err;
     116errno_t xhci_trb_ring_init(xhci_trb_ring_t *ring, size_t initial_size)
     117{
     118        errno_t err;
    119119        if (initial_size == 0)
    120120                initial_size = SEGMENT_TRB_USEFUL_COUNT;
     
    218218 *         EAGAIN when the ring is too full to fit all TRBs (temporary)
    219219 */
    220 int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *ring, xhci_trb_t *first_trb,
     220errno_t xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *ring, xhci_trb_t *first_trb,
    221221        size_t trbs, uintptr_t *phys)
    222222{
    223         int err;
     223        errno_t err;
    224224        assert(trbs > 0);
    225225        fibril_mutex_lock(&ring->guard);
     
    294294 * Enqueue TD composed of a single TRB. See: `xhci_trb_ring_enqueue_multiple`
    295295 */
    296 int xhci_trb_ring_enqueue(xhci_trb_ring_t *ring, xhci_trb_t *td, uintptr_t *phys)
     296errno_t xhci_trb_ring_enqueue(xhci_trb_ring_t *ring, xhci_trb_t *td, uintptr_t *phys)
    297297{
    298298        return xhci_trb_ring_enqueue_multiple(ring, td, 1, phys);
     
    315315 * choice on a reasonable default (one page-sized segment).
    316316 */
    317 int xhci_event_ring_init(xhci_event_ring_t *ring, size_t initial_size)
    318 {
    319         int err;
     317errno_t xhci_event_ring_init(xhci_event_ring_t *ring, size_t initial_size)
     318{
     319        errno_t err;
    320320        if (initial_size == 0)
    321321                initial_size = SEGMENT_TRB_COUNT;
     
    390390 *         ENOENT when the ring is empty
    391391 */
    392 int xhci_event_ring_dequeue(xhci_event_ring_t *ring, xhci_trb_t *event)
     392errno_t xhci_event_ring_dequeue(xhci_event_ring_t *ring, xhci_trb_t *event)
    393393{
    394394        fibril_mutex_lock(&ring->guard);
     
    445445}
    446446
    447 int xhci_sw_ring_enqueue(xhci_sw_ring_t *ring, xhci_trb_t *trb)
     447errno_t xhci_sw_ring_enqueue(xhci_sw_ring_t *ring, xhci_trb_t *trb)
    448448{
    449449        assert(ring);
     
    464464}
    465465
    466 int xhci_sw_ring_dequeue(xhci_sw_ring_t *ring, xhci_trb_t *trb)
     466errno_t xhci_sw_ring_dequeue(xhci_sw_ring_t *ring, xhci_trb_t *trb)
    467467{
    468468        assert(ring);
  • uspace/drv/bus/usb/xhci/trb_ring.h

    r961a5ee r45457265  
    7474} xhci_trb_ring_t;
    7575
    76 extern int xhci_trb_ring_init(xhci_trb_ring_t *, size_t);
     76extern errno_t xhci_trb_ring_init(xhci_trb_ring_t *, size_t);
    7777extern 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 *);
     78extern errno_t xhci_trb_ring_enqueue(xhci_trb_ring_t *, xhci_trb_t *, uintptr_t *);
     79extern errno_t xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *);
    8080
    8181extern void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr);
     
    107107} xhci_event_ring_t;
    108108
    109 extern int xhci_event_ring_init(xhci_event_ring_t *, size_t);
     109extern errno_t xhci_event_ring_init(xhci_event_ring_t *, size_t);
    110110extern void xhci_event_ring_fini(xhci_event_ring_t *);
    111111extern void xhci_event_ring_reset(xhci_event_ring_t *);
    112 extern int xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *);
     112extern errno_t xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *);
    113113
    114114/**
     
    128128
    129129/* 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 *);
     130extern errno_t xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *);
     131extern errno_t xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *);
    132132
    133133extern void xhci_sw_ring_restart(xhci_sw_ring_t *);
  • uspace/lib/drv/generic/driver.c

    r961a5ee r45457265  
    971971}
    972972
    973 int ddf_driver_main(const driver_t *drv)
     973errno_t ddf_driver_main(const driver_t *drv)
    974974{
    975975        /*
Note: See TracChangeset for help on using the changeset viewer.