public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-BOOT.V2] usb: xhci: Fix vendor command error if the request
Date: Sat,  5 Mar 2016 19:13:13 +1030	[thread overview]
Message-ID: <1457167393-2559-1-git-send-email-linux.amoon@gmail.com> (raw)

From: Ted Chen <tedchen@realtek.com>

From: Ted Chen <tedchen@realtek.com>

type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
To: marex at denx.de, swarren at nvidia.com, u-boot at lists.denx.de
Cc: linux.amoon at gmail.com, Ted Chen <tedchen@realtek.com>

Add a condition of set_address and set_configuration to check
if the request is standardized.

Signed-off-by: Ted Chen <tedchen@realtek.com>
---
Resend this patch it some how got missed
Changes since v1: None.

Tested on Odroid XU4: with Ethernet USB3.0 RT8153-VB
---
 drivers/usb/host/xhci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ca598aa..cb8a04b 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -941,10 +941,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");
-- 
1.9.1

             reply	other threads:[~2016-03-05  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-05  8:43 Anand Moon [this message]
2016-03-05 12:30 ` [U-Boot] [U-BOOT.V2] usb: xhci: Fix vendor command error if the request Marek Vasut
2016-03-05 17:53   ` Anand Moon
2016-03-06  7:44     ` Marek Vasut
2016-03-13  9:53       ` Anand Moon
2016-03-14 17:26         ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457167393-2559-1-git-send-email-linux.amoon@gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox