Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset effbef3 in mainline


Ignore:
Timestamp:
2018-01-22T15:42:45Z (2 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
master
Children:
9f685aa
Parents:
998773d
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-22 15:41:58)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-22 15:42:45)
Message:

usbhub: work also with MTT hubs (in Single-TT configuration)

File:
1 edited

Legend:

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

    r998773d reffbef3  
    6868        .interface_class = USB_CLASS_HUB,
    6969        .interface_subclass = 0,
    70         .interface_protocol = 0,
     70        .interface_protocol = -1,
    7171        .flags = 0
    7272};
     
    423423        /* Set configuration. Use the configuration that was in
    424424         * usb_device->descriptors.configuration i.e. The first one. */
    425         const int opResult = usb_request_set_configuration(
     425        int opResult = usb_request_set_configuration(
    426426            usb_device_get_default_pipe(usb_device),
    427427            config_descriptor->configuration_number);
     
    432432                usb_log_debug("\tUsed configuration %d",
    433433                    config_descriptor->configuration_number);
     434        }
     435
     436        /* Check if this is a MTT hub */
     437        const size_t device_protocol =
     438            usb_device_descriptors(usb_device)->device.device_protocol;
     439        if (device_protocol == 2) {
     440                usb_log_debug("This is a MTT hub. MTT not supported, switching to Single-TT.");
     441                opResult = usb_request_set_interface(usb_device_get_default_pipe(usb_device), 1, 0);
     442                if (opResult != EOK)
     443                        usb_log_error("Failed to switch to Single-TT protocol.");
    434444        }
    435445        return opResult;
Note: See TracChangeset for help on using the changeset viewer.