Changeset 73a5857 in mainline for uspace/drv/bus/usb/xhci/rh.c
- Timestamp:
- 2018-01-31T23:31:05Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 53fdf8c
- Parents:
- 2ca5a198
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.c
r2ca5a198 r73a5857 96 96 } 97 97 98 fid_t fid =fibril_create(&rh_worker, rh);99 if (! fid) {98 rh->event_worker = joinable_fibril_create(&rh_worker, rh); 99 if (!rh->event_worker) { 100 100 free(rh->ports); 101 101 return err; … … 113 113 xhci_sw_ring_init(&rh->event_ring, rh->max_ports); 114 114 115 hc->event_fibril_completion.active = true; 116 fibril_mutex_initialize(&hc->event_fibril_completion.guard); 117 fibril_condvar_initialize(&hc->event_fibril_completion.cv); 118 119 fibril_add_ready(fid); 115 joinable_fibril_start(rh->event_worker); 120 116 121 117 return EOK; … … 132 128 133 129 xhci_sw_ring_stop(&rh->event_ring); 134 135 // TODO: completion_wait 136 fibril_mutex_lock(&rh->event_fibril_completion.guard); 137 while (rh->event_fibril_completion.active) 138 fibril_condvar_wait(&rh->event_fibril_completion.cv, 139 &rh->event_fibril_completion.guard); 140 fibril_mutex_unlock(&rh->event_fibril_completion.guard); 130 joinable_fibril_join(rh->event_worker); 141 131 xhci_sw_ring_fini(&rh->event_ring); 142 132 return EOK; … … 332 322 } 333 323 334 // TODO: completion_complete 335 fibril_mutex_lock(&rh->event_fibril_completion.guard); 336 rh->event_fibril_completion.active = false; 337 fibril_condvar_broadcast(&rh->event_fibril_completion.cv); 338 fibril_mutex_unlock(&rh->event_fibril_completion.guard); 339 340 return EOK; 324 return 0; 341 325 } 342 326
Note:
See TracChangeset
for help on using the changeset viewer.