tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: asynchronous ugen(4) bulk transfers



On 04/04/16 08:45, Nick Hudson wrote:
On 04/04/16 05:25, Brian Buhrow wrote:
    hello.  I did a lot of work on this under NetBSD-5  to allow the
libimobiledevice tools to work with iOS based Apple devices. I have some
simple patches for libusb1 and a re-working of the ugen(4) driver to
address the issues you note below.  My plan is to port these fixes to
-current, but I hadn't finished that process yet.  My changes make the
libimobiledevice tools work reliably with Apple products, modulo a bug in
the ehci(4) and ohci(4) drivers that preclude the USB stack from sending
zero-length packets.

Not that I think ehci(4) has a problem in HEAD

Does this diff help ehci+zlp for you? Thanks to Colin Granville for the hint.

Nick
Index: sys/dev/usb/ehci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ehci.c,v
retrieving revision 1.248
diff -u -p -r1.248 ehci.c
--- sys/dev/usb/ehci.c	13 Mar 2016 07:01:43 -0000	1.248
+++ sys/dev/usb/ehci.c	5 Apr 2016 06:57:13 -0000
@@ -2975,7 +2975,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe *
 
 		/* adjust the toggle based on the number of packets in this
 		   qtd */
-		if (((curlen + mps - 1) / mps) & 1) {
+		if (curlen == 0 || (((curlen + mps - 1) / mps) & 1)) {
 			tog ^= 1;
 			qtdstatus ^= EHCI_QTD_TOGGLE_MASK;
 		}


Home | Main Index | Thread Index | Old Index