Changes in uspace/drv/bus/usb/usbhub/port.h [9d58539:58563585] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/port.h
r9d58539 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbhub 30 31 * @{ … … 33 34 * Hub ports related functions. 34 35 */ 36 35 37 #ifndef DRV_USBHUB_PORT_H 36 38 #define DRV_USBHUB_PORT_H 37 39 38 40 #include <usb/dev/driver.h> 39 #include <usb/dev/hub.h>40 41 #include <usb/classes/hub.h> 42 #include <usb_iface.h> 41 43 42 44 typedef struct usb_hub_dev usb_hub_dev_t; … … 44 46 /** Information about single port on a hub. */ 45 47 typedef 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; 48 50 /** Device communication pipe. */ 49 51 usb_pipe_t *control_pipe; … … 52 54 /** CV for waiting to port reset completion. */ 53 55 fibril_condvar_t reset_cv; 54 /** Whether port reset is completed.56 /** Port reset status. 55 57 * Guarded by @c reset_mutex. 56 58 */ 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; 63 67 } usb_hub_port_t; 64 68 … … 67 71 * @param port Port to be initialized. 68 72 */ 69 static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,70 u sb_pipe_t *control_pipe)73 static inline void usb_hub_port_init(usb_hub_port_t *port, 74 unsigned int port_number, usb_pipe_t *control_pipe) 71 75 { 72 76 assert(port); 73 port->attached_device.address = -1;74 port->attached_device.fun = NULL;75 77 port->port_number = port_number; 76 78 port->control_pipe = control_pipe; 79 port->reset_status = NO_RESET; 80 port->device_attached = false; 77 81 fibril_mutex_initialize(&port->mutex); 78 82 fibril_condvar_initialize(&port->reset_cv); 79 83 } 84 80 85 int usb_hub_port_fini(usb_hub_port_t *port, usb_hub_dev_t *hub); 81 86 int usb_hub_port_clear_feature( … … 87 92 88 93 #endif 94 89 95 /** 90 96 * @}
Note:
See TracChangeset
for help on using the changeset viewer.