[Top][All Lists]
[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
- [Qemu-devel] [PATCH 1/5] usb-linux.c: allow full-size control transfers, do not overrun buffer, Ian Jackson, 2009/02/05
- [Qemu-devel] [PATCH 5/5] usb-linux.c: fix handling of asynchronous isochronous completion, Ian Jackson, 2009/02/05
- [Qemu-devel] [PATCH 3/5] usb-linux.c: somewhat improve some error and debugging messages, Ian Jackson, 2009/02/05
- [Qemu-devel] [PATCH 2/5] usb-linux.c: set urb->type correctly for control and interrupt transfers,
Ian Jackson <=
- [Qemu-devel] [PATCH 4/5] usb-linux.c: more improved debugging messages (endpoint table), Ian Jackson, 2009/02/05
- Re: [Qemu-devel] [PATCH 1/5] usb-linux.c: allow full-size control transfers, do not overrun buffer, malc, 2009/02/05