On Wed, 24 Aug 2005, Peter Urbanec wrote:

> >>Will an USBDEVFS_BULK with 
> >>usbdevfs_bulktransfer.len = 0 have the same effect?
> >
> >In principle it ought to.  If the ioctl works then it will have the same 
> >effect.  However it might not work, since the usbdevfs code doesn't really 
> >expect to see transfer lengths of 0.  Try it and see.
> 
> Well, my test with 2.6.12-gentoo-r7 didn't end up being productive.
> Attempting to send a bulk message of zero bytes results in: ehci_hcd
> 0000:00:1d.7: devpath 5 ep1out 3strikes. The usbfs ioctl() call returns
> with -EPROTO "Protocol error"

That's not as bad as it sounds.  (I was afraid the ioctl would fail with
-ENOMEM.)  It means the 0-length packet actually did get sent, but the
device failed to respond to it.  Of course, knowing this doesn't help you
very much...

> It looks like I'll have to go down the path of submitting URBs so that I
> can set the URB_ZERO_PACKET flag. The usbfs doco is a bit sketchy on
> this, so perhaps I'll have to resort to writing a USB device driver for
> this device after all.

To supplement the documentation, try reading the source code.  Start with 
usbdev_ioctl() in drivers/usb/core/devio.c.

You might also try using a non-EHCI controller, to see if it makes any 
difference.  All you have to do is rmmod ehci-hcd.  Maybe then the 
0-length bulk submission will work.

Alan Stern



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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