Changeset 8f748215 in mainline for uspace/drv/uhci/root_hub/port_status.h
- Timestamp:
- 2011-01-07T16:42:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 93fb170c
- Parents:
- 15701921
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/root_hub/port_status.h
r15701921 r8f748215 35 35 #define DRV_UHCI_TD_PORT_STATUS_H 36 36 37 #include <libarch/ddi.h> 37 38 #include <stdint.h> 38 39 39 struct port_register { 40 uint8_t connected:1; 41 uint8_t connect_change:1; 42 uint8_t enabled:1; 43 uint8_t enabled_change:1; 44 uint8_t line:2; 45 uint8_t resume:1; 46 const uint8_t always_one:1; /* reserved */ 40 typedef uint16_t port_status_t; 47 41 48 uint8_t low_speed:1; 49 uint8_t reset:1; 50 uint8_t :2; /* reserved */ 51 uint8_t suspended:1; 52 uint8_t :3; /* reserved */ 53 /* first byte */ 54 // uint8_t :3; /* reserved */ 55 // uint8_t suspended:1; 56 // uint8_t :2; /* reserved */ 57 // uint8_t reset:1; 58 // uint8_t low_speed:1; 42 enum { 43 STATUS_CONNECTED = 1 << 0, 44 STATUS_CONNECTED_CHANGED = 1 << 1, 45 STATUS_ENABLED = 1 << 2, 46 STATUS_ENABLED_CHANGED = 1 << 3, 47 STATUS_LINE_D_PLUS = 1 << 4, 48 STATUS_LINE_D_MINUS = 1 << 5, 49 STATUS_RESUME = 1 << 6, 50 STATUS_ALWAYS_ONE = 1 << 7, 59 51 60 /* second byte */ 61 // uint8_t :1; /* reserved */ 62 // uint8_t resume:1; 63 // uint8_t line:2; 64 // uint8_t enabled_change:1; 65 // uint8_t enabled:1; 66 // uint8_t connect_change:1; 67 // uint8_t connected:1; 68 } __attribute__((packed)); 52 STATUS_LOW_SPEED = 1 << 8, 53 STATUS_IN_RESET = 1 << 9, 54 STATUS_SUSPEND = 1 << 12, 55 }; 69 56 70 typedef union port_status { 71 struct port_register status; 72 uint16_t raw_value; 73 } port_status_t; 57 static inline port_status_t port_status_read(port_status_t * address) 58 { return pio_read_16(address); } 74 59 75 void print_port_status( const port_status_t *status ); 60 static inline void port_status_write( 61 port_status_t * address, port_status_t value) 62 { pio_write_16(address, value); } 63 64 void print_port_status(const port_status_t status); 76 65 #endif 77 66 /**
Note:
See TracChangeset
for help on using the changeset viewer.