Ignore:
File:
1 edited

Legend:

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

    r9d58539 r58563585  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup drvusbhub
    3031 * @{
     
    3334 * Hub ports related functions.
    3435 */
     36
    3537#ifndef DRV_USBHUB_PORT_H
    3638#define DRV_USBHUB_PORT_H
    3739
    3840#include <usb/dev/driver.h>
    39 #include <usb/dev/hub.h>
    4041#include <usb/classes/hub.h>
     42#include <usb_iface.h>
    4143
    4244typedef struct usb_hub_dev usb_hub_dev_t;
     
    4446/** Information about single port on a hub. */
    4547typedef struct {
    46         /* Port number as reported in descriptors. */
    47         size_t port_number;
     48        /** Port number as reported in descriptors. */
     49        unsigned int port_number;
    4850        /** Device communication pipe. */
    4951        usb_pipe_t *control_pipe;
     
    5254        /** CV for waiting to port reset completion. */
    5355        fibril_condvar_t reset_cv;
    54         /** Whether port reset is completed.
     56        /** Port reset status.
    5557         * Guarded by @c reset_mutex.
    5658         */
    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;
     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;
    6367} usb_hub_port_t;
    6468
     
    6771 * @param port Port to be initialized.
    6872 */
    69 static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,
    70     usb_pipe_t *control_pipe)
     73static inline void usb_hub_port_init(usb_hub_port_t *port,
     74    unsigned int port_number, usb_pipe_t *control_pipe)
    7175{
    7276        assert(port);
    73         port->attached_device.address = -1;
    74         port->attached_device.fun = NULL;
    7577        port->port_number = port_number;
    7678        port->control_pipe = control_pipe;
     79        port->reset_status = NO_RESET;
     80        port->device_attached = false;
    7781        fibril_mutex_initialize(&port->mutex);
    7882        fibril_condvar_initialize(&port->reset_cv);
    7983}
     84
    8085int usb_hub_port_fini(usb_hub_port_t *port, usb_hub_dev_t *hub);
    8186int usb_hub_port_clear_feature(
     
    8792
    8893#endif
     94
    8995/**
    9096 * @}
Note: See TracChangeset for help on using the changeset viewer.