aboutsummaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-12-16 17:03:44 +0100
committerGerd Hoffmann <kraxel@redhat.com>2011-05-04 14:11:08 +0200
commit13a9a0d3e253e272744b523e39642c9b6d564f4d (patch)
treef8591c4f360bd40a98fc756195920181cac71ec4 /hw/usb.h
parent5dc1672b279344b5e4e1ba5526a8e45466b953a8 (diff)
usb: move complete callback to port ops
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 22bb3385ba..7e46141fed 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -235,6 +235,7 @@ typedef struct USBPortOps {
void (*attach)(USBPort *port);
void (*detach)(USBPort *port);
void (*wakeup)(USBDevice *dev);
+ void (*complete)(USBDevice *dev, USBPacket *p);
} USBPortOps;
/* USB port on which a device can be connected */
@@ -259,8 +260,6 @@ struct USBPacket {
uint8_t *data;
int len;
/* Internal use by the USB layer. */
- USBCallback *complete_cb;
- void *complete_opaque;
USBCallback *cancel_cb;
void *cancel_opaque;
};
@@ -278,9 +277,9 @@ static inline void usb_defer_packet(USBPacket *p, USBCallback *cancel,
/* Notify the controller that an async packet is complete. This should only
be called for packets previously deferred with usb_defer_packet, and
should never be called from within handle_packet. */
-static inline void usb_packet_complete(USBPacket *p)
+static inline void usb_packet_complete(USBDevice *dev, USBPacket *p)
{
- p->complete_cb(p, p->complete_opaque);
+ dev->port->ops->complete(dev, p);
}
/* Cancel an active packet. The packed must have been deferred with