Changeset 7ce0fe3 in mainline for uspace/drv/uhci-rhd/port.c
- Timestamp:
- 2011-02-01T22:02:23Z (12 years ago)
- Branches:
- lfn, master, serial
- Children:
- afcd86e
- Parents:
- 993a1e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/port.c
r993a1e1 r7ce0fe3 1 1 2 2 #include <errno.h> 3 3 4 #include <usb/usb.h> /* usb_address_t */ 4 5 #include <usb/usbdrv.h> /* usb_drv_* */ 6 #include <usb/debug.h> 5 7 6 #include "debug.h"7 8 #include "port.h" 8 9 #include "port_status.h" … … 27 28 port->checker = fibril_create(uhci_port_check, port); 28 29 if (port->checker == 0) { 29 u hci_print_error(": failed to launch root hub fibril.");30 usb_log_error(": failed to launch root hub fibril."); 30 31 return ENOMEM; 31 32 } 32 33 fibril_add_ready(port->checker); 33 u hci_print_verbose(34 usb_log_debug( 34 35 "Added fibril for port %d: %p.\n", number, port->checker); 35 36 return EOK; … … 49 50 50 51 while (1) { 51 u hci_print_verbose("Port(%d) status address %p:\n",52 usb_log_debug("Port(%d) status address %p:\n", 52 53 port_instance->number, port_instance->address); 53 54 … … 57 58 58 59 /* debug print */ 59 u hci_print_info("Port(%d) status %#.4x\n",60 usb_log_info("Port(%d) status %#.4x\n", 60 61 port_instance->number, port_status); 61 62 print_port_status(port_status); … … 79 80 assert(port->hc_phone); 80 81 81 u hci_print_info("Adding new device on port %d.\n", port->number);82 usb_log_info("Adding new device on port %d.\n", port->number); 82 83 83 84 … … 85 86 int ret = usb_drv_reserve_default_address(port->hc_phone); 86 87 if (ret != EOK) { 87 u hci_print_error("Failed to reserve default address.\n");88 usb_log_error("Failed to reserve default address.\n"); 88 89 return ret; 89 90 } … … 92 93 93 94 if (usb_address <= 0) { 94 u hci_print_error("Recieved invalid address(%d).\n", usb_address);95 usb_log_error("Recieved invalid address(%d).\n", usb_address); 95 96 return usb_address; 96 97 } … … 122 123 123 124 if (ret != EOK) { /* address assigning went wrong */ 124 u hci_print_error("Failed(%d) to assign address to the device.\n", ret);125 usb_log_error("Failed(%d) to assign address to the device.\n", ret); 125 126 uhci_port_set_enabled(port, false); 126 127 int release = usb_drv_release_default_address(port->hc_phone); 127 128 if (release != EOK) { 128 u hci_print_fatal("Failed to release default address.\n");129 usb_log_error("Failed to release default address.\n"); 129 130 return release; 130 131 } … … 135 136 ret = usb_drv_release_default_address(port->hc_phone); 136 137 if (ret != EOK) { 137 u hci_print_fatal("Failed to release default address.\n");138 usb_log_error("Failed to release default address.\n"); 138 139 return ret; 139 140 } … … 146 147 147 148 if (ret != EOK) { /* something went wrong */ 148 u hci_print_error("Failed(%d) in usb_drv_register_child.\n", ret);149 usb_log_error("Failed(%d) in usb_drv_register_child.\n", ret); 149 150 uhci_port_set_enabled(port, false); 150 151 return ENOMEM; 151 152 } 152 u hci_print_info("Sucessfully added device on port(%d) address(%d).\n",153 usb_log_info("Sucessfully added device on port(%d) address(%d).\n", 153 154 port->number, usb_address); 154 155 … … 160 161 static int uhci_port_remove_device(uhci_port_t *port) 161 162 { 162 u hci_print_error("Don't know how to remove device %#x.\n",163 usb_log_error("Don't know how to remove device %#x.\n", 163 164 (unsigned int)port->attached_device); 164 165 uhci_port_set_enabled(port, false); … … 182 183 port_status_write(port->address, port_status); 183 184 184 u hci_print_info("%s port %d.\n",185 usb_log_info("%s port %d.\n", 185 186 enabled ? "Enabled" : "Disabled", port->number); 186 187 return EOK;
Note: See TracChangeset
for help on using the changeset viewer.