Commit b737eecd authored by Hongren Zheng (Zenithal)'s avatar Hongren Zheng (Zenithal) Committed by Greg Kroah-Hartman

usbip: tools: add options and examples in man page related to device mode

The commit e0546fd8 ("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.
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarHongren Zheng <i@zenithal.me>
Link: https://lore.kernel.org/r/YFrdyKKx1nx8bktm@SunSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfbe56bf
...@@ -49,10 +49,17 @@ then exit. ...@@ -49,10 +49,17 @@ then exit.
Attach a remote USB device. Attach a remote USB device.
.PP .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 .HP
\fBdetach\fR \-\-port=<\fIport\fR> \fBdetach\fR \-\-port=<\fIport\fR>
.IP .IP
Detach an imported USB device. Detach an imported USB device/gadget.
.PP .PP
.HP .HP
...@@ -73,12 +80,26 @@ Stop exporting a device so it can be used by a local driver. ...@@ -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. List USB devices exported by a remote host.
.PP .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 .HP
\fBlist\fR \-\-local \fBlist\fR \-\-local
.IP .IP
List local USB devices. List local USB devices.
.PP .PP
.HP
\fBport\fR
.IP
List imported devices/gadgets.
.PP
.SH EXAMPLES .SH EXAMPLES
...@@ -90,8 +111,27 @@ List local USB devices. ...@@ -90,8 +111,27 @@ List local USB devices.
client:# usbip attach --remote=server --busid=1-2 client:# usbip attach --remote=server --busid=1-2
- Connect the remote USB device. - Connect the remote USB device.
client:# usbip port
- List imported devices/gadgets.
client:# usbip detach --port=0 client:# usbip detach --port=0
- Detach the usb device. - 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" .SH "SEE ALSO"
\fBusbipd\fP\fB(8)\fB\fP \fBusbipd\fP\fB(8)\fB\fP
...@@ -29,6 +29,12 @@ Bind to IPv4. Default is both. ...@@ -29,6 +29,12 @@ Bind to IPv4. Default is both.
Bind to IPv6. Default is both. Bind to IPv6. Default is both.
.PP .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 .HP
\fB\-D\fR, \fB\-\-daemon\fR \fB\-D\fR, \fB\-\-daemon\fR
.IP .IP
...@@ -86,6 +92,26 @@ USB/IP client can connect and use exported devices. ...@@ -86,6 +92,26 @@ USB/IP client can connect and use exported devices.
- A usb device 1-2 is now exportable to other hosts! - 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. - 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" .SH "SEE ALSO"
\fBusbip\fP\fB(8)\fB\fP \fBusbip\fP\fB(8)\fB\fP
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment