~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/staging/usbip/userspace/README

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:tw=78:ts=4:expandtab:ai:sw=4
 
2
#
 
3
# README for usbip-utils
 
4
#
 
5
# Copyright (C) 2005-2008 Takahiro Hirofuchi
 
6
 
 
7
 
 
8
[Requirements]
 
9
    - USB/IP device drivers
 
10
        Its source code is included under $(top)/drivers/.
 
11
 
 
12
    - sysfsutils >= 2.0.0
 
13
        sysfsutils library
 
14
 
 
15
    - libwrap0-dev
 
16
        tcp wrapper library
 
17
 
 
18
    - gcc >= 4.0
 
19
 
 
20
    - libglib2.0-dev >= 2.6.0
 
21
 
 
22
    - libtool, automake >= 1.9, autoconf >= 2.5.0, pkg-config
 
23
 
 
24
[Install]
 
25
    0. Skip here if you see a configure script.
 
26
        $ ./autogen.sh
 
27
 
 
28
    1. Compile & install.
 
29
        $ ./configure
 
30
        $ make install
 
31
 
 
32
    2. Compile & install USB/IP drivers if not yet.
 
33
 
 
34
[Usage]
 
35
    server:# (Attach your USB device physically.)
 
36
 
 
37
    server:# insmod usbip-core.ko
 
38
    server:# insmod usbip-host.ko
 
39
        - It was formerly named as stub.ko.
 
40
 
 
41
    server:# usbipd -D
 
42
        - Start usbip daemon.
 
43
 
 
44
    server:# usbip_bind_driver --list
 
45
        - List driver assignments for usb devices.
 
46
 
 
47
    server:# usbip_bind_driver --usbip 1-2
 
48
        - Bind usbip-host.ko to the device of busid 1-2.
 
49
        - A usb device 1-2 is now exportable to other hosts!
 
50
        - Use 'usbip_bind_driver --other 1-2' when you want to shutdown exporting
 
51
          and use the device locally.
 
52
 
 
53
 
 
54
    client:# insmod usbip-core.ko
 
55
    client:# insmod vhci-hcd.ko
 
56
        - It was formerly named as vhci.ko.
 
57
 
 
58
    client:# usbip --list server
 
59
        - List exportable usb devices on the server.
 
60
 
 
61
    client:# usbip --attach server 1-2
 
62
        - Connect the remote USB device.
 
63
 
 
64
    client:# usbip --port
 
65
        - Show virtual port status.
 
66
 
 
67
    client:# usbip --detach 0
 
68
        - Detach the usb device.
 
69
 
 
70
 
 
71
[Output Example]
 
72
--------------------------------------------------------------------------------------------------------
 
73
- SERVER SIDE (physically attach your USB devices to this host) ----------------------------------------
 
74
--------------------------------------------------------------------------------------------------------
 
75
trois:# insmod (somewhere)/usbip-core.ko
 
76
trois:# insmod (somewhere)/usbip-host.ko
 
77
trois:# usbipd -D
 
78
 
 
79
--------------------------------------------------------------------------------------------------------
 
80
In another terminal, let's look up what usb devices are physically attached to
 
81
this host.  We can see a usb storage device of busid 3-3.2 is now bound to
 
82
usb-storage driver. To export this device, we first mark the device as
 
83
"exportable"; the device is bound to usbip driver. Please remember you can not
 
84
export a usb hub.
 
85
 
 
86
   trois:# usbip_bind_driver --list
 
87
   List USB devices
 
88
   - busid 3-3.2 (04bb:0206)
 
89
       3-3.2:1.0 -> usb-storage
 
90
 
 
91
   - busid 3-3.1 (08bb:2702)
 
92
       3-3.1:1.0 -> snd-usb-audio
 
93
       3-3.1:1.1 -> snd-usb-audio
 
94
 
 
95
   - busid 3-3 (0409:0058)
 
96
       3-3:1.0 -> hub
 
97
 
 
98
   - busid 3-2 (0711:0902)
 
99
       3-2:1.0 -> none
 
100
 
 
101
   - busid 1-1 (05a9:a511)
 
102
       1-1:1.0 -> ov511
 
103
 
 
104
   - busid 4-1 (046d:08b2)
 
105
       4-1:1.0 -> none
 
106
       4-1:1.1 -> none
 
107
       4-1:1.2 -> none
 
108
 
 
109
   - busid 5-2 (058f:9254)
 
110
       5-2:1.0 -> hub
 
111
 
 
112
--------------------------------------------------------------------------------------------------------
 
113
Mark the device of busid 3-3.2 as exportable.
 
114
 
 
115
   trois:# usbip_bind_driver --usbip 3-3.2
 
116
   ** (process:24621): DEBUG:  3-3.2:1.0   -> none
 
117
   ** (process:24621): DEBUG: write "add 3-3.2" to /sys/bus/usb/drivers/usbip/match_busid
 
