aboutsummaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-12-03 17:30:13 +0100
committerGerd Hoffmann <kraxel@redhat.com>2011-01-11 17:15:23 +0100
commit843d4e0c633824a11c4067d0e84bd683520b5d39 (patch)
tree550450ae452dc3d70d64e3ffddc22a59df174d5b /hw/usb.h
parent7b074a22dab4bdda9864b933f1bc811a3db42845 (diff)
downloadqemu-843d4e0c633824a11c4067d0e84bd683520b5d39.zip
qemu-843d4e0c633824a11c4067d0e84bd683520b5d39.tar.gz
qemu-843d4e0c633824a11c4067d0e84bd683520b5d39.tar.bz2
usb: add speed mask to ports
Add a field to usb ports indicating the speed(s) they are able to handle. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 250ec71..407a114 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -44,6 +44,12 @@
#define USB_SPEED_LOW 0
#define USB_SPEED_FULL 1
#define USB_SPEED_HIGH 2
+#define USB_SPEED_SUPER 3
+
+#define USB_SPEED_MASK_LOW (1 << USB_SPEED_LOW)
+#define USB_SPEED_MASK_FULL (1 << USB_SPEED_FULL)
+#define USB_SPEED_MASK_HIGH (1 << USB_SPEED_HIGH)
+#define USB_SPEED_MASK_SUPER (1 << USB_SPEED_SUPER)
#define USB_STATE_NOTATTACHED 0
#define USB_STATE_ATTACHED 1
@@ -226,6 +232,7 @@ typedef struct USBPortOps {
/* USB port on which a device can be connected */
struct USBPort {
USBDevice *dev;
+ int speedmask;
USBPortOps *ops;
void *opaque;
USBDevice *pdev;
@@ -339,7 +346,7 @@ USBDevice *usb_create(USBBus *bus, const char *name);
USBDevice *usb_create_simple(USBBus *bus, const char *name);
USBDevice *usbdevice_create(const char *cmdline);
void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
- USBDevice *pdev, USBPortOps *ops);
+ USBDevice *pdev, USBPortOps *ops, int speedmask);
void usb_unregister_port(USBBus *bus, USBPort *port);
int usb_device_attach(USBDevice *dev);
int usb_device_detach(USBDevice *dev);