Changes in uspace/lib/usb/src/host/device_keeper.c [049eb87:ffc63b0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/host/device_keeper.c
r049eb87 rffc63b0 264 264 return instance->devices[address].speed; 265 265 } 266 /*----------------------------------------------------------------------------*/267 void usb_device_keeper_use_control(268 usb_device_keeper_t *instance, usb_target_t target)269 {270 assert(instance);271 const uint16_t ep = 1 << target.endpoint;272 fibril_mutex_lock(&instance->guard);273 while (instance->devices[target.address].control_used & ep) {274 fibril_condvar_wait(&instance->change, &instance->guard);275 }276 instance->devices[target.address].control_used |= ep;277 fibril_mutex_unlock(&instance->guard);278 }279 /*----------------------------------------------------------------------------*/280 void usb_device_keeper_release_control(281 usb_device_keeper_t *instance, usb_target_t target)282 {283 assert(instance);284 const uint16_t ep = 1 << target.endpoint;285 fibril_mutex_lock(&instance->guard);286 assert((instance->devices[target.address].control_used & ep) != 0);287 instance->devices[target.address].control_used &= ~ep;288 fibril_mutex_unlock(&instance->guard);289 fibril_condvar_signal(&instance->change);290 }291 266 /** 292 267 * @}
Note:
See TracChangeset
for help on using the changeset viewer.