Changeset df6ded8 in mainline for uspace/drv/bus/usb/usbhub/port.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/usbhub/port.h

    rf5e5f73 rdf6ded8  
    22 * Copyright (c) 2011 Vojtech Horky
    33 * Copyright (c) 2011 Jan Vesely
     4 * Copyright (c) 2018 Ondrej Hlavaty
    45 * All rights reserved.
    56 *
     
    3233 */
    3334/** @file
    34  * Hub ports related functions.
     35 * Hub port handling.
    3536 */
    3637
     
    4041#include <usb/dev/driver.h>
    4142#include <usb/classes/hub.h>
    42 #include <usb_iface.h>
     43#include <usb/port.h>
    4344
    4445typedef struct usb_hub_dev usb_hub_dev_t;
     
    4647/** Information about single port on a hub. */
    4748typedef struct {
     49        usb_port_t base;
     50        /* Parenting hub */
     51        usb_hub_dev_t *hub;
    4852        /** Port number as reported in descriptors. */
    4953        unsigned int port_number;
    50         /** Device communication pipe. */
    51         usb_pipe_t *control_pipe;
    52         /** Mutex needed not only by CV for checking port reset. */
    53         fibril_mutex_t mutex;
    54         /** CV for waiting to port reset completion. */
    55         fibril_condvar_t reset_cv;
    56         /** Port reset status.
    57          * Guarded by @c reset_mutex.
    58          */
    59         enum {
    60                 NO_RESET,
    61                 IN_RESET,
    62                 RESET_OK,
    63                 RESET_FAIL,
    64         } reset_status;
    65         /** Device reported to USB bus driver */
    66         bool device_attached;
     54        /** Speed at the time of enabling the port */
     55        usb_speed_t speed;
    6756} usb_hub_port_t;
    6857
    69 /** Initialize hub port information.
    70  *
    71  * @param port Port to be initialized.
    72  */
    73 static inline void usb_hub_port_init(usb_hub_port_t *port,
    74     unsigned int port_number, usb_pipe_t *control_pipe)
    75 {
    76         assert(port);
    77         port->port_number = port_number;
    78         port->control_pipe = control_pipe;
    79         port->reset_status = NO_RESET;
    80         port->device_attached = false;
    81         fibril_mutex_initialize(&port->mutex);
    82         fibril_condvar_initialize(&port->reset_cv);
    83 }
     58void usb_hub_port_init(usb_hub_port_t *, usb_hub_dev_t *, unsigned int);
    8459
    85 errno_t usb_hub_port_fini(usb_hub_port_t *port, usb_hub_dev_t *hub);
    86 errno_t usb_hub_port_clear_feature(
    87     usb_hub_port_t *port, usb_hub_class_feature_t feature);
    88 errno_t usb_hub_port_set_feature(
    89     usb_hub_port_t *port, usb_hub_class_feature_t feature);
    90 void usb_hub_port_reset_fail(usb_hub_port_t *port);
    91 void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_dev_t *hub);
     60void usb_hub_port_process_interrupt(usb_hub_port_t *port);
    9261
    9362#endif
Note: See TracChangeset for help on using the changeset viewer.