aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-desc.h
diff options
context:
space:
mode:
authorBrad Hards <bradh@frogmouth.net>2011-04-03 15:33:21 +1000
committerGerd Hoffmann <kraxel@redhat.com>2011-05-26 11:55:02 +0200
commit6e625fc70410d76f2fc0d31185a96cf667076f8b (patch)
tree86e7ec2b9cd249cb36a423e25e3d6acc2f411ef3 /hw/usb-desc.h
parentfef13fa8e4de9255cad32192ff76e007568cf1b3 (diff)
downloadqemu-6e625fc70410d76f2fc0d31185a96cf667076f8b.zip
qemu-6e625fc70410d76f2fc0d31185a96cf667076f8b.tar.gz
qemu-6e625fc70410d76f2fc0d31185a96cf667076f8b.tar.bz2
usb: add support for "grouped" interfaces and the Interface Association Descriptor
This is used for some devices that have multiple interfaces that form a logic device. An example is Video Class, which has a Control interface and a Streaming interface. There can be additional interfaces on the same (physical) devices (e.g. a microphone), and Interface Association Descriptor handles this case. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-desc.h')
-rw-r--r--hw/usb-desc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/usb-desc.h b/hw/usb-desc.h
index ac734ab..a612515 100644
--- a/hw/usb-desc.h
+++ b/hw/usb-desc.h
@@ -30,6 +30,24 @@ struct USBDescConfig {
uint8_t bmAttributes;
uint8_t bMaxPower;
+ /* grouped interfaces */
+ uint8_t nif_groups;
+ const USBDescIfaceAssoc *if_groups;
+
+ /* "normal" interfaces */
+ uint8_t nif;
+ const USBDescIface *ifs;
+};
+
+/* conceptually an Interface Association Descriptor, and releated interfaces */
+struct USBDescIfaceAssoc {
+ uint8_t bFirstInterface;
+ uint8_t bInterfaceCount;
+ uint8_t bFunctionClass;
+ uint8_t bFunctionSubClass;
+ uint8_t bFunctionProtocol;
+ uint8_t iFunction;
+
uint8_t nif;
const USBDescIface *ifs;
};
@@ -75,6 +93,8 @@ int usb_desc_device(const USBDescID *id, const USBDescDevice *dev,
int usb_desc_device_qualifier(const USBDescDevice *dev,
uint8_t *dest, size_t len);
int usb_desc_config(const USBDescConfig *conf, uint8_t *dest, size_t len);
+int usb_desc_iface_group(const USBDescIfaceAssoc *iad, uint8_t *dest,
+ size_t len);
int usb_desc_iface(const USBDescIface *iface, uint8_t *dest, size_t len);
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);