summaryrefslogtreecommitdiffstats
path: root/hw/usb.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-08-23 13:30:13 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-08-31 11:57:23 +0200
commite983395d30d1d5bfa0ed3ae9c028c130f7c498cc (patch)
tree6377ecd839a30655f4a78eee1db5aec531804da7 /hw/usb.h
parent0132b4b6595423c92f54d7e0b172b5d73aaa8375 (diff)
downloadhqemu-e983395d30d1d5bfa0ed3ae9c028c130f7c498cc.zip
hqemu-e983395d30d1d5bfa0ed3ae9c028c130f7c498cc.tar.gz
usb: unique packet ids
This patch adds IDs to usb packets. Those IDs are (a) supposed to be unique for the lifecycle of a packet (from packet setup until the packet is either completed or canceled) and (b) stable across migration. uhci, ohci, ehci and xhci use the guest physical address of the transfer descriptor for this. musb needs a different approach because there is no transfer descriptor. But musb also doesn't support pipelining, so we have never more than one packet per endpoint in flight. So we go create an ID based on endpoint and device address. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/usb.h b/hw/usb.h
index e574477..b8fceec 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -332,6 +332,7 @@ typedef enum USBPacketState {
struct USBPacket {
/* Data fields for use by the driver. */
int pid;
+ uint64_t id;
USBEndpoint *ep;
QEMUIOVector iov;
uint64_t parameter; /* control transfers */
@@ -344,7 +345,7 @@ struct USBPacket {
void usb_packet_init(USBPacket *p);
void usb_packet_set_state(USBPacket *p, USBPacketState state);
void usb_packet_check_state(USBPacket *p, USBPacketState expected);
-void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep);
+void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep, uint64_t id);
void usb_packet_addbuf(USBPacket *p, void *ptr, size_t len);
int usb_packet_map(USBPacket *p, QEMUSGList *sgl);
void usb_packet_unmap(USBPacket *p, QEMUSGList *sgl);
OpenPOWER on IntegriCloud