Changeset 442fa6b in mainline for uspace/drv/bus/usb/usbhub/usbhub.c
- Timestamp:
- 2011-09-23T14:17:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3b617579
- Parents:
- c0587d90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
rc0587d90 r442fa6b 187 187 const bool change = (change_bitmap[port / 8] >> (port % 8)) & 1; 188 188 if (change) { 189 usb_hub_p rocess_port_interrupt(hub, port);189 usb_hub_port_process_interrupt(hub, port); 190 190 } 191 191 } … … 217 217 info->ports = NULL; 218 218 info->port_count = -1; 219 fibril_mutex_initialize(&info->port_mutex);220 219 fibril_mutex_initialize(&info->pending_ops_mutex); 221 220 fibril_condvar_initialize(&info->pending_ops_cv); … … 289 288 for (port = 1; port <= hub_info->port_count; ++port) { 290 289 usb_log_debug("Powering port %zu.\n", port); 291 opResult = usb_hub_ set_port_feature(290 opResult = usb_hub_port_set_feature( 292 291 &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER); 293 292 if (opResult != EOK) { … … 365 364 * switch them all off to prevent damage. */ 366 365 //TODO Consider ganged power switching here. 366 //TODO Hub should have turned the ports off already, 367 //this is redundant. 367 368 size_t port; 368 369 for (port = 1; port <= hub_info->port_count; ++port) { 369 const int opResult = usb_hub_ clear_port_feature(370 const int opResult = usb_hub_port_clear_feature( 370 371 &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER); 371 372 if (opResult != EOK) { … … 381 382 size_t port; 382 383 for (port = 1; port <= hub_info->port_count; ++port) { 383 const int opResult = usb_hub_ set_port_feature(384 const int opResult = usb_hub_port_set_feature( 384 385 &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER); 385 386 if (opResult != EOK) { … … 478 479 */ 479 480 if (hub->pending_ops_count > 0) { 480 fibril_mutex_lock(&hub->port_mutex);481 481 size_t port; 482 482 for (port = 0; port < hub->port_count; port++) { 483 usb_hub_port_t *the_port = hub->ports + port; 484 fibril_mutex_lock(&the_port->reset_mutex); 485 the_port->reset_completed = true; 486 the_port->reset_okay = false; 487 fibril_condvar_broadcast(&the_port->reset_cv); 488 fibril_mutex_unlock(&the_port->reset_mutex); 483 usb_hub_port_reset_fail(&hub->ports[port]); 489 484 } 490 fibril_mutex_unlock(&hub->port_mutex);491 485 } 492 486 /* And now wait for them. */
Note:
See TracChangeset
for help on using the changeset viewer.