diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-05-03 07:44:58 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-05-03 07:44:58 +0000 |
commit | b7fe9e8c88a6ebaed1f12f93bed79ac371986463 (patch) | |
tree | bae81f1e85342c7dae2df723f345aafb486ea339 /lib/libusb/libusb20.3 | |
parent | 94808df525c90765b05fb81ccdba2e49721b5e97 (diff) | |
download | FreeBSD-src-b7fe9e8c88a6ebaed1f12f93bed79ac371986463.zip FreeBSD-src-b7fe9e8c88a6ebaed1f12f93bed79ac371986463.tar.gz |
Add new USB API to get the port path of a USB device.
MFC after: 2 weeks
Requested by: emaste @
Diffstat (limited to 'lib/libusb/libusb20.3')
-rw-r--r-- | lib/libusb/libusb20.3 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/libusb/libusb20.3 b/lib/libusb/libusb20.3 index 8d286f1..e367bf3 100644 --- a/lib/libusb/libusb20.3 +++ b/lib/libusb/libusb20.3 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2013 +.Dd May 3, 2013 .Dt LIBUSB20 3 .Os .Sh NAME @@ -114,6 +114,8 @@ USB access library (libusb -lusb) .Ft const char * .Fn libusb20_dev_get_backend_name "struct libusb20_device *" .Ft int +.Fn libusb20_dev_get_port_path "struct libusb20_device *pdev" "uint8_t *buf" "uint8_t bufsize" +.Ft int .Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb_device_info *pinfo" .Ft int .Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len" @@ -552,6 +554,20 @@ returns a zero terminated string describing the backend used. . .Pp . +.Fn libusb20_dev_get_port_path +retrieves the list of USB port numbers which the datastream for a given USB device follows. +The first port number is the Root HUB port number. +Then children port numbers follow. +The Root HUB device itself has a port path length of zero. +Valid port numbers start at one and range until and including 255. +Typically there should not be more than 16 levels, due to electrical and protocol limitations. +This functions returns the number of actual port levels upon success +else a LIBUSB20_ERROR value is returned which are always negative. +If the actual number of port levels is greater than the maximum +specified, a LIBUSB20_ERROR value is returned. +. +.Pp +. .Fn libusb20_dev_get_info retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . |