summaryrefslogtreecommitdiff
path: root/libusb/libusb.h
diff options
context:
space:
mode:
authorRyan Metcalfe <ryan.metcalfe@novanta.com>2021-07-26 16:07:48 -0400
committerTormod Volden <debian.tormod@gmail.com>2023-01-19 15:01:22 +0100
commit809a6df614b87be780df9b0c97ba6c0bb6172aab (patch)
treed5d3a0bd4bc399d12b931dbd4f67fa6b7a0c2736 /libusb/libusb.h
parente263e32f20b903ed1d2c68fe3d80b55d7cfae52e (diff)
downloadlibusb-809a6df614b87be780df9b0c97ba6c0bb6172aab.tar.gz
descriptor: Introduce interface association descriptors (IAD)
Types: struct libusb_interface_association_descriptor struct libusb_interface_association_descriptor_array Accessor / cleanup functions: libusb_get_interface_association_descriptors libusb_get_active_interface_association_descriptors libusb_free_interface_association_descriptors Signed-off-by: Ryan Metcalfe <ryan.metcalfe@novanta.com> [Tormod: Fixed Doxygen comment] Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Diffstat (limited to 'libusb/libusb.h')
-rw-r--r--libusb/libusb.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/libusb/libusb.h b/libusb/libusb.h
index bc7ef16..0946a55 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -269,6 +269,10 @@ enum libusb_descriptor_type {
/** Endpoint descriptor. See libusb_endpoint_descriptor. */
LIBUSB_DT_ENDPOINT = 0x05,
+ /** Interface Association Descriptor.
+ * See libusb_interface_association_descriptor */
+ LIBUSB_DT_INTERFACE_ASSOCIATION = 0x0b,
+
/** BOS descriptor */
LIBUSB_DT_BOS = 0x0f,
@@ -633,6 +637,65 @@ struct libusb_endpoint_descriptor {
};
/** \ingroup libusb_desc
+ * A structure representing the standard USB interface association descriptor.
+ * This descriptor is documented in section 9.6.4 of the USB 3.0 specification.
+ * All multiple-byte fields are represented in host-endian format.
+ */
+struct libusb_interface_association_descriptor {
+ /** Size of this descriptor (in bytes) */
+ uint8_t bLength;
+
+ /** Descriptor type. Will have value
+ * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE_ASSOCIATION
+ * LIBUSB_DT_INTERFACE_ASSOCIATION in this context. */
+ uint8_t bDescriptorType;
+
+ /** Interface number of the first interface that is associated
+ * with this function */
+ uint8_t bFirstInterface;
+
+ /** Number of contiguous interfaces that are associated with
+ * this function */
+ uint8_t bInterfaceCount;
+
+ /** USB-IF class code for this function.
+ * A value of zero is not allowed in this descriptor.
+ * If this field is 0xff, the function class is vendor-specific.
+ * All other values are reserved for assignment by the USB-IF.
+ */
+ uint8_t bFunctionClass;
+
+ /** USB-IF subclass code for this function.
+ * If this field is not set to 0xff, all values are reserved
+ * for assignment by the USB-IF
+ */
+ uint8_t bFunctionSubClass;
+
+ /** USB-IF protocol code for this function.
+ * These codes are qualified by the values of the bFunctionClass
+ * and bFunctionSubClass fields.
+ */
+ uint8_t bFunctionProtocol;
+
+ /** Index of string descriptor describing this function */
+ uint8_t iFunction;
+};
+
+/** \ingroup libusb_desc
+ * Structure containing an array of 0 or more interface association
+ * descriptors
+ */
+struct libusb_interface_association_descriptor_array {
+ /** Array of interface association descriptors. The size of this array
+ * is determined by the length field.
+ */
+ const struct libusb_interface_association_descriptor *iad;
+
+ /** Number of interface association descriptors contained. Read-only. */
+ int length;
+};
+
+/** \ingroup libusb_desc
* A structure representing the standard USB interface descriptor. This
* descriptor is documented in section 9.6.5 of the USB 3.0 specification.
* All multiple-byte fields are represented in host-endian format.
@@ -1433,6 +1496,13 @@ int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev,
int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev,
unsigned char endpoint);
+int LIBUSB_CALL libusb_get_interface_association_descriptors(libusb_device *dev,
+ uint8_t config_index, struct libusb_interface_association_descriptor_array **iad_array);
+int LIBUSB_CALL libusb_get_active_interface_association_descriptors(libusb_device *dev,
+ struct libusb_interface_association_descriptor_array **iad_array);
+void LIBUSB_CALL libusb_free_interface_association_descriptors(
+ struct libusb_interface_association_descriptor_array *iad_array);
+
int LIBUSB_CALL libusb_wrap_sys_device(libusb_context *ctx, intptr_t sys_dev, libusb_device_handle **dev_handle);
int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **dev_handle);
void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle);