Discussion:
[libusb] libusb / usbip interworking on Windows
Lee Moore
2015-03-30 10:26:20 UTC
Permalink
Hi All,

I have a very specific situation which I need advice.

I have the following setup

#
# Remote machine
#
Linux running USBIP (server) with a binded usb device (mass storage)

#
# Local Machine
#
Windows7 running USBIP (client) attached to remote usb device (from above)

The Windows device manager can see the mass storage device listed, but
if I use libusb
and specifically if I use the example for enumerating devices -
listdevs.exe
I see nothing listed. I would expect to see the mass storage device

Can anyone suggest a way that I can get libusb to recognize the devices
which are attached
using USBIP ?

FYI, I do not have this issue when running the USBIP client and libusb
on another Linux machine
unfortunately my requirement, is for the client to be running under
Windows.

Any help appreciated, but I have a hard restriction that the client is
running under Windows7

The host usbip remote server, could be either Linux or Windows -
but that does not appear to be the issue anyway

Many Thx
Lee
Tim Roberts
2015-03-30 17:10:25 UTC
Permalink
Post by Lee Moore
#
# Remote machine
#
Linux running USBIP (server) with a binded usb device (mass storage)
#
# Local Machine
#
Windows7 running USBIP (client) attached to remote usb device (from above)
The Windows device manager can see the mass storage device listed, but
if I use libusb
and specifically if I use the example for enumerating devices -
listdevs.exe
I see nothing listed. I would expect to see the mass storage device
When libusb goes to find devices on Windows, it has an enumerated list
of the drivers that qualify as "USB hub" drivers. It only looks for
devices under those hub drivers. It's likely that USBIP has invented
its own hub driver.

If that's the case, you ought to be able to modify the list to include
the USBIP hub driver. You should be able to figure out the driver's
service name in Device Manager. There's no guarantee that the USBIP hub
follows all of the normal hub protocols (some of which are not fully
documented), but it's worth a try.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Pink Boy
2015-03-31 01:01:32 UTC
Permalink
Lee,

Not that I can help but odd you should mention. At my work we use a
standalone 4 port USB server as part of a test stand.

http://www.titan.tw/product/NETUSB_400i.html

It totally works with an AVRISP mkII, totally works with a PEMicro
Multilink. I think these are both using Jungo based drivers.

