Changeset 355f7c2 in mainline for uspace/srv/hw/bus/usb/hcd/virtual/hubintern.h
- Timestamp:
- 2010-10-25T07:44:02Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ca07cd3
- Parents:
- 7a7bfeb3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/usb/hcd/virtual/hubintern.h
r7a7bfeb3 r355f7c2 38 38 #include "hub.h" 39 39 40 /** Endpoint number for status change pipe. */ 40 41 #define HUB_STATUS_CHANGE_PIPE 1 42 /** Configuration value for hub configuration. */ 41 43 #define HUB_CONFIGURATION_ID 1 42 44 … … 66 68 } __attribute__ ((packed)) hub_descriptor_t; 67 69 70 /** Hub port internal state. 71 * Some states (e.g. port over current) are not covered as they are not 72 * simulated at all. 73 */ 68 74 typedef enum { 69 75 HUB_PORT_STATE_NOT_CONFIGURED, … … 78 84 } hub_port_state_t; 79 85 86 /** Convert hub port state to a char. */ 87 static inline char hub_port_state_as_char(hub_port_state_t state) { 88 switch (state) { 89 case HUB_PORT_STATE_NOT_CONFIGURED: 90 return '-'; 91 case HUB_PORT_STATE_POWERED_OFF: 92 return 'O'; 93 case HUB_PORT_STATE_DISCONNECTED: 94 return 'X'; 95 case HUB_PORT_STATE_DISABLED: 96 return 'D'; 97 case HUB_PORT_STATE_RESETTING: 98 return 'R'; 99 case HUB_PORT_STATE_ENABLED: 100 return 'E'; 101 case HUB_PORT_STATE_SUSPENDED: 102 return 'S'; 103 case HUB_PORT_STATE_RESUMING: 104 return 'F'; 105 default: 106 return '?'; 107 } 108 } 109 110 /** Hub status change mask bits. */ 80 111 typedef enum { 81 112 HUB_STATUS_C_PORT_CONNECTION = (1 << 0), … … 87 118 } hub_status_change_t; 88 119 120 /** Hub port information. */ 89 121 typedef struct { 90 122 virtdev_connection_t *device; … … 93 125 } hub_port_t; 94 126 127 /** Hub device type. */ 95 128 typedef struct { 96 129 hub_port_t ports[HUB_PORT_COUNT];
Note:
See TracChangeset
for help on using the changeset viewer.