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