Module Name: src Committed By: mrg Date: Sat Jun 2 23:33:16 UTC 2012
Modified Files: src/share/man/man9: usbdi.9 Log Message: document usbd_open_pipe*(). fix some minor errors. prepare to re-structure a lot of stuff. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 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.17 src/share/man/man9/usbdi.9:1.18 --- src/share/man/man9/usbdi.9:1.17 Sat Jun 2 23:10:12 2012 +++ src/share/man/man9/usbdi.9 Sat Jun 2 23:33:16 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbdi.9,v 1.17 2012/06/02 23:10:12 mrg Exp $ +.\" $NetBSD: usbdi.9,v 1.18 2012/06/02 23:33:16 mrg Exp $ .\" .\" Copyright (c) 2012 Matthew R. Green .\" All rights reserved. @@ -131,7 +131,7 @@ .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" \ - "uint32_t length" "usbd_callback" + "uint32_t length" "usbd_callback callback" "int interval" .Ft usbd_status .Fn usbd_do_request "usbd_device_handle dev" "usb_device_request_t *req" \ "void *data" @@ -285,23 +285,49 @@ Device driver access to the USB bus cent A transfer describes a communication with a USB device. A transfer is an abstract concept that can result in several physical packets being transferred to or from a device. -.Pp +A transfer is described by the +.Va usbd_xfer_handle +cookie. A pipe is a logical connection to a USB device. It is described by the .Va usbd_pipe_handle cookie. +.Pp Pipes are created and destroyed by using the .Fn usbd_open_pipe , .Fn usbd_open_pipe_intr and .Fn usbd_close_pipe functions. -.\" XXX document args to usbd_open_pipe*() +The open functions take the interface handle +.Fa iface , +the +.Fa address +of this pipe and +.Fa flags +for this pipe which currently may be 0 or +.Dv USBD_EXCLUSIVE_USE , +to enable exclusive access to this interface and address. +The +.Fn usbd_open_pipe_intr +takes additional arguments +.Fa priv +to set the default private handle. +.Fa buffer +and +.Fa len +to describe the buffer to be used, +.Fa callback +for the function to call at interrupt time, and finally the +.Fa interval +for interrupts to be delivered in milliseconds. +The +.Fa interval +may be set to +.Dv USBD_DEFAULT_INTERVAL +use the default interval, specified by the ep. description. It is common to have more than one pipe per device. -.Pp -A transfer is described by the -.Va usbd_xfer_handle -cookie. + .Pp Transfers are allocated and deallocated with .Fn usbd_alloc_xfer