Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Hongren Zheng <i@zenithal.me>
Link: https://lore.kernel.org/r/YFrdyKKx1nx8bktm@Sun
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hongren Zheng (Zenithal) and committed by
Greg Kroah-Hartman
b737eecd dfbe56bf

+67 -1
+41 -1
tools/usb/usbip/doc/usbip.8
··· 50 50 .PP 51 51 52 52 .HP 53 + \fBattach\fR \-\-remote=<\fIhost\fR> \-\-device=<\fIdev_id\fR> 54 + .IP 55 + Attach a remote USB gadget. 56 + Only used when the remote usbipd is in device mode. 57 + .PP 58 + 59 + .HP 53 60 \fBdetach\fR \-\-port=<\fIport\fR> 54 61 .IP 55 - Detach an imported USB device. 62 + Detach an imported USB device/gadget. 56 63 .PP 57 64 58 65 .HP ··· 81 74 .PP 82 75 83 76 .HP 77 + \fBlist\fR \-\-device 78 + .IP 79 + List USB gadgets of local usbip-vudc. 80 + Only used when the local usbipd is in device mode. 81 + Note that this can not list usbip-vudc USB gadgets of the remote device mode usbipd. 82 + .PP 83 + 84 + .HP 84 85 \fBlist\fR \-\-local 85 86 .IP 86 87 List local USB devices. 88 + .PP 89 + 90 + .HP 91 + \fBport\fR 92 + .IP 93 + List imported devices/gadgets. 87 94 .PP 88 95 89 96 ··· 111 90 client:# usbip attach --remote=server --busid=1-2 112 91 - Connect the remote USB device. 113 92 93 + client:# usbip port 94 + - List imported devices/gadgets. 95 + 114 96 client:# usbip detach --port=0 115 97 - Detach the usb device. 98 + 99 + The following example shows the usage of device mode 100 + 101 + server:# usbip list --device 102 + - List gadgets exported by local usbipd server. 103 + 104 + client:# modprobe vhci-hcd 105 + 106 + client:# usbip attach --remote=server --device=usbip-vudc.0 107 + - Connect the remote USB gadget. 108 + 109 + client:# usbip port 110 + - List imported devices/gadgets. 111 + 112 + client:# usbip detach --port=0 113 + - Detach the usb gadget. 116 114 117 115 .SH "SEE ALSO" 118 116 \fBusbipd\fP\fB(8)\fB\fP
+26
tools/usb/usbip/doc/usbipd.8
··· 30 30 .PP 31 31 32 32 .HP 33 + \fB\-e\fR, \fB\-\-device\fR 34 + .IP 35 + Run in device mode. Rather than drive an attached device, create a virtual UDC to bind gadgets to. 36 + .PP 37 + 38 + .HP 33 39 \fB\-D\fR, \fB\-\-daemon\fR 34 40 .IP 35 41 Run as a daemon process. ··· 91 85 - Bind usbip-host.ko to the device of busid 1-2. 92 86 - A usb device 1-2 is now exportable to other hosts! 93 87 - Use 'usbip unbind --busid=1-2' when you want to shutdown exporting and use the device locally. 88 + 89 + The following example shows the usage of device mode 90 + 91 + server:# modprobe usbip-vudc 92 + - Use /sys/class/udc/ interface. 93 + - usbip-host is independent of this module. 94 + 95 + server:# usbipd -e -D 96 + - Start usbip daemon in device mode. 97 + 98 + server:# modprobe g_mass_storage file=/tmp/tmp.img 99 + - Bind a gadget to usbip-vudc. 100 + - in this example, a mass storage gadget is bound. 101 + 102 + server:# usbip list --device 103 + - List gadgets exported by local usbipd server. 104 + 105 + server:# modprobe -r g_mass_storage 106 + - Unbind a gadget from usbip-vudc. 107 + - in this example, the previous mass storage gadget is unbound. 94 108 95 109 .SH "SEE ALSO" 96 110 \fBusbip\fP\fB(8)\fB\fP