Changeset c6f82e5 in mainline for uspace/lib/usbhost/src/endpoint.c
- Timestamp:
- 2018-01-19T20:56:14Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7ec7b7e
- Parents:
- 69b2dfee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
r69b2dfee rc6f82e5 121 121 } 122 122 123 static void endpoint_toggle_reset(endpoint_t *ep, toggle_reset_mode_t mode);124 125 123 /** 126 124 * Wait until the endpoint have no transfer scheduled. … … 166 164 assert(ep); 167 165 assert(fibril_mutex_is_locked(&ep->guard)); 168 169 if (ep->active_batch && ep->active_batch->error == EOK)170 endpoint_toggle_reset(ep, ep->active_batch->toggle_reset_mode);171 172 166 ep->active_batch = NULL; 173 167 fibril_condvar_signal(&ep->avail); 174 }175 176 /**177 * The transfer on an endpoint can trigger a reset of the toggle bit. This178 * function calls the respective bus callbacks to resolve it.179 *180 * @param ep The endpoint that triggered the reset181 * @param mode Whether to reset no, one or all endpoints on a device.182 */183 static void endpoint_toggle_reset(endpoint_t *ep, toggle_reset_mode_t mode)184 {185 assert(ep);186 187 if (mode == RESET_NONE)188 return;189 190 const bus_ops_t *ops = BUS_OPS_LOOKUP(get_bus_ops(ep), endpoint_toggle_reset);191 if (!ops)192 return;193 194 195 if (mode == RESET_ALL) {196 const device_t *dev = ep->device;197 for (usb_endpoint_t i = 0; i < USB_ENDPOINT_MAX; ++i) {198 if (dev->endpoints[i])199 ops->endpoint_toggle_reset(dev->endpoints[i]);200 }201 } else {202 ops->endpoint_toggle_reset(ep);203 }204 168 } 205 169 … … 282 246 batch->on_complete_data = arg; 283 247 284 /* Check for commands that reset toggle bit */285 if (ep->transfer_type == USB_TRANSFER_CONTROL)286 batch->toggle_reset_mode287 = hc_get_request_toggle_reset_mode(&batch->setup.packet);288 289 248 const int ret = ops->batch_schedule(batch); 290 249 if (ret != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.