Ignore:
File:
1 edited

Legend:

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

    r58563585 r9d58539  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
    29 
    3029/** @addtogroup drvusbhub
    3130 * @{
     
    3433 * Hub ports related functions.
    3534 */
    36 
    3735#ifndef DRV_USBHUB_PORT_H
    3836#define DRV_USBHUB_PORT_H
    3937
    4038#include <usb/dev/driver.h>
     39#include <usb/dev/hub.h>
    4140#include <usb/classes/hub.h>
    42 #include <usb_iface.h>
    4341
    4442typedef struct usb_hub_dev usb_hub_dev_t;
     
    4644/** Information about single port on a hub. */
    4745typedef struct {
    48         /** Port number as reported in descriptors. */
    49         unsigned int port_number;
     46        /* Port number as reported in descriptors. */
     47        size_t port_number;
    5048        /** Device communication pipe. */
    5149        usb_pipe_t *control_pipe;
     
    5452        /** CV for waiting to port reset completion. */
    5553        fibril_condvar_t reset_cv;
    56         /** Port reset status.
     54        /** Whether port reset is completed.
    5755         * Guarded by @c reset_mutex.
    5856         */
    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;
     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;
    6763} usb_hub_port_t;
    6864
     
    7167 * @param port Port to be initialized.
    7268 */
    73 static inline void usb_hub_port_init(usb_hub_port_t *port,
    74     unsigned int port_number, usb_pipe_t *control_pipe)
     69static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,
     70    usb_pipe_t *control_pipe)
    7571{
    7672        assert(port);
     73        port->attached_device.address = -1;
     74        port->attached_device.fun = NULL;
    7775        port->port_number = port_number;
    7876        port->control_pipe = control_pipe;
    79         port->reset_status = NO_RESET;
    80         port->device_attached = false;
    8177        fibril_mutex_initialize(&port->mutex);
    8278        fibril_condvar_initialize(&port->reset_cv);
    8379}
    84 
    8580int usb_hub_port_fini(usb_hub_port_t *port, usb_hub_dev_t *hub);
    8681int usb_hub_port_clear_feature(
     
    9287
    9388#endif
    94 
    9589/**
    9690 * @}
Note: See TracChangeset for help on using the changeset viewer.