Since r2486 revision rtn fork supports USB/IP, which helps you to use USB devices without specific linux drivers at all!
USB/IP project now has restrictions with some compound USB-devices. We tested a number of USB-devices. Successfully:
- USB-HDD. R/W speed is ~5,5MB/s at ~60% CPU load,
- Canon printer with CARPS drivers,
- D-Link DBT-122 bluetooth dongle,
- USB mouse.
Won't work:
To use USB/IP it is necessary to tune a server part on a router and a client part on the PC where the USB-device will work on.
1. Tuning of the server part.
The server part consists of two kernel modules and a userspace daemon.
1.1. USB/IP modules are included in modules-1.9.2.7-rtn-rÕÕÕÕ.tgz. Download and plug them:
Code:
$ cd /opt
$ wget ftp://core.dumped.ru/rt-n/2486/modules-1.9.2.7-rtn-r2486.tar.gz
$ tar -xzvf ./modules-1.9.2.7-rtn-r2486.tar.gz
$ modprobe usbip
1.2. The userspace daemon is compiled as a ipk-package. You can attach a corresponding repository and do not think about manual updating. It is necessary to add following lines in a file/opt/etc/ipkg.conf
Code:
src/gz wl500g-d http://wl500g.googlecode.com/svn/ipkg/optware-d
src/gz wl500g-optware http://wl500g.googlecode.com/svn/ipkg/optware
and install the daemon:
Code:
$ ipkg install usbip
Start the server part:
Now we have to look at the list of USB-devices which can be exported:
Code:
$ usbip_bind_driver --list
List USB devices
- busid 2-2 (2001:f111)
2-2:1.0 -> none
2-2:1.1 -> none
2-2:1.2 -> none
- busid 1-1 (04fc:0c25)
1-1:1.0 -> usb-storage
The last USB-device 1-1 is a USB-HDD. Do not use uspip with it! Now it is necessary to make the device 2-2 accessible on the client side:
Code:
$ usbip_bind_driver --usbip 2-2
2. Tuning the client part.
The client part for Linux exists and is packaged in most of popular distributions. Windows client is here, lets make it work.
2.1. Install USB Bus enumerator driver with USBIPEnum.inf. If successfully installed, the device will be named "Virtual USB Bus Enumerator" in section "System Devices" on Device Manager.
2.2. Starting the userspace part. Usbip.exe must be started with Local Administrator credentials.
Lets look what devices are exported by the server:
Code:
C:\usbip>usbip.exe -l 192.168.0.1
usbip dbg: usbip_network.c: 229 (tcp_connect ) trying 192.168.0.1 port 3240
usbip dbg: usbip_network.c: 249 (tcp_connect ) connected to 192.168.0.1:3240
- RTRouter
usbip dbg: usbip.c: 423 (query_exported_devices) exportable 1 devices
2-2: unknown vendor : unknown product (2001:f111)
: /sys/devices/pci0000:00/0000:00:04.0/usb2/2-2
: unknown class / unknown subclass / unknown protocol (e0/01/01)
: 0 - unknown class / unknown subclass / unknown protocol (e0/01/01)
: 1 - unknown class / unknown subclass / unknown protocol (e0/01/01)
: 2 - unknown class / unknown subclass / unknown protocol (ff/ff/ff)
We see earlier exported device 2-2. Now connect it:
Code:
C:\usbip>usbip.exe -a 192.168.0.1 2-2
usbip dbg: usbip_network.c: 229 (tcp_connect ) trying 192.168.0.1 port 3240
usbip dbg: usbip_network.c: 249 (tcp_connect ) connected to 192.168.0.1:3240
usbip dbg: usbip.c: 147 (query_interface0) exportable 1 devices
usbip dbg: usbip.c: 164 (query_interface0) 2-2: unknown vendor : unknown product (2001:f111)
usbip dbg: usbip.c: 165 (query_interface0) : /sys/devices/pci0000:00/0000:00:04.0/usb2/2-2
usbip dbg: usbip.c: 166 (query_interface0) : unknown class / unknown subclass / unknown protocol (e0/01/01)
usbip dbg: usbip.c: 186 (query_interface0) : 0 - unknown class /unknown subclass / unknown protocol (e0/01/01)
usbip dbg: usbip.c: 186 (query_interface0) : 1 - unknown class /unknown subclass / unknown protocol (e0/01/01)
usbip dbg: usbip.c: 186 (query_interface0) : 2 - unknown class /unknown subclass / unknown protocol (ff/ff/ff)
usbip dbg: usbip.c: 189 (query_interface0)
usbip dbg: usbip_network.c: 229 (tcp_connect ) trying 192.168.0.1 port 3240
usbip dbg: usbip_network.c: 249 (tcp_connect ) connected to 192.168.0.1:3240
call from attch here
return from attch here
devfd:0022FF0C
new usb device attached to usbvbus port 1
Then there should be a driver installation dialogue of the device connected to the router. The device will be visible in the Device Manager as if its connected not to a router, but to windows PC. Don't close the window with the usbip.exe started!
3. Shutting down.
To shut down USB/IP correctly, it is necessary to execute above listed step in reverse order.
3.1. On the client side open a new cmd.exe window and type:
Code:
C:\usbip>usbip.exe -d 2-2
3.2. On the server side (the router), disconnect USB/IP driver from USB devices:
Code:
$ usbip_bind_driver --other 2-2
** (process:385): DEBUG: write "del 2-2" to /sys/bus/usb/drivers/usbip/match_busid
** Message: bind 2-2 to other drivers than usbip, complete while using USB-device!
Then stop the daemon:
4. Notes.
All the hard work for USB/IP adapting is done by theMIROn è lly. Thanks guys!