diff mbox series

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

Message ID YFrdyKKx1nx8bktm@Sun (mailing list archive)
State Accepted
Commit b737eecd4a8a62c7e479b2c7d2d1a1319343c72b
Headers show
Series [v5,1/2] usbip: tools: add options and examples in man page related to device mode | expand

Commit Message

Hongren Zheng March 24, 2021, 6:35 a.m. UTC
The commit e0546fd8b748 ("usbip: tools: Start using VUDC backend in
usbip tools") 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.
Also the command `usbip port` is documented.

Signed-off-by: Hongren Zheng <i@zenithal.me>
---
 tools/usb/usbip/doc/usbip.8  | 42 +++++++++++++++++++++++++++++++++++-
 tools/usb/usbip/doc/usbipd.8 | 26 ++++++++++++++++++++++
 2 files changed, 67 insertions(+), 1 deletion(-)

PATCH v2:
     Add signed-off-by line

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

PATCH v4:
     Use commit short hash and message instead of long hash only when
       referring to commit in the kernel

PATCH v5:
    Add documentation of `usbip port` and its usage in examples
    Add flow of detaching in examples
    Rephrase some description and add punctuations
    Fix typo of `usbip attach --ev-id` to `--dev-id`

Comments

Greg KH March 24, 2021, 7:37 a.m. UTC | #1
On Wed, Mar 24, 2021 at 02:35:52PM +0800, Hongren Zheng (Zenithal) wrote:
> The commit e0546fd8b748 ("usbip: tools: Start using VUDC backend in
> usbip tools") 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.
> Also the command `usbip port` is documented.
> 
> Signed-off-by: Hongren Zheng <i@zenithal.me>
> ---
>  tools/usb/usbip/doc/usbip.8  | 42 +++++++++++++++++++++++++++++++++++-
>  tools/usb/usbip/doc/usbipd.8 | 26 ++++++++++++++++++++++
>  2 files changed, 67 insertions(+), 1 deletion(-)
> 

Always resend the whole series, not just individual patches of the
series.  When you send individual updates, it's almost impossible to
figure out what patch is what to review and apply properly.

There's no "waste" by resending the whole series, it makes it obvious
what is going on and what needs to be reviewed.

thanks,

greg k-h
Shuah Khan March 24, 2021, 11:50 p.m. UTC | #2
On 3/24/21 12:35 AM, Hongren Zheng (Zenithal) wrote:
> The commit e0546fd8b748 ("usbip: tools: Start using VUDC backend in
> usbip tools") 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.
> Also the command `usbip port` is documented.
> 
> Signed-off-by: Hongren Zheng <i@zenithal.me>
> ---
>   tools/usb/usbip/doc/usbip.8  | 42 +++++++++++++++++++++++++++++++++++-
>   tools/usb/usbip/doc/usbipd.8 | 26 ++++++++++++++++++++++
>   2 files changed, 67 insertions(+), 1 deletion(-)
> 
> PATCH v2:
>       Add signed-off-by line
> 
> PATCH v3:
>       Move patch changelog after the marker line
>       Remove nickname in signed-off-by line
> 
> PATCH v4:
>       Use commit short hash and message instead of long hash only when
>         referring to commit in the kernel
> 
> PATCH v5:
>      Add documentation of `usbip port` and its usage in examples
>      Add flow of detaching in examples
>      Rephrase some description and add punctuations
>      Fix typo of `usbip attach --ev-id` to `--dev-id`
> 
> diff --git a/tools/usb/usbip/doc/usbip.8 b/tools/usb/usbip/doc/usbip.8
> index a15d20063b98..1f26e4a00638 100644
> --- a/tools/usb/usbip/doc/usbip.8
> +++ b/tools/usb/usbip/doc/usbip.8
> @@ -49,10 +49,17 @@ then exit.
>   Attach a remote USB device.
>   .PP
>   
> +.HP
> +\fBattach\fR \-\-remote=<\fIhost\fR> \-\-device=<\fIdev_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
> -Detach an imported USB device.
> +Detach an imported USB device/gadget.
>   .PP
>   
>   .HP
> @@ -73,12 +80,26 @@ 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.
> +Note that this can not list usbip-vudc USB gadgets of the remote device mode usbipd.
> +.PP
> +
>   .HP
>   \fBlist\fR \-\-local
>   .IP
>   List local USB devices.
>   .PP
>   
> +.HP
> +\fBport\fR
> +.IP
> +List imported devices/gadgets.
> +.PP
> +
>   
>   .SH EXAMPLES
>   
> @@ -90,8 +111,27 @@ List local USB devices.
>       client:# usbip attach --remote=server --busid=1-2
>           - Connect the remote USB device.
>   
> +    client:# usbip port
> +        - List imported devices/gadgets.
> +
>       client:# usbip detach --port=0
>           - Detach the usb device.
>   
> +The following example shows the usage of device mode
> +
> +    server:# usbip list --device
> +        - List gadgets exported by local usbipd server.
> +
> +    client:# modprobe vhci-hcd
> +
> +    client:# usbip attach --remote=server --device=usbip-vudc.0
> +        - Connect the remote USB gadget.
> +
> +    client:# usbip port
> +        - List imported devices/gadgets.
> +
> +    client:# usbip detach --port=0
> +        - Detach the 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..d974394f86a1 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,26 @@ 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 usage 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
> +        - List gadgets exported by local usbipd server.
> +
> +    server:# modprobe -r g_mass_storage
> +        - Unbind a gadget from usbip-vudc.
> +        - in this example, the previous mass storage gadget is unbound.
> +
>   .SH "SEE ALSO"
>   \fBusbip\fP\fB(8)\fB\fP
>   
> 

Thank you. Looks good.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/usb/usbip/doc/usbip.8 b/tools/usb/usbip/doc/usbip.8
index a15d20063b98..1f26e4a00638 100644
--- a/tools/usb/usbip/doc/usbip.8
+++ b/tools/usb/usbip/doc/usbip.8
@@ -49,10 +49,17 @@  then exit.
 Attach a remote USB device.
 .PP
 
+.HP
+\fBattach\fR \-\-remote=<\fIhost\fR> \-\-device=<\fIdev_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
-Detach an imported USB device.
+Detach an imported USB device/gadget.
 .PP
 
 .HP
@@ -73,12 +80,26 @@  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.
+Note that this can not list usbip-vudc USB gadgets of the remote device mode usbipd.
+.PP
+
 .HP
 \fBlist\fR \-\-local
 .IP
 List local USB devices.
 .PP
 
+.HP
+\fBport\fR
+.IP
+List imported devices/gadgets.
+.PP
+
 
 .SH EXAMPLES
 
@@ -90,8 +111,27 @@  List local USB devices.
     client:# usbip attach --remote=server --busid=1-2
         - Connect the remote USB device.
 
+    client:# usbip port
+        - List imported devices/gadgets.
+
     client:# usbip detach --port=0
         - Detach the usb device.
 
+The following example shows the usage of device mode
+
+    server:# usbip list --device
+        - List gadgets exported by local usbipd server.
+
+    client:# modprobe vhci-hcd
+
+    client:# usbip attach --remote=server --device=usbip-vudc.0
+        - Connect the remote USB gadget.
+
+    client:# usbip port
+        - List imported devices/gadgets.
+
+    client:# usbip detach --port=0
+        - Detach the 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..d974394f86a1 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,26 @@  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 usage 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
+        - List gadgets exported by local usbipd server.
+
+    server:# modprobe -r g_mass_storage
+        - Unbind a gadget from usbip-vudc.
+        - in this example, the previous mass storage gadget is unbound.
+
 .SH "SEE ALSO"
 \fBusbip\fP\fB(8)\fB\fP