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

Legend:

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

    rf5e5f73 rdf6ded8  
    11/*
    22 * Copyright (c) 2011 Jan Vesely
     3 * Copyright (c) 2018 Ondrej Hlavaty
    34 * All rights reserved.
    45 *
     
    3233 * @brief OHCI driver
    3334 */
    34 #ifndef DRV_OHCI_HCD_ENDPOINT_H
    35 #define DRV_OHCI_HCD_ENDPOINT_H
     35#ifndef DRV_OHCI_HCD_BUS_H
     36#define DRV_OHCI_HCD_BUS_H
    3637
    3738#include <assert.h>
    3839#include <adt/list.h>
    39 #include <usb/host/endpoint.h>
    40 #include <usb/host/hcd.h>
     40#include <usb/dma_buffer.h>
     41#include <usb/host/usb2_bus.h>
    4142
    4243#include "hw_struct/endpoint_descriptor.h"
    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 {
     55        endpoint_t base;
     56
    4757        /** OHCI endpoint descriptor */
    4858        ed_t *ed;
    49         /** Currently enqueued transfer descriptor */
    50         td_t *td;
    51         /** Linked list used by driver software */
    52         link_t link;
     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
     65        /** Link in endpoint_list*/
     66        link_t eplist_link;
     67        /** Link in pending_endpoints */
     68        link_t pending_link;
    5369} ohci_endpoint_t;
    5470
    55 errno_t ohci_endpoint_init(hcd_t *hcd, endpoint_t *ep);
    56 void ohci_endpoint_fini(hcd_t *hcd, endpoint_t *ep);
     71typedef struct hc hc_t;
     72
     73typedef struct {
     74        bus_t base;
     75        usb2_bus_helper_t helper;
     76        hc_t *hc;
     77} ohci_bus_t;
     78
     79errno_t ohci_bus_init(ohci_bus_t *, hc_t *);
     80void ohci_ep_toggle_reset(endpoint_t *);
    5781
    5882/** Get and convert assigned ohci_endpoint_t structure
     
    6387{
    6488        assert(ep);
    65         return ep->hc_data.data;
     89        return (ohci_endpoint_t *) ep;
    6690}
    6791
Note: See TracChangeset for help on using the changeset viewer.