Changeset df6ded8 in mainline for uspace/drv/bus/usb/uhci/hc.h


Ignore:
Timestamp:
2018-02-28T16:37:50Z (7 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/uhci/hc.h

    rf5e5f73 rdf6ded8  
    11/*
    22 * Copyright (c) 2011 Jan Vesely
     3 * Copyright (c) 2018 Ondrej Hlavaty
    34 * All rights reserved.
    45 *
     
    4344#include <ddi.h>
    4445#include <usb/host/hcd.h>
     46#include <usb/host/usb2_bus.h>
    4547#include <usb/host/usb_transfer_batch.h>
    4648
     
    99101/** Main UHCI driver structure */
    100102typedef struct hc {
     103        /* Common hc_device header */
     104        hc_device_t base;
     105
    101106        uhci_rh_t rh;
     107        bus_t bus;
     108        usb2_bus_helper_t bus_helper;
     109
    102110        /** Addresses of I/O registers */
    103111        uhci_regs_t *registers;
     
    117125        /** Pointer table to the above lists, helps during scheduling */
    118126        transfer_list_t *transfers[2][4];
    119         /** Indicator of hw interrupts availability */
    120         bool hw_interrupts;
     127
     128        /**
     129         * Guard for the pending list. Can be locked under EP guard, but not
     130         * vice versa.
     131         */
     132        fibril_mutex_t guard;
     133        /** List of endpoints with a transfer scheduled */
     134        list_t pending_endpoints;
    121135
    122136        /** Number of hw failures detected. */
     
    124138} hc_t;
    125139
    126 extern errno_t hc_init(hc_t *, const hw_res_list_parsed_t *, bool);
    127 extern void hc_fini(hc_t *);
     140typedef struct uhci_endpoint {
     141        endpoint_t base;
    128142
    129 extern errno_t uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *, int *);
     143        bool toggle;
     144} uhci_endpoint_t;
    130145
    131 extern void uhci_hc_interrupt(hcd_t *, uint32_t);
    132 extern errno_t uhci_hc_status(hcd_t *, uint32_t *);
    133 extern errno_t uhci_hc_schedule(hcd_t *, usb_transfer_batch_t *);
     146static inline hc_t *hcd_to_hc(hc_device_t *hcd)
     147{
     148        assert(hcd);
     149        return (hc_t *) hcd;
     150}
     151
     152static inline hc_t *bus_to_hc(bus_t *bus)
     153{
     154        assert(bus);
     155        return member_to_inst(bus, hc_t, bus);
     156}
     157
     158int hc_unschedule_batch(usb_transfer_batch_t *);
     159
     160extern errno_t hc_add(hc_device_t *, const hw_res_list_parsed_t *);
     161extern errno_t hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *);
     162extern errno_t hc_start(hc_device_t *);
     163extern errno_t hc_setup_roothub(hc_device_t *);
     164extern errno_t hc_gone(hc_device_t *);
    134165
    135166#endif
Note: See TracChangeset for help on using the changeset viewer.