Ignore:
File:
1 edited

Legend:

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

    r9d58539 rd93f5afb  
    148148 * @param interface Interface descriptor under which belongs the @p endpoint.
    149149 * @param endpoint Endpoint descriptor.
    150  * @param wire Connection backing the endpoint pipes.
    151150 * @return Error code.
    152151 */
     
    154153    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    155154    usb_standard_interface_descriptor_t *interface,
    156     usb_standard_endpoint_descriptor_t *endpoint,
    157     usb_device_connection_t *wire)
     155    usb_standard_endpoint_descriptor_t *endpoint_desc,
     156    usb_dev_session_t *bus_session)
    158157{
    159158
     
    163162
    164163        /* Actual endpoint number is in bits 0..3 */
    165         const usb_endpoint_t ep_no = endpoint->endpoint_address & 0x0F;
     164        const usb_endpoint_t ep_no = endpoint_desc->endpoint_address & 0x0F;
    166165
    167166        const usb_endpoint_description_t description = {
    168167                /* Endpoint direction is set by bit 7 */
    169                 .direction = (endpoint->endpoint_address & 128)
     168                .direction = (endpoint_desc->endpoint_address & 128)
    170169                    ? USB_DIRECTION_IN : USB_DIRECTION_OUT,
    171170                /* Transfer type is in bits 0..2 and
    172171                 * the enum values corresponds 1:1 */
    173                 .transfer_type = endpoint->attributes & 3,
     172                .transfer_type = endpoint_desc->attributes & 3,
    174173
    175174                /* Get interface characteristics. */
     
    193192        }
    194193
    195         int rc = usb_pipe_initialize(&ep_mapping->pipe, wire,
    196             ep_no, description.transfer_type, endpoint->max_packet_size,
    197             description.direction);
     194        int rc = usb_pipe_initialize(&ep_mapping->pipe,
     195            ep_no, description.transfer_type,
     196            uint16_usb2host(endpoint_desc->max_packet_size),
     197            description.direction, bus_session);
    198198        if (rc != EOK) {
    199199                return rc;
     
    201201
    202202        ep_mapping->present = true;
    203         ep_mapping->descriptor = endpoint;
     203        ep_mapping->descriptor = endpoint_desc;
    204204        ep_mapping->interface = interface;
    205205
     
    219219    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    220220    const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data,
    221     const uint8_t *interface_descriptor)
     221    const uint8_t *interface_descriptor, usb_dev_session_t *bus_session)
    222222{
    223223        const uint8_t *descriptor = usb_dp_get_nested_descriptor(parser,
     
    235235                            (usb_standard_endpoint_descriptor_t *)
    236236                                descriptor,
    237                             (usb_device_connection_t *) parser_data->arg);
     237                            bus_session);
    238238                }
    239239
     
    279279    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    280280    const uint8_t *config_descriptor, size_t config_descriptor_size,
    281     usb_device_connection_t *connection)
    282 {
    283         assert(connection);
     281    usb_dev_session_t *bus_session)
     282{
    284283
    285284        if (config_descriptor == NULL) {
     
    305304                .data = config_descriptor,
    306305                .size = config_descriptor_size,
    307                 .arg = connection
    308306        };
    309307
     
    318316        do {
    319317                (void) process_interface(mapping, mapping_count,
    320                     &dp_parser, &dp_data, interface);
     318                    &dp_parser, &dp_data, interface, bus_session);
    321319                interface = usb_dp_get_sibling_descriptor(&dp_parser, &dp_data,
    322320                    config_descriptor, interface);
     
    346344                return EINVAL;
    347345        }
    348 
    349 
    350         usb_pipe_start_long_transfer(pipe);
    351346
    352347        uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE];
     
    366361                }
    367362        }
    368         usb_pipe_end_long_transfer(pipe);
    369363        if (rc != EOK) {
    370364                return rc;
Note: See TracChangeset for help on using the changeset viewer.