Hi tech@,

I have been going through usbdi recently and I believe that the mentioned
manpages can be merged into a single one since they operate on the same
abstraction in the interface.

I am cross referrencing with NetBSD which recently added documentation for the
usbdi interface:
  - https://man-k.org/man/netbsd/9/usbdi?r=1&q=usb_rem_task

Feedback? OK's?

Regards,
Adam
Index: Makefile
===================================================================
RCS file: /cvs/src/share/man/man9/Makefile,v
retrieving revision 1.280
diff -u -p -r1.280 Makefile
--- Makefile    5 Sep 2016 07:22:29 -0000       1.280
+++ Makefile    11 Sep 2016 17:51:33 -0000
@@ -33,7 +33,7 @@ MAN=  aml_evalnode.9 atomic_add_int.9 ato
        spl.9 srp_enter.9 srpl_rc_init.9 startuphook_establish.9 \
        socreate.9 sosplice.9 style.9 syscall.9 sysctl_int.9 \
        task_add.9 tc_init.9 time_second.9 timeout.9 tsleep.9 tvtohz.9 \
-       uiomove.9 uvm.9 usbd_close_pipe.9 usbd_open_pipe.9 usbd_ref_wait.9 \
+       uiomove.9 uvm.9 usbd_open_pipe.9 usbd_ref_wait.9 \
        usbd_transfer.9 vfs.9 vfs_busy.9 \
        vfs_cache.9 vaccess.9 vclean.9 vcount.9 vdevgone.9 vfinddev.9 vflush.9 \
        vflushbuf.9 vget.9 vgone.9 vhold.9 vinvalbuf.9 vnode.9 vnsubr.9 \
Index: usbd_close_pipe.9
===================================================================
RCS file: usbd_close_pipe.9
diff -N usbd_close_pipe.9
--- usbd_close_pipe.9   4 May 2015 10:12:34 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,48 +0,0 @@
-.\" $OpenBSD: usbd_close_pipe.9,v 1.1 2015/05/04 10:12:34 mpi Exp $
-.\"
-.\" Copyright (c) 2015 Sean Levy <att...@stalphonsos.com>
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.Dd $Mdocdate: May 4 2015 $
-.Dt USBD_CLOSE_PIPE 9
-.Os
-.Sh NAME
-.Nm usbd_close_pipe , usbd_abort_pipe
-.Nd delete or abort transfers on a USB pipe
-.Sh SYNOPSIS
-.In dev/usb/usb.h
-.In dev/usb/usbdi.h
-.Ft usbd_status
-.Fn usbd_close_pipe "struct usbd_pipe *pipe"
-.Ft usbd_status
-.Fn usbd_abort_pipe "struct usbd_pipe *pipe"
-.Sh DESCRIPTION
-The
-.Fn usbd_abort_pipe
-function aborts any transfers queued on
-.Fa pipe .
-.Pp
-The
-.Fn usbd_close_pipe
-function aborts any transfers queued on
-.Fa pipe
-then deletes it.
-.Sh CONTEXT
-.Fn usbd_abort_pipe
-and
-.Fn usbd_close_pipe
-can be called during autoconf or from process context.
-.Sh SEE ALSO
-.Xr usb 4 ,
-.Xr usbd_open_pipe 9
Index: usbd_open_pipe.9
===================================================================
RCS file: /cvs/src/share/man/man9/usbd_open_pipe.9,v
retrieving revision 1.4
diff -u -p -r1.4 usbd_open_pipe.9
--- usbd_open_pipe.9    27 Jun 2016 23:38:01 -0000      1.4
+++ usbd_open_pipe.9    11 Sep 2016 17:51:33 -0000
@@ -18,8 +18,11 @@
 .Dt USBD_OPEN_PIPE 9
 .Os
 .Sh NAME
-.Nm usbd_open_pipe , usbd_open_pipe_intr
-.Nd create USB pipe
+.Nm usbd_open_pipe ,
+.Nm usbd_open_pipe_intr ,
+.Nm usbd_close_pipe ,
+.Nm usbd_abort_pipe
+.Nd manage USB transfer pipes
 .Sh SYNOPSIS
 .In dev/usb/usb.h
 .In dev/usb/usbdi.h
@@ -27,16 +30,21 @@
 .Fn usbd_open_pipe "struct usbd_interface *iface" "uint8_t address" "uint8_t 
flags" "struct usbd_pipe **pipe"
 .Ft usbd_status
 .Fn usbd_open_pipe_intr "struct usbd_interface *iface" "uint8_t address" 
"uint8_t flags" "struct usbd_pipe **pipe" "void *priv" "void *buffer" "uint32_t 
len" "usbd_callback cb" "int ival"
+.Ft usbd_status
+.Fn usbd_close_pipe "struct usbd_pipe *pipe"
+.Ft usbd_status
+.Fn usbd_abort_pipe "struct usbd_pipe *pipe"
 .Sh DESCRIPTION
 The
-.Fn usbd_open_pipe
-and
+.Fn usbd_open_pipe ,
 .Fn usbd_open_pipe_intr
-functions create pipes.
+and
+.Fn usbd_close_pipe
+functions create and destroy pipes.
 A pipe is a logical connection between the host and an endpoint on a
 USB device.
 USB drivers use pipes to manage transfers to or from a USB
-endpoint.
+endpoint. It is common to have more than one pipe per device.
 .Pp
 The
 .Fn usbd_open_pipe
@@ -121,12 +129,22 @@ transfers maintained by the pipe, unlike
 continue to be processed every
 .Fa ival
 milliseconds.
+.Pp
+.Fn usbd_close_pipe
+function aborts any transfers queued on
+.Fa pipe .
+.Pp
+.Fn usbd_abort_pipe
+function aborts any transfers queued on
+.Fa pipe
+then delets it.
 .Sh CONTEXT
-.Fn usbd_open_pipe
+.Fn usbd_open_pipe ,
+.Fn usbd_open_pipe_intr ,
+.Fn usbd_close_pipe 
 and
-.Fn usbd_open_pipe_intr
+.Fn usbd_abort_pipe
 can be called during autoconf or from process context.
 .Sh SEE ALSO
 .Xr usb 4 ,
-.Xr usbd_close_pipe 9 ,
 .Xr usbd_transfer 9

Reply via email to