Hello Alan! Thank's for your quick answer. Seems that we have to update our kernel as you said, to get a "good" solution. When we test your proposed solution with the kernel mentioned above we got the following message "Dec 3 16:11:11 localhost kernel: oh: dis_usb.c, ioctl USBDEVFS_RESET Dec 3 16:11:11 localhost kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000178". Do you think is because of "old" kernel or is it any other reason?
We are also testing a "raw" solution that seems to do the work, approx to do the things what happens when "hotplugged", see below: 1. rmmod "our usb-module" 2. insmod "our usb-module" 3. chmod 777 /udev/"our dev" 4. fxload -I "our hex-file" -D `ls -1 /proc/bus/usb/*/* | grep -v 001` // Per-Arne -----Ursprungligt meddelande----- Från: Alan Stern [mailto:[EMAIL PROTECTED] Skickat: den 3 december 2004 16:09 Till: Per Arne Söderkvist Kopia: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Ämne: Re: [Linux-usb-users] How to Reset/Reload a USB-device using EZUSB? On Fri, 3 Dec 2004, Per Arne Söderkvist wrote: > Hello! > > "We" are new into this and have now a question in this subject. > > We have managed to add hotplug "scripts/files" to load the hex-file to a > USB-device using EZ-USB, it works most of the time. But sometimes something > goes wrong (can't communicate correct with the device) and we want to > reset/reload the device, similar what happens if the USB-cable is > disconnected/connected to the computer. I.e. how to do this from a program? > > PS. > - We uses Fedora Core 2 with kernel 2.6.5-1.358 > DS. >From within a user program you can use the USBDEVFS_RESET ioctl to generate a port reset. That's not the same as disconnecting the cable because the Vbus power remains on throughout the procedure. Also note that the port reset code doesn't work properly in kernels before 2.6.9. Currently there is _no_ way to accurately simulate disconnecting the USB cable, including the loss of bus power. In fact lots of USB hardware doesn't even provide a way to turn off the power, although if your device is connected through an external USB hub then the hub should have that capability. At any rate the kernel doesn't provide any direct way for you to make use of it. I suppose your program could connect to the external hub and send it commands to clear and then set the port-power feature. This generally won't work with devices that are plugged directly into your computer. Alan Stern ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users