mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: "Hongren Zheng (Zenithal)" <i@zenithal.me>,
	Valentina Manea <valentina.manea.m@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	Antonio Borneo <borneo.antonio@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	matt mooney <mfm@muteddisk.com>,
	linux-usb@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] usbip: tools: add options and examples in man page related to device mode
Date: Tue, 23 Mar 2021 17:12:00 -0600	[thread overview]
Message-ID: <1a2c79b7-1cc0-9ddd-f2ec-fa7b222113ec@linuxfoundation.org> (raw)
In-Reply-To: <YFnlUaF2njDjIhfM@Sun>

On 3/23/21 6:55 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.
> 
> 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
> 
> PATCH v4:
>      Use commit short hash and message instead of long hash only when
>        referring to commit in the kernel
> 

Thank you for the patch. Please see comments below:

> 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

This is a bit confusing. Please add a separate section for
Attach a remote USB gadget complete with attach and detach
instructions.

> @@ -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
>   
> 

thanks,
-- Shuah


  parent reply	other threads:[~2021-03-23 23:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 12:55 Hongren Zheng (Zenithal)
2021-03-23 13:01 ` [PATCH v4 2/2] usbip: tools: add usage of device mode in usbip_list.c Hongren Zheng (Zenithal)
2021-03-23 15:45   ` Shuah Khan
2021-03-23 23:12 ` Shuah Khan [this message]
2021-03-24  4:36   ` [PATCH v4 1/2] usbip: tools: add options and examples in man page related to device mode Hongren Zheng (Zenithal)
2021-03-24  6:35     ` [PATCH v5 " Hongren Zheng (Zenithal)
2021-03-24  7:37       ` Greg Kroah-Hartman
2021-03-24  7:56       ` [PATCH v5 2/2] usbip: tools: add usage of device mode in usbip_list.c Hongren Zheng (Zenithal)
2021-03-24 23:50         ` Shuah Khan
2021-03-24 23:50       ` [PATCH v5 1/2] usbip: tools: add options and examples in man page related to device mode Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1a2c79b7-1cc0-9ddd-f2ec-fa7b222113ec@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=borneo.antonio@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=i@zenithal.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mfm@muteddisk.com \
    --cc=shuah@kernel.org \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®