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


Ignore:
Timestamp:
2016-07-22T08:24:47Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f76d2c2
Parents:
5b18137 (diff), 8351f9a4 (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.
Message:

Merge from lp:~jan.vesely/helenos/usb

File:
1 edited

Legend:

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

    r5b18137 rb4b534ac  
    3737
    3838#include <usb/dev/driver.h>
    39 #include <usb/dev/hub.h>
    4039#include <usb/classes/hub.h>
     40#include <usb_iface.h>
    4141
    4242typedef struct usb_hub_dev usb_hub_dev_t;
     
    4444/** Information about single port on a hub. */
    4545typedef struct {
    46         /* Port number as reported in descriptors. */
    47         size_t port_number;
     46        /** Port number as reported in descriptors. */
     47        unsigned port_number;
    4848        /** Device communication pipe. */
    4949        usb_pipe_t *control_pipe;
     
    5252        /** CV for waiting to port reset completion. */
    5353        fibril_condvar_t reset_cv;
    54         /** Whether port reset is completed.
     54        /** Port reset status.
    5555         * Guarded by @c reset_mutex.
    5656         */
    57         bool reset_completed;
    58         /** Whether to announce the port reset as successful. */
    59         bool reset_okay;
    60 
    61         /** Information about attached device. */
    62         usb_hub_attached_device_t attached_device;
     57        enum {
     58                NO_RESET,
     59                IN_RESET,
     60                RESET_OK,
     61                RESET_FAIL,
     62        } reset_status;
     63        /** Device reported to USB bus driver */
     64        bool device_attached;
    6365} usb_hub_port_t;
    6466
     
    6769 * @param port Port to be initialized.
    6870 */
    69 static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,
     71static inline void usb_hub_port_init(usb_hub_port_t *port, unsigned port_number,
    7072    usb_pipe_t *control_pipe)
    7173{
    7274        assert(port);
    73         port->attached_device.address = -1;
    74         port->attached_device.fun = NULL;
    7575        port->port_number = port_number;
    7676        port->control_pipe = control_pipe;
     77        port->reset_status = NO_RESET;
     78        port->device_attached = false;
    7779        fibril_mutex_initialize(&port->mutex);
    7880        fibril_condvar_initialize(&port->reset_cv);
Note: See TracChangeset for help on using the changeset viewer.