Changeset 56db65d in mainline for uspace/drv/bus/usb/xhci/bus.c


Ignore:
Timestamp:
2017-10-24T11:06:32Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0206d35
Parents:
894f58c
Message:

usbhost: provide usb_endpoint_desc_t to bus when registering endpoint

This finishes the path of arbitrary information fetched from device all the way down to registering the endpoint in the bus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/bus.c

    r894f58c r56db65d  
    165165}
    166166
    167 static int register_endpoint(bus_t *bus_base, endpoint_t *ep)
     167static int register_endpoint(bus_t *bus_base, endpoint_t *ep, const usb_endpoint_desc_t *desc)
    168168{
    169169        xhci_bus_t *bus = bus_to_xhci_bus(bus_base);
    170170        assert(bus);
    171171
    172         usb_log_info("Endpoint(%d:%d) registered to XHCI bus.", ep->target.address, ep->target.endpoint);
     172        assert(ep->device);
     173
     174        /* Extract USB2-related information from endpoint_desc */
     175        ep->target = (usb_target_t) {{
     176                .address = ep->device->address,
     177                .endpoint = desc->endpoint_no,
     178        }};
     179        ep->direction = desc->direction;
     180        ep->transfer_type = desc->transfer_type;
     181        ep->max_packet_size = desc->max_packet_size;
     182        ep->packets = desc->packets;
    173183
    174184        xhci_device_t *xhci_dev = xhci_device_get(ep->device);
    175185        xhci_endpoint_t *xhci_ep = xhci_endpoint_get(ep);
     186
     187        xhci_ep->max_streams = desc->usb3.max_streams;
     188        xhci_ep->max_burst = desc->usb3.max_burst;
     189        // TODO add this property to usb_endpoint_desc_t and fetch it from ss companion desc
     190        xhci_ep->mult = 0;
     191
     192        usb_log_info("Endpoint(%d:%d) registered to XHCI bus.", ep->target.address, ep->target.endpoint);
    176193        return xhci_device_add_endpoint(xhci_dev, xhci_ep);
    177194}
Note: See TracChangeset for help on using the changeset viewer.