Changes in uspace/drv/uhci-rhd/port.c [11349a85:4125b7d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/port.c
r11349a85 r4125b7d 32 32 * @brief UHCI root hub port routines 33 33 */ 34 #include <libarch/ddi.h> /* pio_read and pio_write */ 35 #include <fibril_synch.h> /* async_usleep */ 34 #include <libarch/ddi.h> /* pio_read and pio_write */ 36 35 #include <errno.h> 37 36 #include <str_error.h> 37 #include <fibril_synch.h> 38 38 39 39 #include <usb/usb.h> /* usb_address_t */ 40 #include <usb/hub.h> /* usb_hc_new_device_wrapper */40 #include <usb/hub.h> 41 41 #include <usb/debug.h> 42 42 … … 212 212 213 213 /* 214 * Resets from root ports should be nominally 50ms (USB spec 7.1.7.3) 214 * The host then waits for at least 100 ms to allow completion of 215 * an insertion process and for power at the device to become stable. 216 */ 217 async_usleep(100000); 218 219 /* 220 * Resets from root ports should be nominally 50ms 215 221 */ 216 222 { … … 223 229 port_status &= ~STATUS_IN_RESET; 224 230 uhci_port_write_status(port, port_status); 225 while (uhci_port_read_status(port) & STATUS_IN_RESET);226 // TODO: find a better way to waste time (it should be less than227 // 10ms, if we reschedule it takes too much time (random 228 // interrupts can be solved by multiple attempts).229 usb_log_debug2("%s: Reset Signal stop.\n", port->id_string);230 } 231 usb_log_debug("%s: Reset Signal stop.\n", port->id_string); 232 } 233 234 /* the reset recovery time 10ms */ 235 async_usleep(10000); 236 231 237 /* Enable the port. */ 232 238 uhci_port_set_enabled(port, true); 233 234 /* Reset recovery period,235 * devices do not have to respond during this period236 */237 async_usleep(10000);238 239 return EOK; 239 240 } … … 254 255 usb_log_debug("%s: Detected new device.\n", port->id_string); 255 256 256 int ret, count = 0;257 257 usb_address_t dev_addr; 258 do { 259 ret = usb_hc_new_device_wrapper(port->rh, &port->hc_connection, 260 speed, uhci_port_reset_enable, port->number, port, 261 &dev_addr, &port->attached_device, NULL, NULL, NULL); 262 } while (ret != EOK && ++count < 4); 258 int ret = usb_hc_new_device_wrapper(port->rh, &port->hc_connection, 259 speed, uhci_port_reset_enable, port->number, port, 260 &dev_addr, &port->attached_device, NULL, NULL, NULL); 263 261 264 262 if (ret != EOK) { … … 315 313 /* Wait for port to become enabled */ 316 314 do { 315 async_usleep(1000); 317 316 port_status = uhci_port_read_status(port); 318 317 } while ((port_status & STATUS_CONNECTED) &&
Note:
See TracChangeset
for help on using the changeset viewer.