Changeset ddbd088 in mainline for uspace/drv/bus/usb/ehci/ehci_rh.c
- Timestamp:
- 2018-01-29T15:13:13Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ee0ffa6
- Parents:
- 1bab1c8
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-29 15:13:10)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-29 15:13:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_rh.c
r1bab1c8 rddbd088 100 100 */ 101 101 int ehci_rh_init(ehci_rh_t *instance, ehci_caps_regs_t *caps, ehci_regs_t *regs, 102 const char *name)102 fibril_mutex_t *guard, const char *name) 103 103 { 104 104 assert(instance); … … 127 127 128 128 ehci_rh_hub_desc_init(instance, EHCI_RD(caps->hcsparams)); 129 instance->guard = guard; 129 130 instance->status_change_endpoint = NULL; 130 131 … … 152 153 153 154 /* Lock the HC guard */ 154 fibril_mutex_lock( batch->ep->guard);155 fibril_mutex_lock(instance->guard); 155 156 const int err = endpoint_activate_locked(batch->ep, batch); 156 157 if (err) { … … 167 168 endpoint_add_ref(batch->ep); 168 169 instance->status_change_endpoint = batch->ep; 169 fibril_mutex_unlock( batch->ep->guard);170 fibril_mutex_unlock(instance->guard); 170 171 } else { 171 172 usb_log_debug("RH(%p): BATCH(%p) virtual request complete: %s", … … 185 186 int ehci_rh_interrupt(ehci_rh_t *instance) 186 187 { 188 fibril_mutex_lock(instance->guard); 187 189 endpoint_t *ep = instance->status_change_endpoint; 188 if (!ep) 189 return EOK; 190 191 fibril_mutex_lock(ep->guard); 190 if (!ep) { 191 fibril_mutex_unlock(instance->guard); 192 return EOK; 193 } 194 192 195 usb_transfer_batch_t * const batch = ep->active_batch; 193 196 endpoint_deactivate_locked(ep); 194 197 instance->status_change_endpoint = NULL; 195 fibril_mutex_unlock( ep->guard);198 fibril_mutex_unlock(instance->guard); 196 199 197 200 endpoint_del_ref(ep);
Note:
See TracChangeset
for help on using the changeset viewer.