Changeset d60115a in mainline for uspace/drv/bus/usb/ohci/hc.c
- Timestamp:
- 2018-01-17T17:55:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8ad2b0a
- Parents:
- ed8575f
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-17 17:54:31)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-17 17:55:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
red8575f rd60115a 168 168 hw_res->mem_ranges.ranges[0].size); 169 169 170 list_initialize(&instance->pending_ batches);170 list_initialize(&instance->pending_endpoints); 171 171 fibril_mutex_initialize(&instance->guard); 172 172 … … 304 304 return err; 305 305 306 fibril_mutex_lock(&hc->guard); 307 list_append(&ohci_batch->link, &hc->pending_batches); 306 endpoint_t *ep = batch->ep; 307 ohci_endpoint_t * const ohci_ep = ohci_endpoint_get(ep); 308 309 /* creating local reference */ 310 endpoint_add_ref(ep); 311 312 fibril_mutex_lock(&ep->guard); 313 endpoint_activate_locked(ep, batch); 308 314 ohci_transfer_batch_commit(ohci_batch); 315 fibril_mutex_unlock(&ep->guard); 309 316 310 317 /* Control and bulk schedules need a kick to start working */ … … 320 327 break; 321 328 } 329 330 fibril_mutex_lock(&hc->guard); 331 list_append(&ohci_ep->pending_link, &hc->pending_endpoints); 322 332 fibril_mutex_unlock(&hc->guard); 333 323 334 return EOK; 324 335 } … … 353 364 OHCI_RD(hc->registers->periodic_current)); 354 365 355 link_t *current = list_first(&hc->pending_batches); 356 while (current && current != &hc->pending_batches.head) { 357 link_t *next = current->next; 358 ohci_transfer_batch_t *batch = 359 ohci_transfer_batch_from_link(current); 366 list_foreach_safe(hc->pending_endpoints, current, next) { 367 ohci_endpoint_t *ep 368 = list_get_instance(current, ohci_endpoint_t, pending_link); 369 370 fibril_mutex_lock(&ep->base.guard); 371 ohci_transfer_batch_t *batch 372 = ohci_transfer_batch_get(ep->base.active_batch); 373 assert(batch); 360 374 361 375 if (ohci_transfer_batch_check_completed(batch)) { 376 endpoint_deactivate_locked(&ep->base); 362 377 list_remove(current); 378 endpoint_del_ref(&ep->base); 363 379 usb_transfer_batch_finish(&batch->base); 364 380 } 365 366 current = next; 381 fibril_mutex_unlock(&ep->base.guard); 367 382 } 368 383 fibril_mutex_unlock(&hc->guard);
Note:
See TracChangeset
for help on using the changeset viewer.