Changeset b77931d in mainline for uspace/lib/usbdev/src/pipesinit.c


Ignore:
Timestamp:
2011-11-05T16:08:01Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d176b1d
Parents:
ab27e01
Message:

usb: usb_pipe_t was always allocated in usb_endpoint_mapping_t, embed it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/pipesinit.c

    rab27e01 rb77931d  
    192192        }
    193193
    194         if (ep_mapping->pipe == NULL) {
    195                 return EBADMEM;
    196         }
    197194        if (ep_mapping->present) {
    198195                return EEXISTS;
    199196        }
    200197
    201         int rc = usb_pipe_initialize(ep_mapping->pipe, wire,
     198        int rc = usb_pipe_initialize(&ep_mapping->pipe, wire,
    202199            ep_no, description.transfer_type, endpoint->max_packet_size,
    203200            description.direction);
     
    254251 *
    255252 * The mapping array is expected to conform to following rules:
    256  * - @c pipe must point to already allocated structure with uninitialized pipe
     253 * - @c pipe must be uninitialized pipe
    257254 * - @c description must point to prepared endpoint description
    258255 * - @c descriptor does not need to be initialized (will be overwritten)
     
    297294        }
    298295
    299         /*
    300          * Go through the mapping and set all endpoints to not present.
    301          */
    302         size_t i;
    303         for (i = 0; i < mapping_count; i++) {
     296        /* Go through the mapping and set all endpoints to not present. */
     297        for (size_t i = 0; i < mapping_count; i++) {
    304298                mapping[i].present = false;
    305299                mapping[i].descriptor = NULL;
     
    307301        }
    308302
    309         /*
    310          * Prepare the descriptor parser.
    311          */
     303        /* Prepare the descriptor parser. */
    312304        const usb_dp_parser_t dp_parser = {
    313305                .nesting = descriptor_nesting
Note: See TracChangeset for help on using the changeset viewer.