From owner-svn-src-all@FreeBSD.ORG Tue Aug 16 21:04:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E977D106566B; Tue, 16 Aug 2011 21:04:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF5018FC0A; Tue, 16 Aug 2011 21:04:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7GL44ss073316; Tue, 16 Aug 2011 21:04:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7GL44Cd073313; Tue, 16 Aug 2011 21:04:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201108162104.p7GL44Cd073313@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 16 Aug 2011 21:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224917 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2011 21:04:05 -0000 Author: hselasky Date: Tue Aug 16 21:04:04 2011 New Revision: 224917 URL: http://svn.freebsd.org/changeset/base/224917 Log: 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) Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Tue Aug 16 20:29:03 2011 (r224916) +++ head/lib/libusb/Makefile Tue Aug 16 21:04:04 2011 (r224917) @@ -45,6 +45,7 @@ MLINKS += libusb.3 libusb_get_device_lis 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 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Tue Aug 16 20:29:03 2011 (r224916) +++ head/lib/libusb/libusb.3 Tue Aug 16 21:04:04 2011 (r224917) @@ -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 . .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 d . .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 wi .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