Changeset e67c50a in mainline for uspace/drv/bus/usb/ohci/ohci_batch.h


Ignore:
Timestamp:
2018-02-01T21:13:23Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64ce0c1
Parents:
3e6ff9a
git-author:
Ondřej Hlavatý <aearsis@…> (2018-02-01 21:13:22)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-02-01 21:13:23)
Message:

ohci: use dma memory responsibly

Instead of leaving arbitrary TD behind to be used by next transfer,
prepare two of them in endpoint and use them in a cyclic manner. This
reduces the number of pages allocated per transfer to one.

File:
1 edited

Legend:

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

    r3e6ff9a re67c50a  
    3838#include <assert.h>
    3939#include <stdbool.h>
     40#include <usb/dma_buffer.h>
    4041#include <usb/host/usb_transfer_batch.h>
    4142
     
    4748        usb_transfer_batch_t base;
    4849
    49         /** Endpoint descriptor of the target endpoint. */
    50         ed_t *ed;
    51         /** List of TDs needed for the transfer */
    52         td_t **tds;
    5350        /** Number of TDs used by the transfer */
    5451        size_t td_count;
    55         /** Data buffer, must be accessible by the OHCI hw. */
    56         char *device_buffer;
     52
     53        /**
     54         * List of TDs needed for the transfer - together with setup data
     55         * backed by the dma buffer. Note that the TD pointers are pointing to
     56         * the DMA buffer initially, but as the scheduling must use the first TD
     57         * from EP, it is replaced.
     58         */
     59        td_t **tds;
     60        char *setup_buffer;
     61        char *data_buffer;
     62
     63        dma_buffer_t ohci_dma_buffer;
    5764} ohci_transfer_batch_t;
    5865
Note: See TracChangeset for help on using the changeset viewer.