Changeset ee0ffa6 in mainline for uspace/drv/bus/usb/ohci/ohci_rh.c
- Timestamp:
- 2018-01-29T15:17:43Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 705f83a
- Parents:
- ddbd088
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_rh.c
rddbd088 ree0ffa6 109 109 * initializes internal virtual hub. 110 110 */ 111 int ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs, const char *name) 111 int ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs, 112 fibril_mutex_t *guard, const char *name) 112 113 { 113 114 assert(instance); … … 163 164 ohci_rh_hub_desc_init(instance); 164 165 instance->status_change_endpoint = NULL; 166 instance->guard = guard; 165 167 return virthub_base_init(&instance->base, name, &ops, instance, 166 168 NULL, &instance->hub_descriptor.header, HUB_STATUS_CHANGE_PIPE); … … 183 185 if (batch->error == ENAK) { 184 186 /* Lock the HC guard */ 185 fibril_mutex_lock( batch->ep->guard);187 fibril_mutex_lock(instance->guard); 186 188 const int err = endpoint_activate_locked(batch->ep, batch); 187 189 if (err) { … … 198 200 endpoint_add_ref(batch->ep); 199 201 instance->status_change_endpoint = batch->ep; 200 fibril_mutex_unlock( batch->ep->guard);202 fibril_mutex_unlock(instance->guard); 201 203 } else { 202 204 usb_transfer_batch_finish(batch); … … 214 216 int ohci_rh_interrupt(ohci_rh_t *instance) 215 217 { 218 fibril_mutex_lock(instance->guard); 216 219 endpoint_t *ep = instance->status_change_endpoint; 217 if (!ep) 220 if (!ep) { 221 fibril_mutex_unlock(instance->guard); 218 222 return EOK; 219 220 fibril_mutex_lock(ep->guard); 223 } 224 221 225 usb_transfer_batch_t * const batch = ep->active_batch; 222 226 endpoint_deactivate_locked(ep); 223 227 instance->status_change_endpoint = NULL; 224 fibril_mutex_unlock( ep->guard);228 fibril_mutex_unlock(instance->guard); 225 229 226 230 endpoint_del_ref(ep);
Note:
See TracChangeset
for help on using the changeset viewer.