Changeset e67c50a in mainline for uspace/drv/bus/usb/ohci/ohci_bus.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_bus.h

    r3e6ff9a re67c50a  
    3838#include <assert.h>
    3939#include <adt/list.h>
     40#include <usb/dma_buffer.h>
    4041#include <usb/host/usb2_bus.h>
    4142
     
    4344#include "hw_struct/transfer_descriptor.h"
    4445
    45 /** Connector structure linking ED to to prepared TD. */
     46/**
     47 * Connector structure linking ED to to prepared TD.
     48 *
     49 * OHCI requires new transfers to be appended at the end of a queue. But it has
     50 * a weird semantics of a leftover TD, which serves as a placeholder. This left
     51 * TD is overwritten with first TD of a new transfer, and the spare one is used
     52 * as the next placeholder. Then the two are swapped for the next transaction.
     53 */
    4654typedef struct ohci_endpoint {
    4755        endpoint_t base;
     
    4957        /** OHCI endpoint descriptor */
    5058        ed_t *ed;
    51         /** Currently enqueued transfer descriptor */
    52         td_t *td;
     59        /** TDs to be used at the beginning and end of transaction */
     60        td_t *tds [2];
     61
     62        /** Buffer to back ED + 2 TD */
     63        dma_buffer_t dma_buffer;
     64
    5365        /** Link in endpoint_list*/
    5466        link_t eplist_link;
Note: See TracChangeset for help on using the changeset viewer.