Ignore:
File:
1 edited

Legend:

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

    r1cf26ab r58563585  
    3434 *
    3535 */
    36 #include <usb/usb.h>
    3736#include <usb/dev/pipes.h>
    3837#include <usb/dev/dp.h>
    3938#include <usb/dev/request.h>
     39#include <usb/usb.h>
     40#include <usb/descriptor.h>
     41
     42#include <assert.h>
    4043#include <errno.h>
    41 #include <assert.h>
    4244
    4345#define DEV_DESCR_MAX_PACKET_SIZE_OFFSET 7
     
    148150 * @param interface Interface descriptor under which belongs the @p endpoint.
    149151 * @param endpoint Endpoint descriptor.
    150  * @param wire Connection backing the endpoint pipes.
    151152 * @return Error code.
    152153 */
     
    155156    usb_standard_interface_descriptor_t *interface,
    156157    usb_standard_endpoint_descriptor_t *endpoint_desc,
    157     usb_device_connection_t *wire)
     158    usb_dev_session_t *bus_session)
    158159{
    159160
     
    193194        }
    194195
    195         int rc = usb_pipe_initialize(&ep_mapping->pipe, wire,
     196        int rc = usb_pipe_initialize(&ep_mapping->pipe,
    196197            ep_no, description.transfer_type,
    197             uint16_usb2host(endpoint_desc->max_packet_size),
    198             description.direction);
     198            ED_MPS_PACKET_SIZE_GET(
     199                uint16_usb2host(endpoint_desc->max_packet_size)),
     200            description.direction,
     201            ED_MPS_TRANS_OPPORTUNITIES_GET(
     202                uint16_usb2host(endpoint_desc->max_packet_size)), bus_session);
    199203        if (rc != EOK) {
    200204                return rc;
     
    220224    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    221225    const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data,
    222     const uint8_t *interface_descriptor)
     226    const uint8_t *interface_descriptor, usb_dev_session_t *bus_session)
    223227{
    224228        const uint8_t *descriptor = usb_dp_get_nested_descriptor(parser,
     
    236240                            (usb_standard_endpoint_descriptor_t *)
    237241                                descriptor,
    238                             (usb_device_connection_t *) parser_data->arg);
     242                            bus_session);
    239243                }
    240244
     
    280284    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    281285    const uint8_t *config_descriptor, size_t config_descriptor_size,
    282     usb_device_connection_t *connection)
    283 {
    284         assert(connection);
    285 
    286         if (config_descriptor == NULL) {
     286    usb_dev_session_t *bus_session)
     287{
     288        if (config_descriptor == NULL)
    287289                return EBADMEM;
    288         }
    289         if (config_descriptor_size
    290             < sizeof(usb_standard_configuration_descriptor_t)) {
     290       
     291        if (config_descriptor_size <
     292            sizeof(usb_standard_configuration_descriptor_t)) {
    291293                return ERANGE;
    292294        }
     
    306308                .data = config_descriptor,
    307309                .size = config_descriptor_size,
    308                 .arg = connection
    309310        };
    310311
     
    319320        do {
    320321                (void) process_interface(mapping, mapping_count,
    321                     &dp_parser, &dp_data, interface);
     322                    &dp_parser, &dp_data, interface, bus_session);
    322323                interface = usb_dp_get_sibling_descriptor(&dp_parser, &dp_data,
    323324                    config_descriptor, interface);
     
    347348                return EINVAL;
    348349        }
    349 
    350 
    351         usb_pipe_start_long_transfer(pipe);
    352350
    353351        uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE];
     
    367365                }
    368366        }
    369         usb_pipe_end_long_transfer(pipe);
    370367        if (rc != EOK) {
    371368                return rc;
Note: See TracChangeset for help on using the changeset viewer.