diff mbox series

[v3,1/2] usbip: tools: add options and examples in man page related to device mode

Message ID YE/FaQxejKplWwyL@Sun (mailing list archive)
State Superseded
Headers show
Series [v3,1/2] usbip: tools: add options and examples in man page related to device mode | expand

Commit Message

Hongren Zheng March 15, 2021, 8:36 p.m. UTC
The commit e0546fd8b748b19d8edd1550530da8ebad6e4b31 implemented device
mode for user space tools, however the corresponding options are not
documented in man page.

This commit documents the options and provides examples on device mode.

Signed-off-by: Hongren Zheng <i@zenithal.me>
---
 tools/usb/usbip/doc/usbip.8  | 25 +++++++++++++++++++++++++
 tools/usb/usbip/doc/usbipd.8 | 22 ++++++++++++++++++++++
 2 files changed, 47 insertions(+)

PATCH v2:
    Add signed-off-by line

PATCH v3:
    Move patch changelog after the marker line
    Remove nickname in signed-off-by line

Comments

Greg KH March 23, 2021, 11:41 a.m. UTC | #1
On Tue, Mar 16, 2021 at 04:36:57AM +0800, Hongren Zheng (Zenithal) wrote:
> The commit e0546fd8b748b19d8edd1550530da8ebad6e4b31 implemented device
> mode for user space tools, however the corresponding options are not
> documented in man page.

When referring to commits in the kernel, they should be listed as:
e0546fd8b748 ("usbip: tools: Start using VUDC backend in usbip tools")
as the kernel documentation asks for.

Please fix up and resend.

thanks,

greg k-h
diff mbox series

Patch

diff --git a/tools/usb/usbip/doc/usbip.8 b/tools/usb/usbip/doc/usbip.8
index a15d20063b98..385b0eda8746 100644
--- a/tools/usb/usbip/doc/usbip.8
+++ b/tools/usb/usbip/doc/usbip.8
@@ -49,6 +49,13 @@  then exit.
 Attach a remote USB device.
 .PP
 
+.HP
+\fBattach\fR \-\-remote=<\fIhost\fR> \-\-device=<\fdev_id\fR>
+.IP
+Attach a remote USB gadget.
+Only used when the remote usbipd is in device mode.
+.PP
+
 .HP
 \fBdetach\fR \-\-port=<\fIport\fR>
 .IP
@@ -73,6 +80,14 @@  Stop exporting a device so it can be used by a local driver.
 List USB devices exported by a remote host.
 .PP
 
+.HP
+\fBlist\fR \-\-device
+.IP
+List USB gadgets of local usbip-vudc.
+Only used when the local usbipd is in device mode.
+This can not list usbip-vudc USB gadgets of the remote device mode usbipd.
+.PP
+
 .HP
 \fBlist\fR \-\-local
 .IP
@@ -93,5 +108,15 @@  List local USB devices.
     client:# usbip detach --port=0
         - Detach the usb device.
 
+The following example shows the use of device mode
+
+    server:# usbip list --device
+        - Note this is the server side
+
+    client:# modprobe vhci-hcd
+
+    client:# usbip attach --remote=server --device=usbip-vudc.0
+        - Connect the remote USB gadget
+
 .SH "SEE ALSO"
 \fBusbipd\fP\fB(8)\fB\fP
diff --git a/tools/usb/usbip/doc/usbipd.8 b/tools/usb/usbip/doc/usbipd.8
index fb62a756893b..53c8d5792de6 100644
--- a/tools/usb/usbip/doc/usbipd.8
+++ b/tools/usb/usbip/doc/usbipd.8
@@ -29,6 +29,12 @@  Bind to IPv4. Default is both.
 Bind to IPv6. Default is both.
 .PP
 
+.HP
+\fB\-e\fR, \fB\-\-device\fR
+.IP
+Run in device mode. Rather than drive an attached device, create a virtual UDC to bind gadgets to.
+.PP
+
 .HP
 \fB\-D\fR, \fB\-\-daemon\fR
 .IP
@@ -86,6 +92,22 @@  USB/IP client can connect and use exported devices.
         - A usb device 1-2 is now exportable to other hosts!
         - Use 'usbip unbind --busid=1-2' when you want to shutdown exporting and use the device locally.
 
+The following example shows the use of device mode
+
+    server:# modprobe usbip-vudc
+        - Use /sys/class/udc/ interface
+        - usbip-host is independent of this module.
+
+    server:# usbipd -e -D
+        - Start usbip daemon in device mode.
+
+    server:# modprobe g_mass_storage file=/tmp/tmp.img
+        - Bind a gadget to usbip-vudc
+        - in this example, a mass storage gadget is bound
+
+    server:# usbip list --device
+        - Note this is the server side
+
 .SH "SEE ALSO"
 \fBusbip\fP\fB(8)\fB\fP