Changeset 56257ba in mainline for uspace/lib/usbhost/src/endpoint.c
- Timestamp:
- 2018-01-07T01:01:42Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63431db2
- Parents:
- 9efad54
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:41)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
r9efad54 r56257ba 108 108 } 109 109 110 static void endpoint_toggle_reset(endpoint_t *ep, toggle_reset_mode_t mode); 111 110 112 /** Mark the endpoint as active and block access for further fibrils. 111 113 * @param ep endpoint_t structure. … … 132 134 133 135 if (ep->active_batch && ep->active_batch->error == EOK) 134 usb_transfer_batch_reset_toggle(ep->active_batch);136 endpoint_toggle_reset(ep, ep->active_batch->toggle_reset_mode); 135 137 136 138 ep->active_batch = NULL; … … 155 157 } 156 158 157 /** Get the value of toggle bit. Either uses the toggle_get op, or just returns 158 * the value of the toggle. 159 * @param ep endpoint_t structure. 160 */ 161 int endpoint_toggle_get(endpoint_t *ep) 162 { 163 assert(ep); 164 165 const bus_ops_t *ops = BUS_OPS_LOOKUP(get_bus_ops(ep), endpoint_get_toggle); 166 return ops 167 ? ops->endpoint_get_toggle(ep) 168 : ep->toggle; 169 } 170 171 /** Set the value of toggle bit. Either uses the toggle_set op, or just sets 172 * the toggle inside. 173 * @param ep endpoint_t structure. 174 */ 175 void endpoint_toggle_set(endpoint_t *ep, bool toggle) 176 { 177 assert(ep); 178 179 const bus_ops_t *ops = BUS_OPS_LOOKUP(get_bus_ops(ep), endpoint_set_toggle); 180 if (ops) { 181 ops->endpoint_set_toggle(ep, toggle); 182 } 183 else { 184 ep->toggle = toggle; 159 static void endpoint_toggle_reset(endpoint_t *ep, toggle_reset_mode_t mode) 160 { 161 assert(ep); 162 163 if (mode == RESET_NONE) 164 return; 165 166 const bus_ops_t *ops = BUS_OPS_LOOKUP(get_bus_ops(ep), endpoint_toggle_reset); 167 if (!ops) 168 return; 169 170 device_t *dev = ep->device; 171 172 if (mode == RESET_ALL) { 173 for (usb_endpoint_t i = 0; i < USB_ENDPOINT_MAX; ++i) { 174 if (dev->endpoints[i]) 175 ops->endpoint_toggle_reset(dev->endpoints[i]); 176 } 177 } else { 178 ops->endpoint_toggle_reset(ep); 185 179 } 186 180 }
Note:
See TracChangeset
for help on using the changeset viewer.