Ignore:
Timestamp:
2018-01-06T21:15:48Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
56257ba
Parents:
c901632
Message:

usb: move endpoint descriptor parsing to HC

This better separates responsibilities. Now the device driver does not
care about the contents of an endpoint descriptor, and HC can parse the
values according to device's actual speed.

Currently, it is device driver's responsibility to fetch endpoint
descriptors, map them and register pipes - sending the endpoint
descriptor back to HC. HC then parses it, and fills the pipe
description, which then sends back to device driver. We shall probably
fetch the endpoint descriptor from inside the HC (also fixing the USB
spec violation of communication with EP0).

File:
1 edited

Legend:

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

    rc901632 r9efad54  
    3737#include <usb/usb.h>
    3838#include <usb/descriptor.h>
    39 #include <usb_iface.h>
     39#include <usbhc_iface.h>
    4040
    4141#include <stdbool.h>
     
    4444
    4545#define CTRL_PIPE_MIN_PACKET_SIZE 8
     46
    4647/** Abstraction of a logical connection to USB device endpoint.
    47  * It encapsulates endpoint attributes (transfer type etc.).
     48 * It contains some vital information about the pipe.
    4849 * This endpoint must be bound with existing usb_device_connection_t
    4950 * (i.e. the wire to send data over).
    5051 */
    5152typedef struct {
    52         /** Endpoint description */
    53         usb_endpoint_desc_t desc;
     53        /** Pipe description received from HC */
     54        usb_pipe_desc_t desc;
     55
    5456        /** Whether to automatically reset halt on the endpoint.
    5557         * Valid only for control endpoint zero.
     
    100102} usb_endpoint_mapping_t;
    101103
    102 int usb_pipe_initialize(usb_pipe_t *, usb_dev_session_t *, const usb_endpoint_desc_t *);
     104int usb_pipe_initialize(usb_pipe_t *, usb_dev_session_t *, usb_transfer_type_t);
    103105int usb_pipe_initialize_default_control(usb_pipe_t *, usb_dev_session_t *);
    104106
     
    106108    size_t, const uint8_t *, size_t, usb_dev_session_t *);
    107109
    108 int usb_pipe_register(usb_pipe_t *);
     110int usb_pipe_register(usb_pipe_t *, const usb_standard_endpoint_descriptor_t *, const usb_superspeed_endpoint_companion_descriptor_t *);
    109111int usb_pipe_unregister(usb_pipe_t *);
    110112
Note: See TracChangeset for help on using the changeset viewer.