diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2013-05-03 07:44:58 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2013-05-03 07:44:58 +0000 |
commit | c77a24c24a844f32150345c9967c026a5a50da4c (patch) | |
tree | bae81f1e85342c7dae2df723f345aafb486ea339 /lib/libusb/libusb20.3 | |
parent | 3b48e348d5c2e70f071a75e37edac8c5eba8d478 (diff) | |
download | src-c77a24c24a844f32150345c9967c026a5a50da4c.tar.gz src-c77a24c24a844f32150345c9967c026a5a50da4c.zip |
Add new USB API to get the port path of a USB device.
MFC after: 2 weeks
Requested by: emaste @
Notes
Notes:
svn path=/head/; revision=250201
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 8d286f13723f..e367bf36a874 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 . |