Module Name:    src
Committed By:   jakllsch
Date:           Wed May 13 19:33:48 UTC 2020

Modified Files:
        src/sys/dev/usb: ohci.c

Log Message:
Use ux_bufsize rather than ux_length in isoc path usb_syncmem calls.

ux_length is always 0 for isoc pipes, so it could not be used here.

To do: revisit this for other host controllers, uhci and ehci in particular?


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.302 src/sys/dev/usb/ohci.c:1.303
--- src/sys/dev/usb/ohci.c:1.302	Wed May 13 18:44:51 2020
+++ src/sys/dev/usb/ohci.c	Wed May 13 19:33:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.302 2020/05/13 18:44:51 jakllsch Exp $	*/
+/*	$NetBSD: ohci.c,v 1.303 2020/05/13 19:33:48 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.302 2020/05/13 18:44:51 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.303 2020/05/13 19:33:48 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -3463,7 +3463,7 @@ ohci_device_isoc_enter(struct usbd_xfer 
 	int isread =
 	    (UE_GET_DIR(xfer->ux_pipe->up_endpoint->ue_edesc->bEndpointAddress) == UE_DIR_IN);
 
-	usb_syncmem(&xfer->ux_dmabuf, 0, xfer->ux_length,
+	usb_syncmem(&xfer->ux_dmabuf, 0, xfer->ux_bufsize,
 	    isread ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
 
 	if (isoc->next == -1) {
@@ -3642,7 +3642,7 @@ ohci_device_isoc_done(struct usbd_xfer *
 
 	DPRINTFN(10, "xfer=%#jx, actlen=%jd", (uintptr_t)xfer, xfer->ux_actlen,
 	    0, 0);
-	usb_syncmem(&xfer->ux_dmabuf, 0, xfer->ux_length,
+	usb_syncmem(&xfer->ux_dmabuf, 0, xfer->ux_bufsize,
 	    isread ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
 }
 

Reply via email to