Changeset 17c5e62 in mainline for uspace/drv/bus/usb/xhci/bus.c


Ignore:
Timestamp:
2018-01-08T22:30:12Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eadfd1e
Parents:
bdd8842c
Message:

xhci: make isoch part of endpoint optional

File:
1 edited

Legend:

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

    rbdd8842c r17c5e62  
    3636#include <usb/host/endpoint.h>
    3737#include <usb/host/hcd.h>
     38#include <usb/descriptor.h>
    3839#include <usb/debug.h>
    3940
     
    368369static endpoint_t *endpoint_create(device_t *dev, const usb_endpoint_descriptors_t *desc)
    369370{
    370         xhci_endpoint_t *ep = calloc(1, sizeof(xhci_endpoint_t));
     371        const usb_transfer_type_t type = USB_ED_GET_TRANSFER_TYPE(desc->endpoint);
     372
     373        xhci_endpoint_t *ep = calloc(1, sizeof(xhci_endpoint_t)
     374                + (type == USB_TRANSFER_ISOCHRONOUS) * sizeof(*ep->isoch));
    371375        if (!ep)
    372376                return NULL;
Note: See TracChangeset for help on using the changeset viewer.