Changeset a312d8f in mainline for uspace/drv/bus/usb/uhci/uhci_batch.c


Ignore:
Timestamp:
2017-10-30T22:18:28Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17873ac7
Parents:
ef1a3a8
Message:

uhci: fixed buffer copying on IN transaction

Lost in some refactoring, masked by deadlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    ref1a3a8 ra312d8f  
    6464}
    6565
     66void uhci_transfer_batch_finish(uhci_transfer_batch_t *batch)
     67{
     68        if (batch->base.dir == USB_DIRECTION_IN) {
     69                assert(batch->base.transfered_size <= batch->base.buffer_size);
     70                memcpy(batch->base.buffer, uhci_transfer_batch_data_buffer(batch), batch->base.transfered_size);
     71        }
     72        usb_transfer_batch_finish(&batch->base);
     73}
     74
    6675/** Allocate memory and initialize internal data structure.
    6776 *
     
    131140        dest += setup_size;
    132141        /* Copy generic data unless they are provided by the device */
    133         if (usb_batch->ep->direction != USB_DIRECTION_IN) {
     142        if (usb_batch->dir != USB_DIRECTION_IN) {
    134143                memcpy(dest, usb_batch->buffer, usb_batch->buffer_size);
    135144        }
Note: See TracChangeset for help on using the changeset viewer.