David Brownell wrote:
> On Tuesday 22 August 2006 3:30 pm, Grahame Jordan wrote:
>> The device connects OK but after a short time it disconnects and in some 
>> cases the networking layer on Windows freezes until the USB cable is 
>> pulled out. Once the usb cable is put back in Widows reestablishes the 
>> connection for a short time and then does it again.
> 
> Never seen such failures (work for a while, then stop).

I have.

We've recently released two devices which use USB RNDIS networking. Our device
provides a DHCP server on the USB port so Windows can quickly get an IP address
and start working. This work very smoothly and quickly if all goes well. If I
do not provide DHCP on the USB device, I've found that Windows Networking can
freeze and requires a reboot.

I've handled many problems with connecting to and staying connected to Windows
XP machines. In almost every case the problem was with the PC and the user. The
major problem was the user unplugging and replugging too quickly. This is well
documented on the Microsoft website:

"USB port may stop working after removing or inserting USB device"
http://support.microsoft.com/kb/817900/

I have seen the situation where well timed re-plugging of the USB device can
cause USB networking to appear to work for about 30 seconds but then
itmysteriously stops working.

I am guessing this is because of some Windows Networking race condition. I 
figure:
* Each insertion of a USB network device probably spawns some Windows process
that handles the network connection and tries to obtain an IP address
* the USB device is removed
* the first process is still running but can't get any replies to DHCP requests
so is waiting for a timeout
* a new (or same) device is inserted, spawns a second process which succeeds to
obtain an IP address,
* the first process eventually times outs, returns and sees that the original
device is no longer there and it kills the network connection.

Only a guess though but it looks like this is happening.


> Windows freezing is by definition a bug in Microsoft code, but we
> all know how unlikely bugfixes to that code are.  :(

This is very hard to tell to customers though and it makes my life painful.

With most USB gadgets the device driver on the host doesn't need to perform
many other actions once the device is inserted. With a USB network device, the
host has to handle the networking configuration and it's very easy to get out
of sync if the device is removed before the networking configuration has
completed. The problem is increased because many networking protocols have such
long timeouts. e.g. waiting for a DHCP allocated IP address, etc. when compared
to, say, waiting for a USB Flash drive gadget to respond to read/write requests.

I can say this much about the Linux RNDIS device driver; with all the devices
that I installed and troubleshooted, I made sure that I *never* rebooted the
USB gadget to fix the problem. In every situation, the problem was solved by
either rebooting the PC, trying another USB port, removing "broken" USB devices
from the Windows Device Manager, or waiting for Windows Networking to connect
the device correctly.

Our device runs Linux 2.6.16 on an ARM AT91RM9200.

regards,

Aras Vaichas

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to