HI, did you remember me? I can't with this.
Now I get the next result after disconnect usbdevice, then connect,
and send data bulk.

kernel: usb 2-1: usbfs: USBDEVFS_BULK failed ep 0x1 len 4 ret -22


This is the code 

        fd = open("/proc/bus/usb/002/002", O_RDWR);
        if(fd != -1) {
                bulk.ep = 1;
                bulk.len = 4;
                bulk.data = data;
                bulk.timeout = 1000;
                ioctl(fd, USBDEVFS_BULK, &bulk);
                perror("ioctl");
                close(fd);
        } 

Thank you

> > This is /proc/bus/usb/devices when I plug the PIC:
> >
> > T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
> > D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> > P:  Vendor=0000 ProdID=0000 Rev= 0.00
> > S:  Manufacturer=Vicctor Lomaa
> > S:  Product=PicNetUSB
> > C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> > I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
> > E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
> > E:  Ad=01(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
> >
> >
> > When I disconnect by software the PIC I got this:
> >
> > T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
> > D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> > P:  Vendor=0000 ProdID=0000 Rev= 0.00
> > S:  Manufacturer=Vicctor Lomaa
> > S:  Product=PicNetUSB
> > C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> > I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)
> > E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
> > E:  Ad=01(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
> >
> >
> > The only difference is the Driver, in the first is usbhid and the
> > second is (none)
> 
> That's exactly what it should be.
> 
> > Other stuff, when I Disconnect by software
> >
> > ctrl.ioctl_code = USBDEVFS_DISCONNECT;
> > ioctl(fd, USBDEVFS_IOCTL, &ctrl);
> >
> > I got succes and when I claim with
> > ioctl(fd, USBDEVFS_CLAIMINTERFACE, &interface);
> > I got succes but when I send a data with
> > ioctl(fd, USBDEVFS_BULK, &bulk);
> > I got ioctl: Invalid argument
> 
> There are a few things which can cause that error.  Provided bulk.ep is
> set to 1 and bulk.len is set to something reasonable (like 4) it shouldn't
> occur.
> 
> In the end you may have to poke around in the kernel to find out just what
> the problem is.  A good place to start would be the proc_bulk() routine in
> drivers/usb/core/devio.c.
> 
> Alan Stern
> 
> 


-- 
¡¡Abajo los imperialistas!!
No a la invasión en Irak


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to