diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-10-24 18:14:09 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-10-25 09:08:10 +0200 |
commit | 6ba43f1f6b60159e731b1f37ffb53ab9ab59efa9 (patch) | |
tree | 50aa334531fbd3b720da7d2dd78eab7453304250 /hw/usb/core.c | |
parent | 0cae7b1a004d6857e3bde3d511d7efa39d3cb48a (diff) | |
download | qemu-6ba43f1f6b60159e731b1f37ffb53ab9ab59efa9.zip qemu-6ba43f1f6b60159e731b1f37ffb53ab9ab59efa9.tar.gz qemu-6ba43f1f6b60159e731b1f37ffb53ab9ab59efa9.tar.bz2 |
usb: Move short-not-ok handling to the core
After a short-not-ok packet ending short, we should not advance the queue.
Move enforcing this to the core, rather then handling it in the hcd code.
This may result in the queue now actually containing multiple input packets
(which would not happen before), and this requires special handling in
combination with pipelining, so disable pipleining for input endpoints
(for now).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/core.c')
-rw-r--r-- | hw/usb/core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c index 5a97a0e..f4a5ad2 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -423,7 +423,7 @@ void usb_packet_complete_one(USBDevice *dev, USBPacket *p) assert(QTAILQ_FIRST(&ep->queue) == p); assert(p->result != USB_RET_ASYNC && p->result != USB_RET_NAK); - if (p->result < 0) { + if (p->result < 0 || (p->short_not_ok && (p->result < p->iov.size))) { ep->halted = true; } usb_packet_set_state(p, USB_PACKET_COMPLETE); @@ -532,7 +532,8 @@ void usb_packet_set_state(USBPacket *p, USBPacketState state) p->state = state; } -void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep, uint64_t id) +void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep, uint64_t id, + bool short_not_ok) { assert(!usb_packet_is_inflight(p)); assert(p->iov.iov != NULL); @@ -541,6 +542,7 @@ void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep, uint64_t id) p->ep = ep; p->result = 0; p->parameter = 0; + p->short_not_ok = short_not_ok; qemu_iovec_reset(&p->iov); usb_packet_set_state(p, USB_PACKET_SETUP); } |