Changeset 94f8c363 in mainline for uspace/drv/bus/usb/usbhub/port.h


Ignore:
Timestamp:
2018-01-18T00:48:27Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9fcd73
Parents:
8ad2b0a
Message:

usbhub: extract the port state machine to the usb library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/port.h

    r8ad2b0a r94f8c363  
    3333 */
    3434/** @file
    35  * Hub port state machine.
     35 * Hub port handling.
    3636 */
    3737
     
    4141#include <usb/dev/driver.h>
    4242#include <usb/classes/hub.h>
     43#include <usb/port.h>
    4344
    4445typedef struct usb_hub_dev usb_hub_dev_t;
    4546
    46 typedef enum {
    47         PORT_DISABLED,  /* No device connected. */
    48         PORT_CONNECTED, /* A device connected, not yet initialized. */
    49         PORT_IN_RESET,  /* An initial port reset in progress. */
    50         PORT_ENABLED,   /* Port reset complete, port enabled. Device announced to the HC. */
    51         PORT_ERROR,     /* An error occured. There is still a fibril that needs to know it. */
    52 } port_state_t;
    53 
    5447/** Information about single port on a hub. */
    5548typedef struct {
     49        usb_port_t base;
    5650        /* Parenting hub */
    5751        usb_hub_dev_t *hub;
    58         /** Guarding all fields */
    59         fibril_mutex_t guard;
    60         /** Current state of the port */
    61         port_state_t state;
    62         /** A speed of the device connected (if any). Valid unless state == PORT_DISABLED. */
    63         usb_speed_t speed;
    6452        /** Port number as reported in descriptors. */
    6553        unsigned int port_number;
    66         /** CV for waiting to port reset completion. */
    67         fibril_condvar_t state_cv;
    6854} usb_hub_port_t;
    6955
    7056void usb_hub_port_init(usb_hub_port_t *, usb_hub_dev_t *, unsigned int);
    71 void usb_hub_port_fini(usb_hub_port_t *);
    7257
    73 void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_dev_t *hub);
     58void usb_hub_port_process_interrupt(usb_hub_port_t *port);
    7459
    7560#endif
Note: See TracChangeset for help on using the changeset viewer.