Changeset 9efad54 in mainline for uspace/lib/drv/include/usb_iface.h


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/drv/include/usb_iface.h

    rc901632 r9efad54  
    100100} usb_target_t;
    101101
    102 /** Description of an usb endpoint.
    103  */
    104 typedef struct {
    105         unsigned max_burst;
    106         unsigned max_streams;
    107         unsigned mult;
    108         unsigned bytes_per_interval;
    109 } usb3_endpoint_desc_t;
    110 
    111 typedef struct usb_endpoint_desc {
    112         /** Endpoint number. */
    113         usb_endpoint_t endpoint_no;
    114 
    115         /** Endpoint transfer type. */
    116         usb_transfer_type_t transfer_type;
    117 
    118         /** Endpoint direction. */
    119         usb_direction_t direction;
    120 
    121         /** Maximum packet size for the endpoint. */
    122         size_t max_packet_size;
    123 
    124         /** Scheduling interval for HC. Only valid for interrupt/isoch transfer. */
    125         size_t interval;
    126 
    127         /** Number of packets per frame/uframe.
    128          * Only valid for HS INT and ISO transfers. All others should set to 1*/
    129         unsigned packets;
    130 
    131         /** Superspeed-specific information */
    132         usb3_endpoint_desc_t usb3;
    133 } usb_endpoint_desc_t;
    134 
    135 
    136102extern usb_dev_session_t *usb_dev_connect(devman_handle_t);
    137103extern usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *);
Note: See TracChangeset for help on using the changeset viewer.