summary refs log tree commit diff stats
path: root/hw/usb-ohci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-01-12 12:51:48 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-10 11:31:57 +0100
commitf53c398aa603cea135ee58fd15249aeff7b9c7ea (patch)
treeb36b1a2b09a720a3d9e20a838914f3549cc90b16 /hw/usb-ohci.c
parent1977f93dacf60466cd23b562ae498446b77d3b48 (diff)
downloadfocaccia-qemu-f53c398aa603cea135ee58fd15249aeff7b9c7ea.tar.gz
focaccia-qemu-f53c398aa603cea135ee58fd15249aeff7b9c7ea.zip
usb: USBPacket: add status, rename owner -> ep
Add enum to track the status of USBPackets, use that instead of the
owner pointer to figure whenever a usb packet is currently in flight
or not.  Add some more packet status sanity checks.  Also rename the
USBEndpoint pointer from "owner" to "ep".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-ohci.c')
-rw-r--r--hw/usb-ohci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index ba854c73de..8a8f3bc852 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1709,8 +1709,8 @@ static void ohci_mem_write(void *opaque,
 static void ohci_async_cancel_device(OHCIState *ohci, USBDevice *dev)
 {
     if (ohci->async_td &&
-        ohci->usb_packet.owner != NULL &&
-        ohci->usb_packet.owner->dev == dev) {
+        usb_packet_is_inflight(&ohci->usb_packet) &&
+        ohci->usb_packet.ep->dev == dev) {
         usb_cancel_packet(&ohci->usb_packet);
         ohci->async_td = 0;
     }