Changeset 9efad54 in mainline for uspace/drv/bus/usb/xhci/bus.c


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/drv/bus/usb/xhci/bus.c

    rc901632 r9efad54  
    5151
    5252/** Initial descriptor used for control endpoint 0 before more configuration is retrieved. */
    53 static const usb_endpoint_desc_t ep0_initial_desc = {
    54         .endpoint_no = 0,
    55         .direction = USB_DIRECTION_BOTH,
    56         .transfer_type = USB_TRANSFER_CONTROL,
    57         .max_packet_size = CTRL_PIPE_MIN_PACKET_SIZE,
    58         .packets = 1,
     53static const usb_endpoint_descriptors_t ep0_initial_desc = {
     54        .endpoint.max_packet_size = CTRL_PIPE_MIN_PACKET_SIZE,
    5955};
    6056
    61 static endpoint_t *endpoint_create(device_t *, const usb_endpoint_desc_t *);
     57static endpoint_t *endpoint_create(device_t *, const usb_endpoint_descriptors_t *);
    6258
    6359/** Assign address and control endpoint to a new XHCI device.
     
    368364}
    369365
    370 static endpoint_t *endpoint_create(device_t *dev, const usb_endpoint_desc_t *desc)
     366static endpoint_t *endpoint_create(device_t *dev, const usb_endpoint_descriptors_t *desc)
    371367{
    372368        xhci_endpoint_t *ep = calloc(1, sizeof(xhci_endpoint_t));
Note: See TracChangeset for help on using the changeset viewer.