Module Name:    src
Committed By:   drochner
Date:           Wed Apr 20 09:32:43 UTC 2011

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

Log Message:
in alloc_sqtd_chain(), deal with the case where a data packet ends
exactly at a page boundary, and the FORCE_SHORT_XFER was set by the
client (which causes that an empty descriptor is needed to terminate
the transfer), from Gordon McNutt per PR kern/44883
(fixed a bit differently than the proposed patch for aesthetical
reasons -- avoids the page pointer to come into unexpexted area earlier)


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 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.173 src/sys/dev/usb/ehci.c:1.174
--- src/sys/dev/usb/ehci.c:1.173	Tue Jan 18 15:05:03 2011
+++ src/sys/dev/usb/ehci.c	Wed Apr 20 09:32:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.173 2011/01/18 15:05:03 jmcneill Exp $ */
+/*	$NetBSD: ehci.c,v 1.174 2011/04/20 09:32:43 drochner Exp $ */
 
 /*
  * Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.173 2011/01/18 15:05:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.174 2011/04/20 09:32:43 drochner Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2750,7 +2750,8 @@
 		usb_syncmem(&cur->dma, cur->offs, sizeof(cur->qtd),
 		    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 		DPRINTFN(10,("ehci_alloc_sqtd_chain: extend chain\n"));
-		dataphys += curlen;
+		if (len)
+			dataphys += curlen;
 		cur = next;
 	}
 	cur->qtd.qtd_status |= htole32(EHCI_QTD_IOC);

Reply via email to