Changeset 398a94c in mainline


Ignore:
Timestamp:
2018-01-10T13:32:21Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8bab0d2
Parents:
4a00bc9
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-10 13:32:19)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-10 13:32:21)
Message:

xhci isoch: bug fixing

Location:
uspace/drv/bus/usb/xhci
Files:
3 edited

Legend:

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

    r4a00bc9 r398a94c  
    6565        endpoint_init(ep, dev, desc);
    6666
    67         xhci_ep->max_streams = 1 << (USB_SSC_MAX_STREAMS(desc->companion));
    6867        xhci_ep->max_burst = desc->companion.max_burst + 1;
    69         xhci_ep->mult = USB_SSC_MULT(desc->companion) + 1;
     68
     69        if (ep->transfer_type == USB_TRANSFER_BULK)
     70                xhci_ep->max_streams = 1 << (USB_SSC_MAX_STREAMS(desc->companion));
     71        else
     72                xhci_ep->max_streams = 1;
     73
     74        if (ep->transfer_type == USB_TRANSFER_ISOCHRONOUS)
     75                xhci_ep->mult = USB_SSC_MULT(desc->companion) + 1;
     76        else
     77                xhci_ep->mult = 1;
    7078
    7179        /* In USB 3, the semantics of wMaxPacketSize changed. Now the number of
     
    314322        }
    315323
    316         isoch_fini(xhci_ep);
     324        if (xhci_ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS)
     325                isoch_fini(xhci_ep);
    317326}
    318327
  • uspace/drv/bus/usb/xhci/isoch.c

    r4a00bc9 r398a94c  
    5454        fibril_condvar_initialize(&isoch->avail);
    5555
    56         isoch->max_size = desc->companion.bytes_per_interval
    57                 ? desc->companion.bytes_per_interval
    58                 : ep->base.max_transfer_size;
    59 
    6056        const xhci_hc_t *hc = bus_to_xhci_bus(ep->base.device->bus)->hc;
    6157
     
    122118        for (size_t i = 0; i < isoch->buffer_count; ++i) {
    123119                xhci_isoch_transfer_t *transfer = &isoch->transfers[i];
    124                 if (dma_buffer_alloc(&transfer->data, isoch->max_size)) {
     120                if (dma_buffer_alloc(&transfer->data, ep->base.max_transfer_size)) {
    125121                        goto err;
    126122                }
     
    276272                        fibril_timer_set_locked(isoch->feeding_timer, delay,
    277273                            isoch_feed_out_timer, ep);
    278                         break;
     274                        goto out;
    279275                }
    280276
     
    305301                }
    306302        }
     303out:
    307304
    308305        if (fed) {
     
    345342                /* IN buffers are "filled" with free space */
    346343                if (it->state == ISOCH_EMPTY) {
    347                         it->size = isoch->max_size;
     344                        it->size = ep->base.max_transfer_size;
    348345                        it->state = ISOCH_FILLED;
    349346                        calc_next_mfindex(ep, it);
     
    361358                        fibril_timer_set_locked(isoch->feeding_timer, delay,
    362359                            isoch_feed_in_timer, ep);
    363                         break;
     360                        goto out;
    364361                }
    365362
     
    391388                }
    392389        }
     390out:
    393391
    394392        if (fed) {
     
    422420        xhci_isoch_t * const isoch = ep->isoch;
    423421
    424         if (transfer->batch.buffer_size > isoch->max_size) {
     422        if (transfer->batch.buffer_size > ep->base.max_transfer_size) {
    425423                usb_log_error("Cannot schedule an oversized isochronous transfer.");
    426424                return ELIMIT;
     
    487485        xhci_isoch_t * const isoch = ep->isoch;
    488486
    489         if (transfer->batch.buffer_size < isoch->max_size) {
     487        if (transfer->batch.buffer_size < ep->base.max_transfer_size) {
    490488                usb_log_error("Cannot schedule an undersized isochronous transfer.");
    491489                return ELIMIT;
  • uspace/drv/bus/usb/xhci/main.c

    r4a00bc9 r398a94c  
    115115{
    116116        log_init(NAME);
    117         logctl_set_log_level(NAME, LVL_NOTE);
     117        logctl_set_log_level(NAME, LVL_DEBUG);
    118118        return hc_driver_main(&xhci_driver);
    119119}
Note: See TracChangeset for help on using the changeset viewer.