Changeset feeac0d in mainline for uspace/lib/usbhost/src/usb_endpoint_manager.c
- Timestamp:
- 2013-09-10T16:32:35Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4982d87
- Parents:
- e8d6ce2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_endpoint_manager.c
re8d6ce2 rfeeac0d 90 90 if (address < 0) 91 91 return NULL; 92 list_foreach(*get_list(instance, address), iterator) { 93 endpoint_t *ep = endpoint_get_instance(iterator); 92 list_foreach(*get_list(instance, address), link, endpoint_t, ep) { 94 93 if (ep_match(ep, address, endpoint, direction)) 95 94 return ep; … … 196 195 fibril_mutex_lock(&instance->guard); 197 196 /* endpoint number is < 16, thus first byte is enough */ 198 list_foreach(*get_list(instance, target.address), it) {199 endpoint_t *ep = endpoint_get_instance(it);197 list_foreach(*get_list(instance, target.address), 198 link, endpoint_t, ep) { 200 199 if ((ep->address == target.address) 201 200 && (ep->endpoint = data[4])) { … … 216 215 if ((data[0] & 0xf) == 0) { 217 216 fibril_mutex_lock(&instance->guard); 218 list_foreach(*get_list(instance, target.address), it) {219 endpoint_t *ep = endpoint_get_instance(it);217 list_foreach(*get_list(instance, target.address), 218 link, endpoint_t, ep) { 220 219 if (ep->address == target.address) { 221 220 endpoint_toggle_set(ep,0); … … 408 407 usb_address_t address, void (*callback)(endpoint_t *, void *), void *arg) 409 408 { 409 list_t *list; 410 link_t *link; 411 link_t *next; 412 410 413 assert(address >= 0); 411 414 assert(instance); 412 415 fibril_mutex_lock(&instance->guard); 413 list_foreach(*get_list(instance, address), iterator) { 414 endpoint_t *ep = endpoint_get_instance(iterator); 416 417 list = get_list(instance, address); 418 link = list_first(list); 419 while (link != NULL) { 420 endpoint_t *ep = list_get_instance(link, endpoint_t, link); 421 next = list_next(link, list); 422 415 423 if (ep->address == address) { 416 iterator = iterator->next;417 424 list_remove(&ep->link); 418 425 if (callback) … … 420 427 endpoint_destroy(ep); 421 428 } 429 link = next; 422 430 } 423 431 fibril_mutex_unlock(&instance->guard);
Note:
See TracChangeset
for help on using the changeset viewer.