Changeset 1d758fc in mainline for uspace/drv/bus/usb/ohci/ohci_batch.c


Ignore:
Timestamp:
2018-02-12T10:11:47Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5fe3f954
Parents:
2f762a7
git-author:
Ondřej Hlavatý <aearsis@…> (2018-02-05 03:28:50)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-02-12 10:11:47)
Message:

usb: rethinking DMA buffers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_batch.c

    r2f762a7 r1d758fc  
    9696                return ENOTSUP;
    9797
    98         ohci_batch->td_count = (usb_batch->buffer_size + OHCI_TD_MAX_TRANSFER - 1)
     98        ohci_batch->td_count = (usb_batch->size + OHCI_TD_MAX_TRANSFER - 1)
    9999            / OHCI_TD_MAX_TRANSFER;
    100100        /* Control transfer need Setup and Status stage */
     
    166166
    167167        /* Assume all data got through */
    168         usb_batch->transferred_size = usb_batch->buffer_size;
     168        usb_batch->transferred_size = usb_batch->size;
    169169
    170170        /* Check all TDs */
     
    212212                }
    213213        }
    214         assert(usb_batch->transferred_size <= usb_batch->buffer_size);
     214        assert(usb_batch->transferred_size <= usb_batch->size);
    215215
    216216        /* Make sure that we are leaving the right TD behind */
     
    289289        size_t td_current = 1;
    290290        const char* buffer = ohci_batch->data_buffer;
    291         size_t remain_size = ohci_batch->base.buffer_size;
     291        size_t remain_size = ohci_batch->base.size;
    292292        while (remain_size > 0) {
    293293                const size_t transfer_size =
     
    343343
    344344        size_t td_current = 0;
    345         size_t remain_size = ohci_batch->base.buffer_size;
     345        size_t remain_size = ohci_batch->base.size;
    346346        char *buffer = ohci_batch->data_buffer;
    347347        while (remain_size > 0) {
Note: See TracChangeset for help on using the changeset viewer.