Changeset 0892663a in mainline for uspace/lib/usbhost/src/endpoint.c
- Timestamp:
- 2018-01-11T04:14:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9848c77
- Parents:
- bad4a05
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 03:59:03)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 04:14:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
rbad4a05 r0892663a 124 124 125 125 /** 126 * Wait until the endpoint have no transfer scheduled. 127 */ 128 void endpoint_wait_timeout_locked(endpoint_t *ep, suseconds_t timeout) 129 { 130 assert(fibril_mutex_is_locked(&ep->guard)); 131 132 while (ep->active_batch != NULL) 133 fibril_condvar_wait_timeout(&ep->avail, &ep->guard, timeout); 134 } 135 136 /** 126 137 * Mark the endpoint as active and block access for further fibrils. If the 127 138 * endpoint is already active, it will block on ep->avail condvar. … … 138 149 assert(batch); 139 150 assert(batch->ep == ep); 140 assert(fibril_mutex_is_locked(&ep->guard)); 141 142 while (ep->active_batch != NULL) 143 fibril_condvar_wait(&ep->avail, &ep->guard); 151 152 endpoint_wait_timeout_locked(ep, 0); 144 153 ep->active_batch = batch; 145 154 } … … 160 169 ep->active_batch = NULL; 161 170 fibril_condvar_signal(&ep->avail); 162 }163 164 /**165 * Abort an active batch on endpoint, if any.166 *167 * @param[in] ep endpoint_t structure.168 */169 void endpoint_abort(endpoint_t *ep)170 {171 assert(ep);172 173 fibril_mutex_lock(&ep->guard);174 usb_transfer_batch_t *batch = ep->active_batch;175 endpoint_deactivate_locked(ep);176 fibril_mutex_unlock(&ep->guard);177 178 if (batch)179 usb_transfer_batch_abort(batch);180 171 } 181 172
Note:
See TracChangeset
for help on using the changeset viewer.