On Tue, 29 May 2007, Guillaume Dargaud wrote:
> > What do you see in /proc/bus/usb/devices? Maybe the interface is
> > already claimed by another driver.
>
> I think this is the relevant section:
>
> T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs= 1
> P: Vendor=0547 ProdID=2235 Rev=aa.06
> C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> I: If#= 0 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=ff Prot=ff Driver=
> I: If#= 0 Alt= 1 #EPs=13 Cls=ff(vend.) Sub=ff Prot=ff Driver=
> E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=10ms
> ...
> I: If#= 0 Alt= 2 #EPs=13 Cls=ff(vend.) Sub=ff Prot=ff Driver=
> E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=10ms
> ...
Hmmm. What version of the Linux kernel is this?
I'm puzzled. So far as I can tell, the only reason for getting -EBUSY
from a claim_interface call is because there is another driver bound to
the interface.
> Someone told me to call usb_detach_kernel_driver_np before
> usb_claim_interface but it doesn't change a thing: "No such device on the
> 1st" and "No such file or directory" on the 2nd.
The first and the second what?
> If after that I call set_altinterface anyway, I get -22 as a return value
> but errno remains at 0. Bug ?
In your previous email you listed this code:
> interface.interface = Interface;
> interface.altsetting = 1;
> errno=0;
> ret = ioctl(fd, USBDEVFS_SETINTERFACE, &interface);
> if (ret < 0)
> perror("Error setting Usb alternate");
> // returns "Device or resource busy"
If errno was 0 then the perror() would have printed out something like
"No error", not "Device or resource busy". Furthermore, ioctl()
doesn't return negative numbers like -22; when an error occurs it
returns -1. So I don't understand your point.
Does your program open the device file before or after the firmware
download is complete? Perhaps you need to open (or re-open) it after
the firmware is all sent.
Alan Stern
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users