public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Horst Schirmeier <horst@schirmeier.com>
To: Greg KH <greg@kroah.com>,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH] usbcore: fix check_ctrlrecip to allow control transfers in state ADDRESS
Date: Sat, 11 Mar 2006 02:42:42 +0100	[thread overview]
Message-ID: <20060311014242.GQ22994@quickstop.soohrt.org> (raw)

check_ctrlrecip() disallows any control transfers if the device is
deconfigured (in configuration 0, ie. state ADDRESS). This for example
makes it impossible to read the device descriptors without configuring
the device, although most standard device requests are allowed in this
state by the spec. This patch allows control transfers for the ADDRESS
state, too.

Signed-off-by: Horst Schirmeier <horst@schirmeier.com> 

---

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 2b68998..3461476 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -498,7 +498,8 @@ static int check_ctrlrecip(struct dev_st
 {
 	int ret = 0;
 
-	if (ps->dev->state != USB_STATE_CONFIGURED)
+	if (ps->dev->state != USB_STATE_ADDRESS
+	 && ps->dev->state != USB_STATE_CONFIGURED)
 		return -EHOSTUNREACH;
 	if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
 		return 0;

                 reply	other threads:[~2006-03-11  1:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060311014242.GQ22994@quickstop.soohrt.org \
    --to=horst@schirmeier.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /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