Ignore:
Timestamp:
2013-12-25T13:05:25Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bc54126c
Parents:
f4a47e52 (diff), 6946f23 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/usb_endpoint_manager.c

    rf4a47e52 r0773396  
    9090        if (address < 0)
    9191                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) {
    9493                if (ep_match(ep, address, endpoint, direction))
    9594                        return ep;
     
    196195                        fibril_mutex_lock(&instance->guard);
    197196                        /* 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) {
    200199                                if ((ep->address == target.address)
    201200                                    && (ep->endpoint = data[4])) {
     
    216215                if ((data[0] & 0xf) == 0) {
    217216                        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) {
    220219                                if (ep->address == target.address) {
    221220                                        endpoint_toggle_set(ep,0);
     
    408407    usb_address_t address, void (*callback)(endpoint_t *, void *), void *arg)
    409408{
     409        list_t *list;
     410        link_t *link;
     411        link_t *next;
     412
    410413        assert(address >= 0);
    411414        assert(instance);
    412415        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
    415423                if (ep->address == address) {
    416                         iterator = iterator->next;
    417424                        list_remove(&ep->link);
    418425                        if (callback)
     
    420427                        endpoint_destroy(ep);
    421428                }
     429                link = next;
    422430        }
    423431        fibril_mutex_unlock(&instance->guard);
Note: See TracChangeset for help on using the changeset viewer.