aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/libusb20.h
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2019-12-27 20:35:12 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2019-12-27 20:35:12 +0000
commit34b0ca243f6272d998475afd019d3a9e175cd817 (patch)
treeec0a06b0ea9d1a4623486baeeea3db145ef414ff /lib/libusb/libusb20.h
parent7082625d976f0ad1b4207a12afe3c72e2acd9145 (diff)
downloadsrc-34b0ca243f6272d998475afd019d3a9e175cd817.tar.gz
src-34b0ca243f6272d998475afd019d3a9e175cd817.zip
Implement new libusb v2.0 API function, libusb20_dev_get_stats().
This function is useful when debugging USB device issues. MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=356136
Diffstat (limited to 'lib/libusb/libusb20.h')
-rw-r--r--lib/libusb/libusb20.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libusb/libusb20.h b/lib/libusb/libusb20.h
index a35cde59b609..52684aa802d5 100644
--- a/lib/libusb/libusb20.h
+++ b/lib/libusb/libusb20.h
@@ -195,6 +195,12 @@ struct libusb20_quirk {
char quirkname[64 - 12];
};
+struct libusb20_device_stats {
+ uint64_t xfer_ok[4]; /* sorted by USB transfer type, UE_XXX */
+ uint64_t xfer_fail[4]; /* sorted by USB transfer type, UE_XXX */
+ uint64_t xfer_reserved[24]; /* reserved */
+};
+
#define LIBUSB20_MAX_FRAME_PRE_SCALE (1U << 31)
/* USB transfer operations */
@@ -243,6 +249,7 @@ int libusb20_dev_detach_kernel_driver(struct libusb20_device *pdev, uint8_t ifac
int libusb20_dev_set_config_index(struct libusb20_device *pdev, uint8_t configIndex);
int libusb20_dev_get_debug(struct libusb20_device *pdev);
int libusb20_dev_get_fd(struct libusb20_device *pdev);
+int libusb20_dev_get_stats(struct libusb20_device *pdev, struct libusb20_device_stats *pstat);
int libusb20_dev_kernel_driver_active(struct libusb20_device *pdev, uint8_t iface_index);
int libusb20_dev_open(struct libusb20_device *pdev, uint16_t transfer_max);
int libusb20_dev_process(struct libusb20_device *pdev);