qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/5] usb-linux.c: set urb->type correctly for contro


From: Ian Jackson
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

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 <address@hidden>
---
 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 via email to

[Prev in Thread] Current Thread [Next in Thread]