diff options
Diffstat (limited to 'usb-linux.c')
-rw-r--r-- | usb-linux.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usb-linux.c b/usb-linux.c index c7e96c3e63..baa6574ef5 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -335,9 +335,9 @@ static void async_complete(void *opaque) } } -static void async_cancel(USBPacket *p, void *opaque) +static void usb_host_async_cancel(USBDevice *dev, USBPacket *p) { - USBHostDevice *s = opaque; + USBHostDevice *s = DO_UPCAST(USBHostDevice, dev, dev); AsyncURB *aurb; QLIST_FOREACH(aurb, &s->aurbs, next) { @@ -736,7 +736,6 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p) } } - usb_defer_packet(p, async_cancel, s); return USB_RET_ASYNC; } @@ -868,7 +867,6 @@ static int usb_host_handle_control(USBDevice *dev, USBPacket *p, } } - usb_defer_packet(p, async_cancel, s); return USB_RET_ASYNC; } @@ -1197,6 +1195,7 @@ static struct USBDeviceInfo usb_host_dev_info = { .qdev.size = sizeof(USBHostDevice), .init = usb_host_initfn, .handle_packet = usb_generic_handle_packet, + .cancel_packet = usb_host_async_cancel, .handle_data = usb_host_handle_data, .handle_control = usb_host_handle_control, .handle_reset = usb_host_handle_reset, |