qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: qemu-devel@nongnu.org
Cc: ian.jackson@eu.citrix.com
Subject: [Qemu-devel] [PATCH 2/5] usb-linux.c: set urb->type correctly for control and interrupt transfers
Date: Tue, 3 Feb 2009 16:44:56 +0000	[thread overview]
Message-ID: <973c568fbe3338a7624e97c01e078cb6352964c7.1233854876.git.Ian.Jackson@eu.citrix.com> (raw)
In-Reply-To: <6f129132214575f261cb44404f901281ad6bd699.1233854876.git.Ian.Jackson@eu.citrix.com>

Previously we would always request that the host kernel perform a bulk
transfer if the endpoint was not isochronous.  This is wrong and
results in EINVAL if the endpoint is control or interrupt.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 usb-linux.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index 321c1db..3019a13 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -469,16 +469,13 @@ static int usb_host_handle_data(USBHostDevice *s, USBPacket *p)
 
     urb->buffer        = p->data;
     urb->buffer_length = p->len;
+    urb->type          = s->endp_table[p->devep - 1].type;
 
-    if (is_isoc(s, p->devep)) {
+    if (urb->type == USBDEVFS_URB_TYPE_ISO) {
         /* Setup ISOC transfer */
-        urb->type     = USBDEVFS_URB_TYPE_ISO;
         urb->flags    = USBDEVFS_URB_ISO_ASAP;
         urb->number_of_packets = 1;
         urb->iso_frame_desc[0].length = p->len;
-    } else {
-        /* Setup bulk transfer */
-        urb->type     = USBDEVFS_URB_TYPE_BULK;
     }
 
     urb->usercontext = s;
-- 
1.4.4.4

  reply	other threads:[~2009-02-05 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 16:46 [Qemu-devel] [PATCH 1/5] usb-linux.c: allow full-size control transfers, do not overrun buffer Ian Jackson
2009-02-03 16:44 ` Ian Jackson [this message]
2009-02-04 15:28 ` [Qemu-devel] [PATCH 3/5] usb-linux.c: somewhat improve some error and debugging messages Ian Jackson
2009-02-04 15:31 ` [Qemu-devel] [PATCH 4/5] usb-linux.c: more improved debugging messages (endpoint table) Ian Jackson
2009-02-05 17:20 ` [Qemu-devel] [PATCH 5/5] usb-linux.c: fix handling of asynchronous isochronous completion Ian Jackson
2009-02-05 19:35 ` [Qemu-devel] [PATCH 1/5] usb-linux.c: allow full-size control transfers, do not overrun buffer malc
2009-02-06 10:35   ` Ian Jackson

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=973c568fbe3338a7624e97c01e078cb6352964c7.1233854876.git.Ian.Jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).