Changes in uspace/drv/usbhub/ports.c [192ba25:af6136d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/ports.c
r192ba25 raf6136d 202 202 203 203 //close address 204 if(hub->ports[port].attached_device.address >= 0){ 205 /*uncomment this code to use it when DDF allows device removal 206 opResult = usb_hc_unregister_device( 207 &hub->connection, 208 hub->attached_devs[port].address); 209 if(opResult != EOK) { 210 dprintf(USB_LOG_LEVEL_WARNING, "could not release " 211 "address of " 212 "removed device: %d", opResult); 213 } 214 hub->attached_devs[port].address = 0; 215 hub->attached_devs[port].handle = 0; 216 */ 204 205 usb_hub_port_t *the_port = hub->ports + port; 206 207 fibril_mutex_lock(&hub->port_mutex); 208 209 if (the_port->attached_device.address >= 0) { 210 usb_log_warning("Device unplug on `%s' (port %zu): " \ 211 "not implemented.\n", hub->usb_device->ddf_dev->name, 212 (size_t) port); 213 the_port->attached_device.address = -1; 214 the_port->attached_device.handle = 0; 217 215 } else { 218 216 usb_log_warning("Device removed before being registered.\n"); … … 223 221 * port reset callback from new device wrapper. 224 222 */ 225 usb_hub_port_t *the_port = hub->ports + port;226 223 fibril_mutex_lock(&the_port->reset_mutex); 227 224 the_port->reset_completed = true; … … 230 227 fibril_mutex_unlock(&the_port->reset_mutex); 231 228 } 229 230 fibril_mutex_unlock(&hub->port_mutex); 232 231 } 233 232 … … 396 395 } 397 396 397 fibril_mutex_lock(&data->hub->port_mutex); 398 398 data->hub->ports[data->port].attached_device.handle = child_handle; 399 399 data->hub->ports[data->port].attached_device.address = new_address; 400 fibril_mutex_unlock(&data->hub->port_mutex); 400 401 401 402 usb_log_info("Detected new device on `%s' (port %zu), " … … 406 407 leave: 407 408 free(arg); 409 410 fibril_mutex_lock(&data->hub->pending_ops_mutex); 411 assert(data->hub->pending_ops_count > 0); 412 data->hub->pending_ops_count--; 413 fibril_condvar_signal(&data->hub->pending_ops_cv); 414 fibril_mutex_unlock(&data->hub->pending_ops_mutex); 415 408 416 409 417 return EOK; … … 452 460 return ENOMEM; 453 461 } 462 fibril_mutex_lock(&hub->pending_ops_mutex); 463 hub->pending_ops_count++; 464 fibril_mutex_unlock(&hub->pending_ops_mutex); 454 465 fibril_add_ready(fibril); 455 466
Note:
See TracChangeset
for help on using the changeset viewer.