With a USBDM open source programmer (http://usbdm.sourceforge.net/)
using libusb, does not work on the remote USB ports.

Sort of same thing, shows up correctly under the windows device manager,
but using a slightly haxed version of listdevs.exe it the idVendor field
shows up as a 'hub id'. I tried downloading the Microsoft USB monitoring
tool, looks fine.

You might look and see if phantom hub shows up with listdevs.exe when
you attach your USB device remotely.

If so maybe someone else has an idea why this happens?

Also the developers list appears to be where most of the libusb
eyeballs are, so might consider posting there.

Matt
Post by Lee Moore
Hi All,
I have a very specific situation which I need advice.
I have the following setup
#
# Remote machine
#
Linux running USBIP (server) with a binded usb device (mass
storage)
#
# Local Machine
#
Windows7 running USBIP (client) attached to remote usb device
(from above)
The Windows device manager can see the mass storage device listed,
but if I use libusb
and specifically if I use the example for enumerating devices -
listdevs.exe
I see nothing listed. I would expect to see the mass storage
device
Can anyone suggest a way that I can get libusb to recognize the
devices which are attached
using USBIP ?
FYI, I do not have this issue when running the USBIP client and
libusb on another Linux machine
unfortunately my requirement, is for the client to be running
under Windows.
Any help appreciated, but I have a hard restriction that the
client is running under Windows7
The host usbip remote server, could be either Linux or Windows -
but that does not appear to be the issue anyway
Many Thx
Lee
Post by Lee Moore
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media,
is your hub for all things parallel software development, from weekly
thought leadership blogs to news, videos, case studies, tutorials and
more. Take a look and join the conversation now.
http://goparallel.sourceforge.net/
_________________________________________________
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Uri Lublin
2015-03-31 08:54:40 UTC
Permalink
Post by Lee Moore
Hi All,
I have a very specific situation which I need advice.
I have the following setup
#
# Remote machine
#
Linux running USBIP (server) with a binded usb device (mass storage)
#
# Local Machine
#
Windows7 running USBIP (client) attached to remote usb device (from above)
The Windows device manager can see the mass storage device listed, but
if I use libusb
and specifically if I use the example for enumerating devices -
listdevs.exe
I see nothing listed. I would expect to see the mass storage device
Can anyone suggest a way that I can get libusb to recognize the devices
which are attached
using USBIP ?
Hi Lee,

What driver is installed for that device according to Windows Device
Manager ? Is it usbstor ?
If it is usbstor, try installing on the Windows client side, for that
specific device, a driver that is recognized by libusb, such as WinUSB.
You can use zadig for that.

Uri.
Lee Moore
2015-03-31 11:44:05 UTC
Permalink
Hi Uri
Post by Uri Lublin
What driver is installed for that device according to Windows Device
Manager ? Is it usbstor ?
If it is usbstor, try installing on the Windows client side, for that
specific device, a driver that is recognized by libusb, such as WinUSB.
You can use zadig for that.
Many thanks for the suggestion, I used Zadig and tried the following

Firstly the device appears as "USB Device Over IP"
and the driver is "USBSTOR (v6.1.7601.17577)"
The device appears at USB-ID 08EC:0015

I replace the driver with WinUSB

Now I get a new entry under devices
"Universal Serial Bus Devices ->USB Device over IP"

when I try the libusb example command, listdevs.exe, I do not get this
device listed

any ideas ?

Thx
Lee
Uri Lublin
2015-03-31 16:16:44 UTC
Permalink
Post by Lee Moore
Hi Uri
Post by Uri Lublin
What driver is installed for that device according to Windows Device
Manager ? Is it usbstor ?
If it is usbstor, try installing on the Windows client side, for that
specific device, a driver that is recognized by libusb, such as WinUSB.
You can use zadig for that.
Many thanks for the suggestion, I used Zadig and tried the following
Firstly the device appears as "USB Device Over IP"
and the driver is "USBSTOR (v6.1.7601.17577)"
The device appears at USB-ID 08EC:0015
I replace the driver with WinUSB
Now I get a new entry under devices
"Universal Serial Bus Devices ->USB Device over IP"
when I try the libusb example command, listdevs.exe, I do not get this
device listed
any ideas ?
Sorry, no more simple ideas.

You can try to turn on debug logging (by defining ENABLE_DEBUG_LOGGING
and maybe also ENUM_DEBUG), but it may not be easy to understand where
the problem is.
Lee Moore
2015-03-31 18:14:24 UTC
Permalink
Hi Uri
Post by Uri Lublin
Sorry, no more simple ideas.
You can try to turn on debug logging (by defining ENABLE_DEBUG_LOGGING
and maybe also ENUM_DEBUG), but it may not be easy to understand where
the problem is.
I couldnt work out how to get this logging enabled, so ended up
scattering printfs throughout the code.
What I see is the following.

After installing the Zadig WinUSB driver, I then have a device tree
which has the following

- Universal Serial Bus Controllers
|- Generic USB Hub
|...

(and a new item in the tree)
- Universal Serial Bus Devices
|- USB Device Over IP


And when I instrumented the libusb code, I saw that it decides this
device has no parent, this is a pruned output
from my own debug messages, the device which is attached by usbip is
059B:0032, as can be seen below it is
ignored. I am thinking that this is because it appears in its own part
of the device tree under 'Universal Serial Bus Devices'
is it supposed to appear under ' Universal Serial Bus Controllers' ?

DBG: #### PROCESSING GENs
DBG: PRO: \\.\USB#VID_059B&PID_0032#1&1AAFB3D5&0&01
DBG: ancestor=1 session_id=224
DBG: parent_dev=0
DBG: ancestor=2 session_id=990
DBG: parent_dev=0
DBG: ancestor=3 session_id=0
DBG: unlisted ancestor for '\\.\USB#VID_059B&PID_0032#1&1AAFB3D5&0&01'
(non USB HID, newly connected, etc.) - ignoring

DBG: #### PROCESSING DEVs {A5DCBF10-6530-11D2-901F-00C04FB951ED}
DBG: PRO: \\.\USB#VID_059B&PID_0032#1&1AAFB3D5&0&01
DBG: '\\.\USB#VID_059B&PID_0032#1&1AAFB3D5&0&01' was only detected in
late pass (newly connected device?) - ignoring


DBG: #### PROCESSING EXTs {76AB4223-05E2-4527-BE9B-5C2F6C18569B}
DBG: PRO: \\.\USB#VID_059B&PID_0032#1&1AAFB3D5&0&01
DBG: ancestor=1 session_id=224
DBG: parent_dev=0
DBG: ancestor=2 session_id=990
DBG: parent_dev=0
DBG: ancestor=3 session_id=0
DBG: unlisted ancestor for '\\.\USB#VID_059B&PID_0032#1&1AAFB3D5&0&01'
(non USB HID, newly connected, etc.) - ignoring


Many Thx
Lee
Tim Roberts
2015-03-31 19:07:34 UTC
Permalink
Post by Lee Moore
After installing the Zadig WinUSB driver, I then have a device tree
which has the following
- Universal Serial Bus Controllers
|- Generic USB Hub
|...
(and a new item in the tree)
- Universal Serial Bus Devices
|- USB Device Over IP
What do you see if you change the view to "Devices by connection"? That
should show you the parentage. What is the parent of "USB Device Over IP"?
Post by Lee Moore
I am thinking that this is because it appears in its own part
of the device tree under 'Universal Serial Bus Devices'
is it supposed to appear under ' Universal Serial Bus Controllers' ?
No. Your placement in the Device Manager "Devices by type" view is
entirely determined by the "Class=" string in the INF file that
installed it. It does not reflect parentage in any way. It merely
groups by install class. Although the "USB Controllers" class has been
abused over the years, it is only supposed to be used by host
controllers and hubs.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Xiaofan Chen
2015-04-01 03:45:48 UTC
Permalink
Post by Lee Moore
Hi All,
I have a very specific situation which I need advice.
I have the following setup
#
# Remote machine
#
Linux running USBIP (server) with a binded usb device (mass storage)
#
# Local Machine
#
Windows7 running USBIP (client) attached to remote usb device (from above)
The Windows device manager can see the mass storage device listed, but if I
use libusb
and specifically if I use the example for enumerating devices - listdevs.exe
I see nothing listed. I would expect to see the mass storage device
Can anyone suggest a way that I can get libusb to recognize the devices
which are attached
using USBIP ?
FYI, I do not have this issue when running the USBIP client and libusb on
another Linux machine
unfortunately my requirement, is for the client to be running under Windows.
Any help appreciated, but I have a hard restriction that the client is
running under Windows7
The host usbip remote server, could be either Linux or Windows -
but that does not appear to be the issue anyway
Forget about usbip for the Windows client. It is already a dead project.
Nobody can maintain the Windows clinet side driver.

I am wondering if Spice can be a solution for you.

Ref:
http://sourceforge.net/p/usbip/mailman/message/33549954/
--
Xiaofan
Lee Moore
2015-04-01 08:55:57 UTC
Permalink
Hi Tim
Post by Tim Roberts
What do you see if you change the view to "Devices by connection"? That
should show you the parentage. What is the parent of "USB Device Over IP"?
No. Your placement in the Device Manager "Devices by type" view is
entirely determined by the "Class=" string in the INF file that
installed it. It does not reflect parentage in any way. It merely
groups by install class. Although the "USB Controllers" class has been
abused over the years, it is only supposed to be used by host
controllers and hubs.
If I change to "Devices by connection", I see the following

- USB/IP Enumerator
|--- USB Device Over IP

I also see another series of the following items with no hierarchy /
children
- USB/IP Enumerator

Thx
Lee
Tim Roberts
2015-04-01 16:53:43 UTC
Permalink
Post by Lee Moore
If I change to "Devices by connection", I see the following
- USB/IP Enumerator
|--- USB Device Over IP
Well, that's the problem. There is no USB hub in this tree. The bus
driver (the "USB/IP Enumerator") is creating USB device objects
directly, without following the hub protocol. I don't think libusb will
be able to drive this device.

You should be able to use WinUSB directly.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Loading...