summaryrefslogtreecommitdiffstats
path: root/lib/libusb
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-08-16 21:04:04 +0000
committerhselasky <hselasky@FreeBSD.org>2011-08-16 21:04:04 +0000
commit3cfc1ee7ba68299c57be051163dde8d6036a4d52 (patch)
treeaeaf4008ee220524b8be14c68f260b224973daf9 /lib/libusb
parent43a83c2777cdaad9bd5d9a0b094657f4e3114198 (diff)
downloadFreeBSD-src-3cfc1ee7ba68299c57be051163dde8d6036a4d52.zip
FreeBSD-src-3cfc1ee7ba68299c57be051163dde8d6036a4d52.tar.gz
Update LibUSB v1.0 manual page:
- fix some minor spelling - fix some style - add description of new function MFC after: 1 week Approved by: re (kib)
Diffstat (limited to 'lib/libusb')
-rw-r--r--lib/libusb/Makefile1
-rw-r--r--lib/libusb/libusb.355
2 files changed, 34 insertions, 22 deletions
diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile
index f438cff..c4396cc 100644
--- a/lib/libusb/Makefile
+++ b/lib/libusb/Makefile
@@ -45,6 +45,7 @@ MLINKS += libusb.3 libusb_get_device_list.3
MLINKS += libusb.3 libusb_free_device_list.3
MLINKS += libusb.3 libusb_get_bus_number.3
MLINKS += libusb.3 libusb_get_device_address.3
+MLINKS += libusb.3 libusb_get_device_speed.3
MLINKS += libusb.3 libusb_get_max_packet_size.3
MLINKS += libusb.3 libusb_ref_device.3
MLINKS += libusb.3 libusb_unref_device.3
diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3
index 33d807d..885b066 100644
--- a/lib/libusb/libusb.3
+++ b/lib/libusb/libusb.3
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 18, 2010
+.Dd August 16, 2011
.Dt LIBUSB 3
.Os
.Sh NAME
@@ -116,14 +116,22 @@ Returns the number of the bus contained by the device
.
.Ft uint8_t
.Fn libusb_get_device_address "libusb_device *dev"
-Return the device_address contained by the device
+Returns the device_address contained by the device
.Fa dev.
.
.Pp
.
+.Ft enum libusb_speed
+.Fn libusb_get_device_speed "libusb_device *dev"
+Returns the wire speed at which the device is connected.
+See the LIBUSB_SPEED_XXX enums for more information.
+LIBUSB_SPEED_UNKNOWN is returned in case of unknown wire speed.
+.
+.Pp
+.
.Ft int
.Fn libusb_get_max_packet_size "libusb_device *dev" "unsigned char endpoint"
-Return the wMaxPacketSize value on success, LIBUSB_ERROR_NOT_FOUND if the
+Returns the wMaxPacketSize value on success, LIBUSB_ERROR_NOT_FOUND if the
endpoint does not exist and LIBUSB_ERROR_OTHERS on other failure.
.
.Pp
@@ -144,7 +152,7 @@ Decrement the reference counter of the device
.
.Ft int
.Fn libusb_open "libusb_device *dev" "libusb_device_handle **devh"
-Open a device and obtain a device_handle. Return 0 on success,
+Open a device and obtain a device_handle. Returns 0 on success,
LIBUSB_ERROR_NO_MEM on memory allocation problem, LIBUSB_ERROR_ACCESS
on permission problem, LIBUSB_ERROR_NO_DEVICE if the device has been
disconnected and a LIBUSB_ERROR code on error.
@@ -157,7 +165,7 @@ Convenience function to open a device with is
.Fa vid
and
.Fa pid.
-Return NULL on error.
+Returns NULL on error.
.
.Pp
.
@@ -168,14 +176,15 @@ Close a device handle.
.Pp
.
.Ft libusb_device *
-.Fn libusb_get_device(libusb_device_handle *devh)
-Get the device contained by devh. Return NULL on error.
+.Fn libusb_get_device "libusb_device_handle *devh"
+Get the device contained by devh.
+Returns NULL on error.
.
.Pp
.
.Ft int
.Fn libusb_get_configuration "libusb_device_handle *devh" "int *config"
-Return the bConfiguration value of the current configuration. return 0
+Returns the bConfiguration value of the current configuration. Returns 0
on success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
and a LIBUSB_ERROR code on error.
.
@@ -187,7 +196,7 @@ Set the active configuration
.Fa config
for the device contained by
.Fa devh.
-This function return 0 on success, LIBUSB_ERROR_NOT_FOUND if the requested
+This function returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the requested
configuration does not exist, LIBUSB_ERROR_BUSY if the interfaces are currently
claimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a
LIBUSB_ERROR code on failure.
@@ -198,7 +207,7 @@ LIBUSB_ERROR code on failure.
.Fn libusb_claim_interface "libusb_device_handle *devh" "int interface_number"
Claim an interface in a given libusb_handle
.Fa devh.
-This is a non-blocking function. It return 0 success, LIBUSB_ERROR_NOT_FOUND
+This is a non-blocking function. It returns 0 success, LIBUSB_ERROR_NOT_FOUND
if the requested interface does not exist, LIBUSB_ERROR_BUSY if a program or
driver has claimed the interface, LIBUSB_ERROR_NO_DEVICE if the device has
been disconnected and a LIBUSB_ERROR code on failure.
@@ -251,7 +260,7 @@ code on failure.
.Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface"
Determine if a driver is active on a interface. Returns 0 if no kernel driver
is active, returns 1 if a kernel driver is active, returns LIBUSB_ERROR_NO_DEVICE
-if the device has been disconnected and return a LIBUSB_ERROR code on failure.
+if the device has been disconnected and returns a LIBUSB_ERROR code on failure.
.
.Pp
.
@@ -316,7 +325,7 @@ failure.
.Fn libsub_get_active_config_descriptor "libusb_device *dev" "struct libusb_config_descriptor **config"
Get the USB configuration descriptor for the active configuration. Returns 0 on
success, returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state
-and return another LIBUSB_ERROR code on error.
+and returns another LIBUSB_ERROR code on error.
.
.Pp
.Ft int
@@ -342,8 +351,8 @@ Free a configuration descriptor.
.Pp
.Ft int
.Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t desc_idx" "unsigned char *data" "int length"
-Retrieve a string descriptor in C style ascii. Returns a number of byte on success
-and a LIBUSB_ERROR code on failure.
+Retrieve a string descriptor in C style ascii.
+Returns a positive number of bytes in the resulting ASCII string on success and a LIBUSB_ERROR code on failure.
.
.Pp
.
@@ -354,7 +363,8 @@ and a LIBUSB_ERROR code on failure.
.Fn libusb_alloc_transfer "int iso_packets"
Allocate a transfer with
.Fa iso_packets
-numbers of isochronous packet descriptors. Returns NULL on error.
+numbers of isochronous packet descriptors.
+Returns NULL on error.
.
.Pp
.Ft void
@@ -364,15 +374,15 @@ Free a transfer.
.Pp
.Ft int
.Fn libusb_submit_transfer "struct libusb_transfer *tr"
-This function will submit a transfer and returns immediately. Returns 0 on
-success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and
+This function will submit a transfer and returns immediately.
+Returns 0 on success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and
LIBUSB_ERROR code on other failure.
.
.Pp
.Ft int
.Fn libusb_cancel_transfer "struct libusb_transfer *tr"
-This function asynchronously cancel a transfer. Returns 0 on success and
-LIBUSB_ERROR code on failure.
+This function asynchronously cancel a transfer.
+Returns 0 on success and LIBUSB_ERROR code on failure.
.
.Pp
.Sh USB SYNCHRONOUS I/O
@@ -380,7 +390,8 @@ LIBUSB_ERROR code on failure.
.Pp
.Ft int
.Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout"
-Perform a USB control transfer. Returns the actual number of bytes
+Perform a USB control transfer.
+Returns the actual number of bytes
transferred on success in the range from and including zero until and
including
.Fa wLength .
@@ -420,8 +431,8 @@ LIBUSB_ERROR code on other failure.
.Pp
.Ft int
.Fn libusb_try_lock_events "libusb_context *ctx"
-Try to acquire the event handling lock. Returns 0 if the lock was obtained and 1
-if not.
+Try to acquire the event handling lock.
+Returns 0 if the lock was obtained and 1 if not.
.
.Pp
.Ft void
OpenPOWER on IntegriCloud