Changeset 096a1ff in mainline
- Timestamp:
- 2011-01-28T23:54:15Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5935fe4c
- Parents:
- f0e25e8
- Location:
- uspace/drv/uhci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/debug.h
rf0e25e8 r096a1ff 60 60 usb_dprintf( NAME, DEBUG_LEVEL_VERBOSE, fmt, ##args ) 61 61 62 #define UHCI_GET_STR_FLAG(reg, flag, msg_set, msg_unset) \ 63 ((((reg) & (flag)) > 0) ? (msg_set) : (msg_unset)) 64 65 62 66 #endif 63 67 /** -
uspace/drv/uhci/root_hub/port.c
rf0e25e8 r096a1ff 1 1 2 2 #include <errno.h> 3 #include <str_error.h> 3 4 //#include <usb/devreq.h> /* for usb_device_request_setup_packet_t */ 4 5 #include <usb/usb.h> … … 22 23 23 24 while (1) { 24 uhci_print_info("Port(%d) status address %p:\n", 25 port_instance->number, port_instance->address); 26 27 /* read register value */ 25 /* Read port status. */ 28 26 port_status_t port_status = 29 27 port_status_read(port_instance->address); 30 28 31 /* debug print */ 32 uhci_print_info("Port(%d) status %#.4x:\n", 33 port_instance->number, port_status); 34 print_port_status(port_status); 29 uhci_print_info("Port %d: %04X (@ 0x%x) = " \ 30 "%s,%s,%s,%s,[%s,%s],%s,%s,%s,%s\n", 31 port_instance->number, port_status, port_instance->address, 32 UHCI_GET_STR_FLAG(port_status, STATUS_SUSPEND, "suspend", "up"), 33 UHCI_GET_STR_FLAG(port_status, STATUS_IN_RESET, "in reset", "-"), 34 UHCI_GET_STR_FLAG(port_status, STATUS_LOW_SPEED, "lowsp", "fullsp"), 35 UHCI_GET_STR_FLAG(port_status, STATUS_RESUME, "resume", "k-state"), 36 UHCI_GET_STR_FLAG(port_status, STATUS_LINE_D_MINUS, "D- on", "D- off"), 37 UHCI_GET_STR_FLAG(port_status, STATUS_LINE_D_PLUS, "D+ on", "D+ off"), 38 UHCI_GET_STR_FLAG(port_status, STATUS_ENABLED_CHANGED, "enblchg", "-"), 39 UHCI_GET_STR_FLAG(port_status, STATUS_ENABLED, "enabled", "disabled"), 40 UHCI_GET_STR_FLAG(port_status, STATUS_CONNECTED_CHANGED, "connchg", "-"), 41 UHCI_GET_STR_FLAG(port_status, STATUS_CONNECTED, "hasdev", "nodev")); 35 42 36 43 if (port_status & STATUS_CONNECTED_CHANGED) { … … 81 88 82 89 if (ret != EOK) { /* address assigning went wrong */ 83 uhci_print_error("Failed(%d) to assign address to the device.\n", ret); 90 uhci_print_error("Failed to assign address (port %d): %s.\n", 91 port->number, str_error(ret)); 84 92 uhci_port_set_enabled(port, false); 85 93 usb_address_keeping_release_default(&uhci_instance->address_manager); -
uspace/drv/uhci/uhci.c
rf0e25e8 r096a1ff 218 218 return EOK; 219 219 } 220 220 221 /*---------------------------------------------------------------------------*/ 221 222 int uhci_debug_checker(void *arg) … … 227 228 reg = pio_read_16(&instance->registers->usbcmd); 228 229 uhci_print_verbose("Command register: %X\n", reg); 230 229 231 reg = pio_read_16(&instance->registers->usbsts); 230 uhci_print_verbose("Status register: %X\n", reg); 232 uhci_print_verbose("Status register: %X (%s,%s,%s,%s,%s,%s)\n", 233 reg, 234 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_HALTED, "halted", "-"), 235 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_PROCESS_ERROR, "prerr", "-"), 236 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_SYSTEM_ERROR, "syserr", "-"), 237 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_RESUME, "res", "-"), 238 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_ERROR_INTERRUPT, "errintr", "-"), 239 UHCI_GET_STR_FLAG(reg, UHCI_STATUS_INTERRUPT, "intr", "-")); 231 240 /* 232 241 uintptr_t frame_list = pio_read_32(&instance->registers->flbaseadd); -
uspace/drv/uhci/uhci.h
rf0e25e8 r096a1ff 56 56 57 57 uint16_t usbsts; 58 #define UHCI_STATUS_HALTED (1 << 5) 59 #define UHCI_STATUS_PROCESS_ERROR (1 << 4) 60 #define UHCI_STATUS_SYSTEM_ERROR (1 << 3) 61 #define UHCI_STATUS_RESUME (1 << 2) 62 #define UHCI_STATUS_ERROR_INTERRUPT (1 << 1) 63 #define UHCI_STATUS_INTERRUPT (1 << 0) 64 58 65 uint16_t usbintr; 59 66 uint16_t frnum;
Note:
See TracChangeset
for help on using the changeset viewer.