aboutsummaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-04 17:10:36 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-04 17:10:36 -0500
commit5df0a2a5ba54114afb2bf75cab9fb184020a46a8 (patch)
tree40565e20dad22056e9d33b09c46d7f009b9acde3 /hw/usb.h
parent47bf05d7eb550905c635724ce72f855fb4e10b3d (diff)
parentfb8f4ceeb837a7410e018619daae6bc821060503 (diff)
Merge remote-tracking branch 'kraxel/usb.22' into staging
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/hw/usb.h b/hw/usb.h
index ded2de29b9..84d04df2e1 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -285,12 +285,21 @@ struct USBPacket {
int pid;
uint8_t devaddr;
uint8_t devep;
- uint8_t *data;
- int len;
+ QEMUIOVector iov;
+ int result; /* transfer length or USB_RET_* status code */
/* Internal use by the USB layer. */
USBDevice *owner;
};
+void usb_packet_init(USBPacket *p);
+void usb_packet_setup(USBPacket *p, int pid, uint8_t addr, uint8_t ep);
+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);
+void usb_packet_copy(USBPacket *p, void *ptr, size_t bytes);
+void usb_packet_skip(USBPacket *p, size_t bytes);
+void usb_packet_cleanup(USBPacket *p);
+
int usb_handle_packet(USBDevice *dev, USBPacket *p);
void usb_packet_complete(USBDevice *dev, USBPacket *p);
void usb_cancel_packet(USBPacket * p);