I am having a problem with a rt2870 device that I believe is related to the driver and/or usb subsystem.
I have several wifi adapters (DNUR-83 from unex corporation, which uses the rt2870 and provides a usb interface with their EX-04 board) as well as several asus eeePCs running Xandros linux.
I have a routine which runs `iwlist ra0 scan` over-and-over again to continually scan for new wifi. The wifi is not explicitly being used by anything else. After a while (sometimes 5 minutes, sometimes several hours), the device enters a bad state and begins failing. It starts returning no scan results. i.e. iwlist ra0 scan will say "ra0 No scan results." Removing the adapter and plugging it back in does not fix the problem. Rebooting the device will fix it, and typing `modprobe -r uchi_hcd ehci_hcd` will also fix it. If I unplug an adapter from an eeepc in a bad state and plug it into a different eeepc, it will work. If I take a different adapter which was working properly and plug it into an eeepc which had an adapter failing, it will continue to fail. Thus, there is very strong evidence that there is state stored on the eeepc device, independent of the particular adapter, that causes these problems.
I create this problem using two different scripts - one is a basic bash shell script, here is the source:
while [ $success -eq 0 ]; do
iwlist ra0 scan 1>> /home/user/scan.log 2>&1
echo -e "\nnext scan\n" >> /home/user/scan.log
The other is a perl script which is much more complicated, but the basic idea is that it hits the driver with a siwscan command, followed by a short pause and then giwscan commands until we get a scan result. The perl script seems to cause the problem faster than the bash script.
When it is in a bad state, something also keeps dumping "# " into dmesg. There's lines such as [ 8495.660000] #, with no other useful information.
Has anyone encountered this problem before? Any ideas on how to fix it, or how to approach this problem? Any more information I can provide? I'd like it if this didn't happen at all, rather than needing to do the modprobe workaround which has a lot of other side effects (such as resetting all the other usb devices attached)