Changeset 3fb5a3e in mainline for uspace/drv/usbhub/usbhub.c
- Timestamp:
- 2011-05-28T14:34:43Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- af6136d
- Parents:
- 400735e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
r400735e r3fb5a3e 72 72 static void usb_hub_process_global_interrupt(usb_hub_info_t * hub_info); 73 73 74 static void usb_hub_polling_termin ted_callback(usb_device_t * device,74 static void usb_hub_polling_terminated_callback(usb_device_t * device, 75 75 bool was_error, void * data); 76 76 … … 200 200 result->control_pipe = &usb_dev->ctrl_pipe; 201 201 result->is_default_address_used = false; 202 203 fibril_mutex_initialize(&result->pending_ops_mutex); 204 fibril_condvar_initialize(&result->pending_ops_cv); 205 result->pending_ops_count = 0; 202 206 return result; 203 207 } … … 340 344 rc = usb_device_auto_poll(hub_info->usb_device, 0, 341 345 hub_port_changes_callback, ((hub_info->port_count + 1) / 8) + 1, 342 usb_hub_polling_termin ted_callback, hub_info);346 usb_hub_polling_terminated_callback, hub_info); 343 347 if (rc != EOK) { 344 348 usb_log_error("Failed to create polling fibril: %s.\n", … … 473 477 * @param data pointer to usb_hub_info_t structure 474 478 */ 475 static void usb_hub_polling_termin ted_callback(usb_device_t * device,479 static void usb_hub_polling_terminated_callback(usb_device_t * device, 476 480 bool was_error, void * data){ 477 usb_hub_info_t * hub_info = data; 478 if(!hub_info) return; 479 free(hub_info->ports); 480 free(hub_info); 481 usb_hub_info_t * hub = data; 482 assert(hub); 483 484 fibril_mutex_lock(&hub->pending_ops_mutex); 485 while (hub->pending_ops_count > 0) { 486 fibril_condvar_wait(&hub->pending_ops_cv, 487 &hub->pending_ops_mutex); 488 } 489 fibril_mutex_unlock(&hub->pending_ops_mutex); 490 491 free(hub->ports); 492 free(hub); 481 493 } 482 494
Note:
See TracChangeset
for help on using the changeset viewer.