document usbd_open_pipe*(). fix some minor errors.
prepare to re-structure a lot of stuff.
This commit is contained in:
parent
9c94f403d6
commit
2ae34fcc5d
@ -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 centers around transfers.
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user