9 Nov 2004 19:07
Re: usb_release_interface() + usb_close() -> broke communication
Johannes Erdfelt <johannes <at> erdfelt.com>
2004-11-09 18:07:02 GMT
2004-11-09 18:07:02 GMT
On Tue, Nov 09, 2004, Martin Vaillancourt <mvaillancourt <at> memoryexpertsinc.com> wrote: > My 2 previous email seems too large! > Now, I know exactly the cause of the problem, so I do a resume... > > The Bulk Transaction with some data must toggle between the DATA PID > DATA0 and DATA1. (Ref USB Specification 1.1 or 2.0) > > So, when I Release the interface, do a usb_close, do a usb_open and > re-claim the interface, the software resend by default the usb bulk > command with the DATA0 even if the device is expecting it on the DATA1? > > Question: Is there a flag somewhere in LibUSB that keep tracking of the > DATA PID to used? libusb doesn't track anything to do with the data toggle. That is handled by the kernel in all cases. However, the SET_INTERFACE command is a control transaction that occurs on the default control pipe. Data toggles rules are fixed for control transfers, not to mention that the data toggle is per pipe. I don't see how the SET_INTERFACE could interfere, unless the device reset the data toggle when that occurs. I'll have to check the USB spec to see what behavior the spec defines in this case. JE ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
RSS Feed