Changeset 0eadfd1e in mainline for uspace/drv/bus/usb/xhci/endpoint.c


Ignore:
Timestamp:
2018-01-09T14:14:32Z (6 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dfa1fc8
Parents:
17c5e62
Message:

xhci: allocate/free transfer ring internally in endpoint init/fini

File:
1 edited

Legend:

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

    r17c5e62 r0eadfd1e  
    4545#include "endpoint.h"
    4646
     47static int alloc_transfer_ds(xhci_endpoint_t *);
     48static void free_transfer_ds(xhci_endpoint_t *);
     49
    4750/**
    4851 * Initialize new XHCI endpoint.
     
    5558int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, const usb_endpoint_descriptors_t *desc)
    5659{
     60        int rc;
    5761        assert(xhci_ep);
    5862
     
    103107        }
    104108
     109        if ((rc = alloc_transfer_ds(xhci_ep)))
     110                goto err;
     111
    105112        return EOK;
     113
     114err:
     115        return rc;
    106116}
    107117
     
    113123{
    114124        assert(xhci_ep);
     125
     126        free_transfer_ds(xhci_ep);
    115127
    116128        // TODO: Something missed?
     
    291303 * @return Error code.
    292304 */
    293 int xhci_endpoint_alloc_transfer_ds(xhci_endpoint_t *xhci_ep)
     305static int alloc_transfer_ds(xhci_endpoint_t *xhci_ep)
    294306{
    295307        /* Can't use XHCI_EP_FMT because the endpoint may not have device. */
     
    316328 * @param[in] xhci_ep XHCI endpoint to free data structures for.
    317329 */
    318 void xhci_endpoint_free_transfer_ds(xhci_endpoint_t *xhci_ep)
     330static void free_transfer_ds(xhci_endpoint_t *xhci_ep)
    319331{
    320332        if (endpoint_using_streams(xhci_ep)) {
Note: See TracChangeset for help on using the changeset viewer.