On 2013.05.30 14:44, Toby Gray wrote:
> The current libusbx windows backend deliberately turns off sending a ZLP
> at the end of a transfer:
> https://github.com/libusbx/libusbx/blob/master/libusb/os/windows_usb.c#L2651
> It's the disabling of the SHORT_PACKET_TERMINATE:
> http://msdn.microsoft.com/en-us/library/windows/hardware/ff728833(v=vs.85).aspx
> <http://msdn.microsoft.com/en-us/library/windows/hardware/ff728833%28v=vs.85%29.aspx>
>
> This comes from
> https://github.com/libusbx/libusbx/commit/578c50c99646e5ebbcfbea653524a519b843ebcd
> but that's really just a move of code submitted here:
> https://github.com/libusbx/libusbx/commit/9a4249f8a104b98a15a7e3ba7ecae9a385ed9027
>
> So it looks like the Windows backend has always done it.
>
> Some further reading which might help:
> https://sourceforge.net/mailarchive/message.php?msg_id=28120716
> https://sourceforge.net/mailarchive/message.php?msg_id=25571546
>
> Linux does support control of if the zero length packet is sent:
> https://github.com/libusbx/libusbx/blob/master/libusb/os/linux_usbfs.c#L1699

Thanks, Toby, for doing this search into our archives!

> I was going to create a quick patch for this, but it's harder than it
> first looks because the policy for WinUSB is per pipe, but on Linux it's
> per URB.

I think last time we discussed it, the idea was that that we would try 
to make these kind of settings exposed in a backend configuration API 
call. In other words, we'd have a libusb_set_backend_setting(...) call 
that could set parameter such as WINDOWS_BACKEND_SET_ZLP_PIPE or 
LINUX_BACKEND_SET_ZLP_URB.

Now, if you need more granular settings than enabling/disabling global 
flags, it may be a bit tricky. And then there are the implications for 
concurrent applications that will want different settings...

Regards,

/Pete



------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to