xref: /openbmc/linux/tools/usb/usbip/README (revision 588b48ca)
1588b48caSValentina Manea#
2588b48caSValentina Manea# README for usbip-utils
3588b48caSValentina Manea#
4588b48caSValentina Manea# Copyright (C) 2011 matt mooney <mfm@muteddisk.com>
5588b48caSValentina Manea#               2005-2008 Takahiro Hirofuchi
6588b48caSValentina Manea
7588b48caSValentina Manea
8588b48caSValentina Manea[Requirements]
9588b48caSValentina Manea    - USB/IP device drivers
10588b48caSValentina Manea	Found in the staging directory of the Linux kernel.
11588b48caSValentina Manea
12588b48caSValentina Manea    - libudev >= 2.0
13588b48caSValentina Manea	libudev library
14588b48caSValentina Manea
15588b48caSValentina Manea    - libwrap0-dev
16588b48caSValentina Manea	tcp wrapper library
17588b48caSValentina Manea
18588b48caSValentina Manea    - gcc >= 4.0
19588b48caSValentina Manea
20588b48caSValentina Manea    - libtool, automake >= 1.9, autoconf >= 2.5.0, pkg-config
21588b48caSValentina Manea
22588b48caSValentina Manea[Optional]
23588b48caSValentina Manea    - hwdata
24588b48caSValentina Manea        Contains USB device identification data.
25588b48caSValentina Manea
26588b48caSValentina Manea
27588b48caSValentina Manea[Install]
28588b48caSValentina Manea    0. Generate configuration scripts.
29588b48caSValentina Manea	$ ./autogen.sh
30588b48caSValentina Manea
31588b48caSValentina Manea    1. Compile & install the userspace utilities.
32588b48caSValentina Manea	$ ./configure [--with-tcp-wrappers=no] [--with-usbids-dir=<dir>]
33588b48caSValentina Manea	$ make install
34588b48caSValentina Manea
35588b48caSValentina Manea    2. Compile & install USB/IP drivers.
36588b48caSValentina Manea
37588b48caSValentina Manea
38588b48caSValentina Manea[Usage]
39588b48caSValentina Manea    server:# (Physically attach your USB device.)
40588b48caSValentina Manea
41588b48caSValentina Manea    server:# insmod usbip-core.ko
42588b48caSValentina Manea    server:# insmod usbip-host.ko
43588b48caSValentina Manea
44588b48caSValentina Manea    server:# usbipd -D
45588b48caSValentina Manea	- Start usbip daemon.
46588b48caSValentina Manea
47588b48caSValentina Manea    server:# usbip list -l
48588b48caSValentina Manea	- List driver assignments for USB devices.
49588b48caSValentina Manea
50588b48caSValentina Manea    server:# usbip bind --busid 1-2
51588b48caSValentina Manea	- Bind usbip-host.ko to the device with busid 1-2.
52588b48caSValentina Manea	- The USB device 1-2 is now exportable to other hosts!
53588b48caSValentina Manea	- Use `usbip unbind --busid 1-2' to stop exporting the device.
54588b48caSValentina Manea
55588b48caSValentina Manea    client:# insmod usbip-core.ko
56588b48caSValentina Manea    client:# insmod vhci-hcd.ko
57588b48caSValentina Manea
58588b48caSValentina Manea    client:# usbip list --remote <host>
59588b48caSValentina Manea	- List exported USB devices on the <host>.
60588b48caSValentina Manea
61588b48caSValentina Manea    client:# usbip attach --remote <host> --busid 1-2
62588b48caSValentina Manea	- Connect the remote USB device.
63588b48caSValentina Manea
64588b48caSValentina Manea    client:# usbip port
65588b48caSValentina Manea	- Show virtual port status.
66588b48caSValentina Manea
67588b48caSValentina Manea    client:# usbip detach --port <port>
68588b48caSValentina Manea	- Detach the USB device.
69588b48caSValentina Manea
70588b48caSValentina Manea
71588b48caSValentina Manea[Example]
72588b48caSValentina Manea---------------------------
73588b48caSValentina Manea	SERVER SIDE
74588b48caSValentina Manea---------------------------
75588b48caSValentina ManeaPhysically attach your USB devices to this host.
76588b48caSValentina Manea
77588b48caSValentina Manea    trois:# insmod path/to/usbip-core.ko
78588b48caSValentina Manea    trois:# insmod path/to/usbip-host.ko
79588b48caSValentina Manea    trois:# usbipd -D
80588b48caSValentina Manea
81588b48caSValentina ManeaIn another terminal, let's look up what USB devices are physically
82588b48caSValentina Maneaattached to this host.
83588b48caSValentina Manea
84588b48caSValentina Manea    trois:# usbip list -l
85588b48caSValentina Manea    Local USB devices
86588b48caSValentina Manea    =================
87588b48caSValentina Manea     - busid 1-1 (05a9:a511)
88588b48caSValentina Manea	     1-1:1.0 -> ov511
89588b48caSValentina Manea
90588b48caSValentina Manea     - busid 3-2 (0711:0902)
91588b48caSValentina Manea	     3-2:1.0 -> none
92588b48caSValentina Manea
93588b48caSValentina Manea     - busid 3-3.1 (08bb:2702)
94588b48caSValentina Manea	     3-3.1:1.0 -> snd-usb-audio
95588b48caSValentina Manea	     3-3.1:1.1 -> snd-usb-audio
96588b48caSValentina Manea
97588b48caSValentina Manea     - busid 3-3.2 (04bb:0206)
98588b48caSValentina Manea	     3-3.2:1.0 -> usb-storage
99588b48caSValentina Manea
100588b48caSValentina Manea     - busid 3-3 (0409:0058)
101588b48caSValentina Manea	     3-3:1.0 -> hub
102588b48caSValentina Manea
103588b48caSValentina Manea     - busid 4-1 (046d:08b2)
104588b48caSValentina Manea	     4-1:1.0 -> none
105588b48caSValentina Manea	     4-1:1.1 -> none
106588b48caSValentina Manea	     4-1:1.2 -> none
107588b48caSValentina Manea
108588b48caSValentina Manea     - busid 5-2 (058f:9254)
109588b48caSValentina Manea	     5-2:1.0 -> hub
110588b48caSValentina Manea
111588b48caSValentina ManeaA USB storage device of busid 3-3.2 is now bound to the usb-storage
112588b48caSValentina Maneadriver. To export this device, we first mark the device as
113588b48caSValentina Manea"exportable"; the device is bound to the usbip-host driver. Please
114588b48caSValentina Manearemember you can not export a USB hub.
115588b48caSValentina Manea
116588b48caSValentina ManeaMark the device of busid 3-3.2 as exportable:
117588b48caSValentina Manea
118588b48caSValentina Manea    trois:# usbip --debug bind --busid 3-3.2
119588b48caSValentina Manea    ...
120588b48caSValentina Manea    usbip debug: usbip_bind.c:162:[unbind_other] 3-3.2:1.0 -> usb-storage
121588b48caSValentina Manea    ...
122588b48caSValentina Manea    bind device on busid 3-3.2: complete
123588b48caSValentina Manea
124588b48caSValentina Manea    trois:# usbip list -l
125588b48caSValentina Manea    Local USB devices
126588b48caSValentina Manea    =================
127588b48caSValentina Manea    ...
128588b48caSValentina Manea
129588b48caSValentina Manea     - busid 3-3.2 (04bb:0206)
130588b48caSValentina Manea	     3-3.2:1.0 -> usbip-host
131588b48caSValentina Manea    ...
132588b48caSValentina Manea
133588b48caSValentina Manea---------------------------
134588b48caSValentina Manea	CLIENT SIDE
135588b48caSValentina Manea---------------------------
136588b48caSValentina ManeaFirst, let's list available remote devices that are marked as
137588b48caSValentina Maneaexportable on the host.
138588b48caSValentina Manea
139588b48caSValentina Manea    deux:# insmod path/to/usbip-core.ko
140588b48caSValentina Manea    deux:# insmod path/to/vhci-hcd.ko
141588b48caSValentina Manea
142588b48caSValentina Manea    deux:# usbip list --remote 10.0.0.3
143588b48caSValentina Manea    Exportable USB devices
144588b48caSValentina Manea    ======================
145588b48caSValentina Manea     - 10.0.0.3
146588b48caSValentina Manea	    1-1: Prolific Technology, Inc. : unknown product (067b:3507)
147588b48caSValentina Manea	       : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-1
148588b48caSValentina Manea	       : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
149588b48caSValentina Manea	       :  0 - Mass Storage / SCSI / Bulk (Zip) (08/06/50)
150588b48caSValentina Manea
151588b48caSValentina Manea	1-2.2.1: Apple Computer, Inc. : unknown product (05ac:0203)
152588b48caSValentina Manea	       : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.1
153588b48caSValentina Manea	       : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
154588b48caSValentina Manea	       :  0 - Human Interface Devices / Boot Interface Subclass / Keyboard (03/01/01)
155588b48caSValentina Manea
156588b48caSValentina Manea	1-2.2.3: OmniVision Technologies, Inc. : OV511+ WebCam (05a9:a511)
157588b48caSValentina Manea	       : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.3
158588b48caSValentina Manea	       : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
159588b48caSValentina Manea	       :  0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00)
160588b48caSValentina Manea
161588b48caSValentina Manea	    3-1: Logitech, Inc. : QuickCam Pro 4000 (046d:08b2)
162588b48caSValentina Manea	       : /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/usb3/3-1
163588b48caSValentina Manea	       : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
164588b48caSValentina Manea	       :  0 - Data / unknown subclass / unknown protocol (0a/ff/00)
165588b48caSValentina Manea	       :  1 - Audio / Control Device / unknown protocol (01/01/00)
166588b48caSValentina Manea	       :  2 - Audio / Streaming / unknown protocol (01/02/00)
167588b48caSValentina Manea
168588b48caSValentina ManeaAttach a remote USB device:
169588b48caSValentina Manea
170588b48caSValentina Manea    deux:# usbip attach --remote 10.0.0.3 --busid 1-1
171588b48caSValentina Manea    port 0 attached
172588b48caSValentina Manea
173588b48caSValentina ManeaShow the devices attached to this client:
174588b48caSValentina Manea
175588b48caSValentina Manea    deux:# usbip port
176588b48caSValentina Manea    Port 00: <Port in Use> at Full Speed(12Mbps)
177588b48caSValentina Manea	   Prolific Technology, Inc. : unknown product (067b:3507)
178588b48caSValentina Manea	   6-1 -> usbip://10.0.0.3:3240/1-1  (remote bus/dev 001/004)
179588b48caSValentina Manea	   6-1:1.0 used by usb-storage
180588b48caSValentina Manea			  /sys/class/scsi_device/0:0:0:0/device
181588b48caSValentina Manea			  /sys/class/scsi_host/host0/device
182588b48caSValentina Manea			  /sys/block/sda/device
183588b48caSValentina Manea
184588b48caSValentina ManeaDetach the imported device:
185588b48caSValentina Manea
186588b48caSValentina Manea    deux:# usbip detach --port 0
187588b48caSValentina Manea    port 0 detached
188588b48caSValentina Manea
189588b48caSValentina Manea
190588b48caSValentina Manea[Checklist]
191588b48caSValentina Manea    - See 'Debug Tips' on the project wiki.
192588b48caSValentina Manea	- http://usbip.wiki.sourceforge.net/how-to-debug-usbip
193588b48caSValentina Manea    - usbip-host.ko must be bound to the target device.
194588b48caSValentina Manea	- See /proc/bus/usb/devices and find "Driver=..." lines of the device.
195588b48caSValentina Manea    - Shutdown firewall.
196588b48caSValentina Manea	- usbip now uses TCP port 3240.
197588b48caSValentina Manea    - Disable SELinux.
198588b48caSValentina Manea    - Check the kernel and daemon messages.
199588b48caSValentina Manea
200588b48caSValentina Manea
201588b48caSValentina Manea[Contact]
202588b48caSValentina Manea    Mailing List: linux-usb@vger.kernel.org
203