diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-05-16 10:34:53 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-05-26 11:55:03 +0200 |
commit | 60ce516a60a253291e6ff27a122328fb86bff367 (patch) | |
tree | 906f6b56e9837ae4f1fad70ee7ee878a90d63319 /usb-linux.c | |
parent | 6968fbfa38337e1fe9a6bde91389e27e469a8be1 (diff) | |
download | qemu-60ce516a60a253291e6ff27a122328fb86bff367.tar.gz qemu-60ce516a60a253291e6ff27a122328fb86bff367.tar.bz2 qemu-60ce516a60a253291e6ff27a122328fb86bff367.zip |
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it over
to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
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, |