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


Ignore:
Timestamp:
2013-08-07T15:00:36Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
14dd4c9
Parents:
2757247
Message:

usb: Switch to using port number as device identifier.

Port number info will be needed for HS SPLIT transactions. Moreover,
it can be used to produce predictable, persistent device names.

Switch port_number from size_t to unsigned. There are max 256 ports so
even short would be enough.

File:
1 edited

Legend:

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

    r2757247 r0918382f  
    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;
     
    5858        /** Whether to announce the port reset as successful. */
    5959        bool reset_okay;
    60 
    61         usb_device_handle_t attached_handle;
    62 
     60        /** Device reported to USB bus driver */
     61        bool device_attached;
    6362} usb_hub_port_t;
    6463
     
    6766 * @param port Port to be initialized.
    6867 */
    69 static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,
     68static inline void usb_hub_port_init(usb_hub_port_t *port, unsigned port_number,
    7069    usb_pipe_t *control_pipe)
    7170{
     
    7372        port->port_number = port_number;
    7473        port->control_pipe = control_pipe;
    75         port->attached_handle = USB_DEVICE_HANDLE_INVALID;
     74        port->reset_completed = false;
     75        port->reset_okay = false;
     76        port->device_attached = false;
    7677        fibril_mutex_initialize(&port->mutex);
    7778        fibril_condvar_initialize(&port->reset_cv);
Note: See TracChangeset for help on using the changeset viewer.