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


Ignore:
Timestamp:
2018-02-28T16:37:50Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b20da0
Parents:
f5e5f73 (diff), b2dca8de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
git-committer:
Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
Message:

Merge github.com:helenos-xhci-team/helenos

This commit merges support for USB 3 and generally refactors, fixes,
extends and cleans up the existing USB framework.

Notable additions and features:

  • new host controller driver has been implemented to control various xHC models (among others, NEC Renesas uPD720200)
  • isochronous data transfer mode
  • support for explicit USB device removal
  • USB tablet driver
File:
1 edited

Legend:

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

    rf5e5f73 rdf6ded8  
    11/*
    22 * Copyright (c) 2011 Jan Vesely
     3 * Copyright (c) 2018 Ondrej Hlavaty
    34 * All rights reserved.
    45 *
     
    3839#include <assert.h>
    3940#include <stdbool.h>
     41#include <usb/dma_buffer.h>
    4042#include <usb/host/usb_transfer_batch.h>
    4143
     
    4547/** OHCI specific data required for USB transfer */
    4648typedef struct ohci_transfer_batch {
    47         /** Link */
    48         link_t link;
    49         /** Endpoint descriptor of the target endpoint. */
    50         ed_t *ed;
    51         /** List of TDs needed for the transfer */
    52         td_t **tds;
     49        usb_transfer_batch_t base;
     50
    5351        /** Number of TDs used by the transfer */
    5452        size_t td_count;
    55         /** Data buffer, must be accessible by the OHCI hw. */
    56         char *device_buffer;
    57         /** Generic USB transfer structure */
    58         usb_transfer_batch_t *usb_batch;
     53
     54        /**
     55         * List of TDs needed for the transfer - together with setup data
     56         * backed by the dma buffer. Note that the TD pointers are pointing to
     57         * the DMA buffer initially, but as the scheduling must use the first TD
     58         * from EP, it is replaced.
     59         */
     60        td_t **tds;
     61        char *setup_buffer;
     62        char *data_buffer;
     63
     64        dma_buffer_t ohci_dma_buffer;
    5965} ohci_transfer_batch_t;
    6066
    61 ohci_transfer_batch_t * ohci_transfer_batch_get(usb_transfer_batch_t *batch);
    62 bool ohci_transfer_batch_is_complete(const ohci_transfer_batch_t *batch);
     67ohci_transfer_batch_t *ohci_transfer_batch_create(endpoint_t *batch);
     68int ohci_transfer_batch_prepare(ohci_transfer_batch_t *ohci_batch);
    6369void ohci_transfer_batch_commit(const ohci_transfer_batch_t *batch);
    64 void ohci_transfer_batch_finish_dispose(ohci_transfer_batch_t *batch);
     70bool ohci_transfer_batch_check_completed(ohci_transfer_batch_t *batch);
     71void ohci_transfer_batch_destroy(ohci_transfer_batch_t *ohci_batch);
    6572
    66 static inline ohci_transfer_batch_t *ohci_transfer_batch_from_link(link_t *l)
     73static inline ohci_transfer_batch_t *ohci_transfer_batch_get(
     74    usb_transfer_batch_t *usb_batch)
    6775{
    68         assert(l);
    69         return list_get_instance(l, ohci_transfer_batch_t, link);
     76        assert(usb_batch);
     77
     78        return (ohci_transfer_batch_t *) usb_batch;
    7079}
     80
    7181#endif
    7282/**
Note: See TracChangeset for help on using the changeset viewer.