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


Ignore:
Timestamp:
2018-01-08T22:30:12Z (6 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/endpoint.c

    rbdd8842c r17c5e62  
    8989
    9090        if (xhci_ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS) {
    91                 xhci_ep->isoch_max_size = desc->companion.bytes_per_interval
     91                xhci_ep->isoch->max_size = desc->companion.bytes_per_interval
    9292                        ? desc->companion.bytes_per_interval
    9393                        : ep->max_transfer_size;
     
    9595
    9696                /* Allocate and setup isochronous-specific structures. */
    97                 xhci_ep->isoch_enqueue = 0;
    98                 xhci_ep->isoch_dequeue = 0;
    99                 xhci_ep->isoch_started = false;
    100 
    101                 fibril_mutex_initialize(&xhci_ep->isoch_guard);
    102                 fibril_condvar_initialize(&xhci_ep->isoch_avail);
     97                xhci_ep->isoch->enqueue = 0;
     98                xhci_ep->isoch->dequeue = 0;
     99                xhci_ep->isoch->started = false;
     100
     101                fibril_mutex_initialize(&xhci_ep->isoch->guard);
     102                fibril_condvar_initialize(&xhci_ep->isoch->avail);
    103103        }
    104104
     
    266266        int err = EOK;
    267267        while (i < XHCI_ISOCH_BUFFER_COUNT) {
    268                 xhci_isoch_transfer_t *transfer = &xhci_ep->isoch_transfers[i];
    269                 if (dma_buffer_alloc(&transfer->data, xhci_ep->isoch_max_size)) {
     268                xhci_isoch_transfer_t *transfer = &xhci_ep->isoch->transfers[i];
     269                if (dma_buffer_alloc(&transfer->data, xhci_ep->isoch->max_size)) {
    270270                        err = ENOMEM;
    271271                        break;
     
    278278                --i;
    279279                while(i >= 0) {
    280                         dma_buffer_free(&xhci_ep->isoch_transfers[i].data);
     280                        dma_buffer_free(&xhci_ep->isoch->transfers[i].data);
    281281                        --i;
    282282                }
     
    342342        if (xhci_ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS) {
    343343                for (size_t i = 0; i < XHCI_ISOCH_BUFFER_COUNT; ++i) {
    344                         dma_buffer_free(&xhci_ep->isoch_transfers[i].data);
     344                        dma_buffer_free(&xhci_ep->isoch->transfers[i].data);
    345345                }
    346346        }
     
    417417        XHCI_EP_INTERVAL_SET(*ctx, fnzb32(ep->interval) % 32 - 1);
    418418
    419         XHCI_EP_MAX_ESIT_PAYLOAD_LO_SET(*ctx, ep->isoch_max_size & 0xFFFF);
    420         XHCI_EP_MAX_ESIT_PAYLOAD_HI_SET(*ctx, (ep->isoch_max_size >> 16) & 0xFF);
     419        XHCI_EP_MAX_ESIT_PAYLOAD_LO_SET(*ctx, ep->isoch->max_size & 0xFFFF);
     420        XHCI_EP_MAX_ESIT_PAYLOAD_HI_SET(*ctx, (ep->isoch->max_size >> 16) & 0xFF);
    421421}
    422422
Note: See TracChangeset for help on using the changeset viewer.