Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Make sure all physical addresses are filled in t...



details:   https://anonhg.NetBSD.org/src/rev/41e4b53a7e13
branches:  trunk
changeset: 580713:41e4b53a7e13
user:      augustss <augustss%NetBSD.org@localhost>
date:      Thu May 05 20:54:34 2005 +0000

description:
Make sure all physical addresses are filled in the qTD even when we have
a page offset.

>From Dan Ellis (as was the previous fix).

diffstat:

 sys/dev/usb/ehci.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (48 lines):

diff -r fad5802521d9 -r 41e4b53a7e13 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Thu May 05 20:40:20 2005 +0000
+++ b/sys/dev/usb/ehci.c        Thu May 05 20:54:34 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.102 2005/05/05 20:40:20 augustss Exp $ */
+/*     $NetBSD: ehci.c,v 1.103 2005/05/05 20:54:34 augustss Exp $ */
 
 /*
  * Copyright (c) 2004,2005 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.102 2005/05/05 20:40:20 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.103 2005/05/05 20:54:34 augustss Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2273,10 +2273,6 @@
        len = alen;
        dataphys = DMAADDR(dma, 0);
        dataphyslastpage = EHCI_PAGE(dataphys + len - 1);
-#if 0
-printf("status=%08x toggle=%d\n", epipe->sqh->qh.qh_qtd.qtd_status,
-    epipe->nexttoggle);
-#endif
        qtdstatus = EHCI_QTD_ACTIVE |
            EHCI_QTD_SET_PID(rd ? EHCI_QTD_PID_IN : EHCI_QTD_PID_OUT) |
            EHCI_QTD_SET_CERR(3)
@@ -2319,7 +2315,7 @@
                                    "curlen=%d\n", curlen));
 #ifdef DIAGNOSTIC
                        if (curlen == 0)
-                               panic("ehci_alloc_std: curlen == 0");
+                               panic("ehci_alloc_sqtd_chain: curlen == 0");
 #endif
                }
                DPRINTFN(4,("ehci_alloc_sqtd_chain: dataphys=0x%08x "
@@ -2345,7 +2341,8 @@
                        nextphys = EHCI_NULL;
                }
 
-               for (i = 0; i * EHCI_PAGE_SIZE < curlen; i++) {
+               for (i = 0; i * EHCI_PAGE_SIZE < 
+                           curlen + EHCI_PAGE_OFFSET(dataphys); i++) {
                        ehci_physaddr_t a = dataphys + i * EHCI_PAGE_SIZE;
                        if (i != 0) /* use offset only in first buffer */
                                a = EHCI_PAGE(a);



Home | Main Index | Thread Index | Old Index