Changeset 4db49344 in mainline for uspace/drv/bus/usb/ehci/hc.c
- Timestamp:
- 2018-01-23T21:52:28Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3dd80f8
- Parents:
- a6afb4c
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-23 20:49:35)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-23 21:52:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/hc.c
ra6afb4c r4db49344 302 302 endpoint_t * const ep = batch->ep; 303 303 ehci_endpoint_t * const ehci_ep = ehci_endpoint_get(ep); 304 305 /* creating local reference */306 endpoint_add_ref(ep);307 308 fibril_mutex_lock(&ep->guard);309 endpoint_activate_locked(ep, batch);310 311 304 ehci_transfer_batch_t *ehci_batch = ehci_transfer_batch_get(batch); 312 const int err = ehci_transfer_batch_prepare(ehci_batch); 313 if (err) { 314 endpoint_deactivate_locked(ep); 315 fibril_mutex_unlock(&ep->guard); 316 /* dropping local reference */ 317 endpoint_del_ref(ep); 305 306 int err; 307 308 if ((err = ehci_transfer_batch_prepare(ehci_batch))) 309 return err; 310 311 fibril_mutex_lock(&hc->guard); 312 313 if ((err = endpoint_activate_locked(ep, batch))) { 314 fibril_mutex_unlock(&hc->guard); 318 315 return err; 319 316 } … … 321 318 usb_log_debug("HC(%p): Committing BATCH(%p)", hc, batch); 322 319 ehci_transfer_batch_commit(ehci_batch); 323 fibril_mutex_unlock(&ep->guard);324 320 325 321 /* Enqueue endpoint to the checked list */ 326 fibril_mutex_lock(&hc->guard);327 322 usb_log_debug2("HC(%p): Appending BATCH(%p)", hc, batch); 328 329 /* local reference -> pending list reference */330 323 list_append(&ehci_ep->pending_link, &hc->pending_endpoints); 324 331 325 fibril_mutex_unlock(&hc->guard); 332 333 326 return EOK; 334 327 } … … 368 361 = list_get_instance(current, ehci_endpoint_t, pending_link); 369 362 370 fibril_mutex_lock(&ep->base.guard);371 363 ehci_transfer_batch_t *batch 372 364 = ehci_transfer_batch_get(ep->base.active_batch); … … 376 368 endpoint_deactivate_locked(&ep->base); 377 369 list_remove(current); 378 endpoint_del_ref(&ep->base);379 370 hc_reset_toggles(&batch->base, &ehci_ep_toggle_reset); 380 371 usb_transfer_batch_finish(&batch->base); 381 372 } 382 fibril_mutex_unlock(&ep->base.guard);383 373 } 384 374 fibril_mutex_unlock(&hc->guard);
Note:
See TracChangeset
for help on using the changeset viewer.