diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-11-26 20:20:41 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-01-11 15:56:01 +0100 |
commit | a980a065fb5e86d6dec337e6cb6ff432f1a143c9 (patch) | |
tree | 770139308761e2eb59bea5b1520e5b5dd7431308 /hw/usb-desc.h | |
parent | 41c6abbdeb5a86a135ee80a30541ecf52ffd3e23 (diff) | |
download | hqemu-a980a065fb5e86d6dec337e6cb6ff432f1a143c9.zip hqemu-a980a065fb5e86d6dec337e6cb6ff432f1a143c9.tar.gz |
usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common code
This patch adds fields to the USBDevice struct for the current
speed (hard-wired to full speed for now) and current device
configuration. Also a init function is added which inializes
these fields. This allows USB_REQ_{GET,SET}_CONFIGURATION
handling to be moved to common code.
For most drivers the conversion is trivial ad they support a single
configuration only anyway. One exception is bluetooth where some
device-specific setup code runs after get/set configuration. The
other is usb-net which actually has two configurations so the
the code to check for the active configuration has been adapted.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-desc.h')
-rw-r--r-- | hw/usb-desc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/usb-desc.h b/hw/usb-desc.h index 20fc400..d441725 100644 --- a/hw/usb-desc.h +++ b/hw/usb-desc.h @@ -78,6 +78,7 @@ int usb_desc_endpoint(const USBDescEndpoint *ep, uint8_t *dest, size_t len); int usb_desc_other(const USBDescOther *desc, uint8_t *dest, size_t len); /* control message emulation helpers */ +void usb_desc_init(USBDevice *dev); void usb_desc_set_string(USBDevice *dev, uint8_t index, const char *str); const char *usb_desc_get_string(USBDevice *dev, uint8_t index); int usb_desc_string(USBDevice *dev, int index, uint8_t *dest, size_t len); |