Changeset 94f8c363 in mainline for uspace/drv/bus/usb/usbhub/port.h
- Timestamp:
- 2018-01-18T00:48:27Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a9fcd73
- Parents:
- 8ad2b0a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/port.h
r8ad2b0a r94f8c363 33 33 */ 34 34 /** @file 35 * Hub port state machine.35 * Hub port handling. 36 36 */ 37 37 … … 41 41 #include <usb/dev/driver.h> 42 42 #include <usb/classes/hub.h> 43 #include <usb/port.h> 43 44 44 45 typedef struct usb_hub_dev usb_hub_dev_t; 45 46 46 typedef enum {47 PORT_DISABLED, /* No device connected. */48 PORT_CONNECTED, /* A device connected, not yet initialized. */49 PORT_IN_RESET, /* An initial port reset in progress. */50 PORT_ENABLED, /* Port reset complete, port enabled. Device announced to the HC. */51 PORT_ERROR, /* An error occured. There is still a fibril that needs to know it. */52 } port_state_t;53 54 47 /** Information about single port on a hub. */ 55 48 typedef struct { 49 usb_port_t base; 56 50 /* Parenting hub */ 57 51 usb_hub_dev_t *hub; 58 /** Guarding all fields */59 fibril_mutex_t guard;60 /** Current state of the port */61 port_state_t state;62 /** A speed of the device connected (if any). Valid unless state == PORT_DISABLED. */63 usb_speed_t speed;64 52 /** Port number as reported in descriptors. */ 65 53 unsigned int port_number; 66 /** CV for waiting to port reset completion. */67 fibril_condvar_t state_cv;68 54 } usb_hub_port_t; 69 55 70 56 void usb_hub_port_init(usb_hub_port_t *, usb_hub_dev_t *, unsigned int); 71 void usb_hub_port_fini(usb_hub_port_t *);72 57 73 void usb_hub_port_process_interrupt(usb_hub_port_t *port , usb_hub_dev_t *hub);58 void usb_hub_port_process_interrupt(usb_hub_port_t *port); 74 59 75 60 #endif
Note:
See TracChangeset
for help on using the changeset viewer.