summaryrefslogtreecommitdiff
path: root/libusb/libusb.h
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2011-01-20 12:45:26 +0000
committerPete Batard <pbatard@gmail.com>2011-01-20 12:45:26 +0000
commitc34d9497f31a5a4279b328bd89b99f212578fe73 (patch)
treec1f8beb82c039dca2004a1aaf419f2c798abc21e /libusb/libusb.h
parent4f7cc4982a43a4529d4aaafb71d5d6570b51f4a8 (diff)
downloadlibusb-c34d9497f31a5a4279b328bd89b99f212578fe73.tar.gz
added get_device_topology optional API call
* Windows only, unsupported on other platforms
Diffstat (limited to 'libusb/libusb.h')
-rw-r--r--libusb/libusb.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libusb/libusb.h b/libusb/libusb.h
index b57fe1a..a89e326 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -675,6 +675,20 @@ typedef struct libusb_device libusb_device;
*/
typedef struct libusb_device_handle libusb_device_handle;
+/** \ingroup dev
+ * Structure representing the topology of an USB device.
+ */
+struct libusb_device_topology {
+ /** Opaque device handle to the USB parent (a Hub or a HCD) */
+ libusb_device* parent_dev;
+ /** Bus number to which the device is connected, as seen by the OS */
+ uint8_t bus;
+ /** Depth to HCD for this bus (0 depth means the HCD device) */
+ uint8_t depth;
+ /** Hub port onto which the device is plugged in, as seen by the OS */
+ uint8_t port;
+};
+
/** \ingroup misc
* Error codes. Most libusb functions return 0 on success or one of these
* codes on failure.
@@ -920,6 +934,9 @@ int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev,
int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev,
int interface_number);
+int LIBUSB_CALL libusb_get_device_topology(struct libusb_device *dev,
+ struct libusb_device_topology *topology);
+
/* async I/O */
/** \ingroup asyncio