Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/pipes.h

    rae3a941 rb7fd2a0  
    11/*
    22 * Copyright (c) 2011 Vojtech Horky
    3  * Copyright (c) 2018 Ondrej Hlavaty
    43 * All rights reserved.
    54 *
     
    4544
    4645#define CTRL_PIPE_MIN_PACKET_SIZE 8
    47 
    4846/** Abstraction of a logical connection to USB device endpoint.
    49  * It contains some vital information about the pipe.
     47 * It encapsulates endpoint attributes (transfer type etc.).
    5048 * This endpoint must be bound with existing usb_device_connection_t
    5149 * (i.e. the wire to send data over).
    5250 */
    5351typedef struct {
    54         /** Pipe description received from HC */
    55         usb_pipe_desc_t desc;
     52        /** Endpoint number. */
     53        usb_endpoint_t endpoint_no;
     54
     55        /** Endpoint transfer type. */
     56        usb_transfer_type_t transfer_type;
     57
     58        /** Endpoint direction. */
     59        usb_direction_t direction;
     60
     61        /** Maximum packet size for the endpoint. */
     62        size_t max_packet_size;
     63
     64        /** Number of packets per frame/uframe.
     65         * Only valid for HS INT and ISO transfers. All others should set to 1*/
     66        unsigned packets;
    5667
    5768        /** Whether to automatically reset halt on the endpoint.
     
    5970         */
    6071        bool auto_reset_halt;
     72
    6173        /** The connection used for sending the data. */
    6274        usb_dev_session_t *bus_session;
     
    91103        /** Found descriptor fitting the description. */
    92104        const usb_standard_endpoint_descriptor_t *descriptor;
    93         /** Relevant superspeed companion descriptor. */
    94         const usb_superspeed_endpoint_companion_descriptor_t
    95             *companion_descriptor;
    96105        /** Interface descriptor the endpoint belongs to. */
    97106        const usb_standard_interface_descriptor_t *interface;
     
    100109} usb_endpoint_mapping_t;
    101110
    102 errno_t usb_pipe_initialize(usb_pipe_t *, usb_dev_session_t *);
     111errno_t usb_pipe_initialize(usb_pipe_t *, usb_endpoint_t, usb_transfer_type_t,
     112    size_t, usb_direction_t, unsigned, usb_dev_session_t *);
    103113errno_t usb_pipe_initialize_default_control(usb_pipe_t *, usb_dev_session_t *);
    104114
     115errno_t usb_pipe_probe_default_control(usb_pipe_t *);
    105116errno_t usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
    106117    size_t, const uint8_t *, size_t, usb_dev_session_t *);
    107118
    108 errno_t usb_pipe_register(usb_pipe_t *,
    109     const usb_standard_endpoint_descriptor_t *,
    110     const usb_superspeed_endpoint_companion_descriptor_t *);
     119errno_t usb_pipe_register(usb_pipe_t *, unsigned);
    111120errno_t usb_pipe_unregister(usb_pipe_t *);
    112121
    113122errno_t usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *);
    114123errno_t usb_pipe_write(usb_pipe_t *, const void *, size_t);
    115 
    116 errno_t usb_pipe_read_dma(usb_pipe_t *, void *, void *, size_t, size_t *);
    117 errno_t usb_pipe_write_dma(usb_pipe_t *, void *, void *, size_t);
    118124
    119125errno_t usb_pipe_control_read(usb_pipe_t *, const void *, size_t,
     
    122128    const void *, size_t);
    123129
    124 void *usb_pipe_alloc_buffer(usb_pipe_t *, size_t);
    125 void usb_pipe_free_buffer(usb_pipe_t *, void *);
    126130#endif
    127131/**
Note: See TracChangeset for help on using the changeset viewer.