Changeset 129b821f in mainline for uspace/lib


Ignore:
Timestamp:
2018-01-20T12:34:50Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
682c9354
Parents:
60d3f35
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-20 12:33:42)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-20 12:34:50)
Message:

usbhub: be aware of its own speed

This resulted in a bunch of changes just because the roothubs in older
HC's are virtual, and need to be aware of their own speed too.

Location:
uspace/lib
Files:
4 edited

Legend:

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

    r60d3f35 r129b821f  
    9090int usb_device_unmap_ep(usb_endpoint_mapping_t *);
    9191
     92usb_speed_t usb_device_get_speed(usb_device_t *);
    9293int usb_device_get_iface_number(usb_device_t *);
    9394devman_handle_t usb_device_get_devman_handle(usb_device_t *);
  • uspace/lib/usbdev/src/devdrv.c

    r60d3f35 r129b821f  
    364364}
    365365
     366usb_speed_t usb_device_get_speed(usb_device_t *usb_dev)
     367{
     368        assert(usb_dev);
     369        return usb_dev->speed;
     370}
     371
    366372int usb_device_get_iface_number(usb_device_t *usb_dev)
    367373{
  • uspace/lib/usbhost/include/usb/host/utility.h

    r60d3f35 r129b821f  
    4848int hc_get_ep0_max_packet_size(uint16_t *, bus_t *, device_t *);
    4949void hc_reset_toggles(const usb_transfer_batch_t *batch, endpoint_reset_toggle_t);
    50 int hc_setup_virtual_root_hub(hc_device_t *);
     50int hc_setup_virtual_root_hub(hc_device_t *, usb_speed_t);
    5151int hc_get_device_desc(device_t *, usb_standard_device_descriptor_t *);
    5252int hc_get_hub_desc(device_t *, usb_hub_descriptor_header_t *);
  • uspace/lib/usbhost/src/utility.c

    r60d3f35 r129b821f  
    177177 * @return Error code
    178178 */
    179 int hc_setup_virtual_root_hub(hc_device_t *hcd)
     179int hc_setup_virtual_root_hub(hc_device_t *hcd, usb_speed_t rh_speed)
    180180{
    181181        int err;
     
    183183        assert(hcd);
    184184
    185         device_t *dev = hcd_ddf_fun_create(hcd, USB_SPEED_MAX);
     185        device_t *dev = hcd_ddf_fun_create(hcd, rh_speed);
    186186        if (!dev) {
    187187                usb_log_error("Failed to create function for the root hub.");
Note: See TracChangeset for help on using the changeset viewer.