svn commit: r250342 - head/lib/libusb

Ed Maste emaste at FreeBSD.org
Wed May 8 00:55:30 UTC 2013


Author: emaste
Date: Wed May  8 00:55:29 2013
New Revision: 250342
URL: http://svnweb.freebsd.org/changeset/base/250342

Log:
  Add libusb_get_port_path wrapper
  
  This follows the libusbx API reference at
  http://libusbx.sourceforge.net/api-1.0/group__dev.html
  
  Reviewed by: hselasky@

Modified:
  head/lib/libusb/libusb.3
  head/lib/libusb/libusb.h
  head/lib/libusb/libusb10.c

Modified: head/lib/libusb/libusb.3
==============================================================================
--- head/lib/libusb/libusb.3	Wed May  8 00:20:35 2013	(r250341)
+++ head/lib/libusb/libusb.3	Wed May  8 00:55:29 2013	(r250342)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 7, 2012
+.Dd May 7, 2013
 .Dt LIBUSB 3
 .Os
 .Sh NAME
@@ -102,6 +102,15 @@ counter decremented once.
 Returns the number of the bus contained by the device
 .Fa dev .
 .Pp
+.Ft int
+.Fn libusb_get_port_path "libusb_context *ctx" "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize"
+Stores, in the buffer
+.Fa buf
+of size
+.Fa bufsize ,
+the list of all port numbers from root for the device
+.Fa dev .
+.Pp
 .Ft uint8_t
 .Fn libusb_get_device_address "libusb_device *dev"
 Returns the device_address contained by the device

Modified: head/lib/libusb/libusb.h
==============================================================================
--- head/lib/libusb/libusb.h	Wed May  8 00:20:35 2013	(r250341)
+++ head/lib/libusb/libusb.h	Wed May  8 00:55:29 2013	(r250342)
@@ -369,6 +369,7 @@ void	libusb_exit(struct libusb_context *
 ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
 void	libusb_free_device_list(libusb_device ** list, int unref_devices);
 uint8_t	libusb_get_bus_number(libusb_device * dev);
+int	libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, uint8_t bufsize);
 uint8_t	libusb_get_device_address(libusb_device * dev);
 enum libusb_speed libusb_get_device_speed(libusb_device * dev);
 int	libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint);

Modified: head/lib/libusb/libusb10.c
==============================================================================
--- head/lib/libusb/libusb10.c	Wed May  8 00:20:35 2013	(r250341)
+++ head/lib/libusb/libusb10.c	Wed May  8 00:55:29 2013	(r250342)
@@ -290,6 +290,13 @@ libusb_get_bus_number(libusb_device *dev
 	return (libusb20_dev_get_bus_number(dev->os_priv));
 }
 
+int
+libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf,
+    uint8_t bufsize)
+{
+	return (libusb20_dev_get_port_path(dev->os_priv, buf, bufsize));
+}
+
 uint8_t
 libusb_get_device_address(libusb_device *dev)
 {


More information about the svn-src-head mailing list