Changeset 398a94c in mainline for uspace/drv/bus/usb/xhci/isoch.c


Ignore:
Timestamp:
2018-01-10T13:32:21Z (8 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.