usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or... 30/112830/1 accepted/tizen/common/20170214.173515 accepted/tizen/ivi/20170215.085433 accepted/tizen/mobile/20170215.085302 accepted/tizen/tv/20170215.085348 accepted/tizen/wearable/20170215.085415 submit/tizen/20170214.002758
authorTed Chen <tedchen@realtek.com>
Fri, 18 Mar 2016 07:26:52 +0000 (17:56 +1030)
committerJiho Chu <jiho.chu@samsung.com>
Fri, 3 Feb 2017 04:15:04 +0000 (13:15 +0900)
Add test into xhci_submit_control_message for usb requesttype in USB
vendor request being of standardized type. This fixes detection of
certain USB fixes, for example Ethernet, USB 3.0 port. Non standardized
requesttype in USB vendor request will be ignored.

Change-Id: Idb077cbc14ff2932433a743b6a8f1bd2f71ae57c
Signed-off-by: Ted Chen <tedchen@realtek.com>
Tested-by: Anand Moon <linux.amoon@gmail.com>
drivers/usb/host/xhci.c

index 1d6525f80762935f0ad7a82211aaf64aa053d5ce..d211b8beabdc1330ffe804c7c93f52debbb97da8 100644 (file)
@@ -969,10 +969,12 @@ static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe,
        if (usb_pipedevice(pipe) == ctrl->rootdev)
                return xhci_submit_root(udev, pipe, buffer, setup);
 
-       if (setup->request == USB_REQ_SET_ADDRESS)
+       if (setup->request == USB_REQ_SET_ADDRESS &&
+          (setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD)
                return xhci_address_device(udev, root_portnr);
 
-       if (setup->request == USB_REQ_SET_CONFIGURATION) {
+       if (setup->request == USB_REQ_SET_CONFIGURATION &&
+          (setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
                ret = xhci_set_configuration(udev);
                if (ret) {
                        puts("Failed to configure xHCI endpoint\n");