118
   ** Message: bind 3-3.2 to usbip, complete!
 
119
 
 
120
   trois:# usbip_bind_driver --list
 
121
   List USB devices
 
122
   - busid 3-3.2 (04bb:0206)
 
123
           3-3.2:1.0 -> usbip
 
124
   (snip)
 
125
 
 
126
Iterate the above operation for other devices if you like.
 
127
 
 
128
 
 
129
--------------------------------------------------------------------------------------------------------
 
130
- CLIENT SIDE ------------------------------------------------------------------------------------------
 
131
--------------------------------------------------------------------------------------------------------
 
132
First, let's list available remote devices which are marked as exportable in
 
133
the server host.
 
134
 
 
135
   deux:# insmod (somewhere)/usbip-core.ko
 
136
   deux:# insmod (somewhere)/vhci_hcd.ko
 
137
 
 
138
   deux:# usbip --list 10.0.0.3
 
139
   - 10.0.0.3
 
140
          1-1: Prolific Technology, Inc. : unknown product (067b:3507)
 
141
             : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-1
 
142
             : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
 
143
             :  0 - Mass Storage / SCSI / Bulk (Zip) (08/06/50)
 
144
 
 
145
      1-2.2.1: Apple Computer, Inc. : unknown product (05ac:0203)
 
146
             : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.1
 
147
             : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
 
148
             :  0 - Human Interface Devices / Boot Interface Subclass / Keyboard (03/01/01)
 
149
 
 
150
      1-2.2.3: OmniVision Technologies, Inc. : OV511+ WebCam (05a9:a511)
 
151
             : /sys/devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2.2/1-2.2.3
 
152
             : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
 
153
             :  0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00)
 
154
 
 
155
          3-1: Logitech, Inc. : QuickCam Pro 4000 (046d:08b2)
 
156
             : /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/usb3/3-1
 
157
             : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
 
158
             :  0 - Data / unknown subclass / unknown protocol (0a/ff/00)
 
159
             :  1 - Audio / Control Device / unknown protocol (01/01/00)
 
160
             :  2 - Audio / Streaming / unknown protocol (01/02/00)
 
161
 
 
162
          4-1: Logitech, Inc. : QuickCam Express (046d:0870)
 
163
             : /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.1/usb4/4-1
 
164
             : Vendor Specific Class / Vendor Specific Subclass / Vendor Specific Protocol (ff/ff/ff)
 
165
             :  0 - Vendor Specific Class / Vendor Specific Subclass / Vendor Specific Protocol (ff/ff/ff)
 
166
 
 
167
          4-2: Texas Instruments Japan : unknown product (08bb:2702)
 
168
             : /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.1/usb4/4-2
 
169
             : (Defined at Interface level) / unknown subclass / unknown protocol (00/00/00)
 
170
             :  0 - Audio / Control Device / unknown protocol (01/01/00)
 
171
             :  1 - Audio / Streaming / unknown protocol (01/02/00)
 
172
 
 
173
--------------------------------------------------------------------------------------------------------
 
174
Attach a remote usb device!
 
175
 
 
176
   deux:# usbip --attach 10.0.0.3 1-1
 
177
   port 0 attached
 
178
 
 
179
--------------------------------------------------------------------------------------------------------
 
180
Show what devices are attached to this client.
 
181
 
 
182
   deux:# usbip --port
 
183
   Port 00: <Port in Use> at Full Speed(12Mbps)
 
184
          Prolific Technology, Inc. : unknown product (067b:3507)
 
185
          6-1 -> usbip://10.0.0.3:3240/1-1  (remote bus/dev 001/004)
 
186
          6-1:1.0 used by usb-storage
 
187
                         /sys/class/scsi_device/0:0:0:0/device
 
188
                         /sys/class/scsi_host/host0/device
 
189
                         /sys/block/sda/device
 
190
 
 
191
--------------------------------------------------------------------------------------------------------
 
192
Detach the imported device.
 
193
 
 
194
   deux:# usbip --detach 0
 
195
   port 0 detached
 
196
 
 
197
--------------------------------------------------------------------------------------------------------
 
198
 
 
199
 
 
200
[Check List]
 
201
    - See Debug Tips in the project wiki.
 
202
        - http://usbip.wiki.sourceforge.net/how-to-debug-usbip
 
203
    - usbip-host.ko must be bound to the target device.
 
204
        - See /proc/bus/usb/devices and find "Driver=..." lines of the device.
 
205
    - Shutdown firewall.
 
206
        - usbip now uses TCP port 3240.
 
207
    - Disable SELinux.
 
208
    - If possible, compile your kernel with CONFIG_USB_DEBUG flag and try
 
209
      again.
 
210
    - Check your kernel and daemon messages.
 
211
        ex. /var/log/{messages, kern.log, daemon.log, syslog}
 
212
 
 
213
 
 
214
[Contact]
 
215
    Mailing List: usbip-devel _at_ lists.sourceforge.net