Module Name: src Committed By: mrg Date: Fri Jun 1 00:16:29 UTC 2012
Modified Files: src/share/man/man9: usbdi.9 Log Message: - add some comments for post-usbmp - basic documentation for: usbd_clear_endpoint_toggle() usbd_device2interface_handle() usbd_interface2device_handle() usbd_pipe2device_handle() usbd_interface2endpoint_descriptor() usbd_endpoint_count() - usbd_close_pipe() has documentation already - bump date To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/usbdi.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man9/usbdi.9 diff -u src/share/man/man9/usbdi.9:1.15 src/share/man/man9/usbdi.9:1.16 --- src/share/man/man9/usbdi.9:1.15 Thu May 17 07:28:29 2012 +++ src/share/man/man9/usbdi.9 Fri Jun 1 00:16:28 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbdi.9,v 1.15 2012/05/17 07:28:29 wiz Exp $ +.\" $NetBSD: usbdi.9,v 1.16 2012/06/01 00:16:28 mrg Exp $ .\" .\" Copyright (c) 2012 Matthew R. Green .\" All rights reserved. @@ -54,7 +54,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 16, 2012 +.Dd May 31, 2012 .Dt USBDI 9 .Os .Sh NAME @@ -124,6 +124,9 @@ .Fn usbd_get_buffer "usbd_xfer_handle xfer" .Ft usbd_status .Fn usbd_sync_transfer "usbd_xfer_handle req" +.\" only in usbmp +.\" .Ft usbd_status +.\" .Fn usbd_sync_transfer_sig "usbd_xfer_handle req" .Ft usbd_status .Fn usbd_open_pipe_intr "usbd_interface_handle iface" "uint8_t address" \ "uint8_t flags" "usbd_pipe_handle *pipe" \ @@ -332,12 +335,8 @@ and .Fn usbd_clear_endpoint_stall_async functions are used to clear endpoint halt in either a synchronous or asynchronous fashion. -.\" XXX something about -.\" .Fn usbd_clear_endpoint_toggle . -To obtain the -.Ft usbd_device_handle -associated with a pipe the -.Fn usbd_pipe2device_handle +To clear the toggle state of an endpoint the +.Fn usbd_clear_endpoint_toggle function should be used. .Pp A request is described by a @@ -351,13 +350,53 @@ See the .Sx INITIALISING USB REQUESTS section for more details. .Pp +There are a number of functions to obtain a handle, descriptor +of resource count: +.Bl -tag -width 10n +.It Fn usbd_device2interface_handle dev ifaceno iface +Fills in +.Fa iface +with the +.Ft usbd_interface_handle +for the USB device +.Fa dev +on interface number +.Fa ifaceno . +.It Fn usbd_interface2device_handle iface dev +Fills in +.Fa dev +with the +.Ft usbd_device_handle +pointer for interface +.Fa iface . +.It Fn usbd_pipe2device_handle pipe +Returns the +.Ft usbd_device_handle +associated with +.Fa pipe . +.It Fn usbd_interface2endpoint_descriptor iface address +Returns the +.Ft usb_endpoint_descriptor_t * +for the particular interface +.Fa iface +at address +.Fa address . +.It Fn usbd_endpoint_count dev count +.It Fn usbd_interface_count dev count +Fills in +.Fa count +with the number of endpoint or interfaces the USB device +.Fa dev +has. +.El +.Pp Error handling and other return values are described in .Xr usbd_status 9 . .Pp Additional comments on particular functions: .Bl -tag -width 10n .It Fn usbd_errstr err -Return the string associated with +Returns the string associated with .Fa err . .It Fn usbd_add_dev_event type iface The @@ -400,7 +439,6 @@ macro can be used to match any USB produ .\" .\" .Fn usbd_open_pipe "usbd_interface_handle iface" "uint8_t address" \ .\" "uint8_t flags" "usbd_pipe_handle *pipe" -.\" .Fn usbd_close_pipe "usbd_pipe_handle pipe" .\" .Fn usbd_open_pipe_intr "usbd_interface_handle iface" "uint8_t address" \ .\" "uint8_t flags" "usbd_pipe_handle *pipe" \ .\" "usbd_private_handle priv" "void *buffer" \ @@ -417,6 +455,8 @@ macro can be used to match any USB produ .\" .Fn usbd_free_buffer "usbd_xfer_handle req" .\" .Fn usbd_get_buffer "usbd_xfer_handle xfer" .\" .Fn usbd_sync_transfer "usbd_xfer_handle req" +.\" only in usbmp +.\" .Fn usbd_sync_transfer_sig "usbd_xfer_handle req" .\" .Fn usbd_do_request "usbd_device_handle dev" "usb_device_request_t *req" \ .\" "void *data" .\" .Fn usbd_do_request_flags "usbd_device_handle dev" \ @@ -640,7 +680,7 @@ structure, which has this member: .Vt uWord wStatus ; .El .Pp -For device status requests, the +For device status requests the .Fa wStatus member may have either of these bit flags set: .Bl -tag -width UDS_REMOTE_WAKEUPXX -offset offset -compact @@ -648,7 +688,7 @@ member may have either of these bit flag .It Dv UDS_REMOTE_WAKEUP .El .Pp -For endpoint status requests, the +For endpoint status requests the .Fa wStatus member may have this bit flag set: .Bl -tag -width UES_HALTXX -offset offset -compact