Module Name:    src
Committed By:   martin
Date:           Wed Aug  2 10:22:13 UTC 2023

Modified Files:
        src/sys/dev/usb [netbsd-9]: ehci.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1698):

        sys/dev/usb/ehci.c: revision 1.317

PR 57518: usb keyboard causes host controller to miss microframe

As per the USB 2.0 specification section 11.18.4; paragraph 3.b
For interrupt IN/OUT full-/low-speed transactions, the host must  schedule a
complete-split transaction in each of the two microframes following the
first microframe in which the full-/low-speed transaction is budgeted. An
additional complete-split must also be scheduled in the third following
microframe unless the full-/low-speed transaction was budgeted to start
in microframe Y6.


To generate a diff of this commit:
cvs rdiff -u -r1.267.2.6 -r1.267.2.7 src/sys/dev/usb/ehci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.267.2.6 src/sys/dev/usb/ehci.c:1.267.2.7
--- src/sys/dev/usb/ehci.c:1.267.2.6	Mon Dec  6 19:28:57 2021
+++ src/sys/dev/usb/ehci.c	Wed Aug  2 10:22:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.267.2.6 2021/12/06 19:28:57 martin Exp $ */
+/*	$NetBSD: ehci.c,v 1.267.2.7 2023/08/02 10:22:13 martin Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.6 2021/12/06 19:28:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.7 2023/08/02 10:22:13 martin Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -1974,14 +1974,17 @@ ehci_open(struct usbd_pipe *pipe)
 		    );
 		sqh->qh.qh_endphub = htole32(
 		    EHCI_QH_SET_MULT(1) |
-		    EHCI_QH_SET_SMASK(xfertype == UE_INTERRUPT ? 0x02 : 0)
+		    (xfertype == UE_INTERRUPT ?
+			EHCI_QH_SET_SMASK(__BIT(1))	   /* Start Split Y1 */
+			: 0)
 		    );
 		if (speed != EHCI_QH_SPEED_HIGH)
 			sqh->qh.qh_endphub |= htole32(
 			    EHCI_QH_SET_PORT(hshubport) |
 			    EHCI_QH_SET_HUBA(hshubaddr) |
 			    (xfertype == UE_INTERRUPT ?
-				 EHCI_QH_SET_CMASK(0x08) : 0)
+				 EHCI_QH_SET_CMASK(__BITS(3,5)) /* CS Y[345] */
+				 : 0)
 			);
 		sqh->qh.qh_curqtd = EHCI_NULL;
 		/* Fill the overlay qTD */

Reply via email to