Module Name: src Committed By: martin Date: Sat Feb 17 11:27:30 UTC 2024
Modified Files: src/sys/dev/usb [netbsd-10]: ehci.c ehcireg.h Log Message: Pull up following revision(s) (requested by gutteridge in ticket #589): sys/dev/usb/ehci.c: revision 1.322 sys/dev/usb/ehcireg.h: revision 1.39 avoid different struct type problem. To generate a diff of this commit: cvs rdiff -u -r1.315.2.3 -r1.315.2.4 src/sys/dev/usb/ehci.c cvs rdiff -u -r1.37.50.1 -r1.37.50.2 src/sys/dev/usb/ehcireg.h 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.315.2.3 src/sys/dev/usb/ehci.c:1.315.2.4 --- src/sys/dev/usb/ehci.c:1.315.2.3 Tue Feb 6 12:18:55 2024 +++ src/sys/dev/usb/ehci.c Sat Feb 17 11:27:30 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.315.2.3 2024/02/06 12:18:55 martin Exp $ */ +/* $NetBSD: ehci.c,v 1.315.2.4 2024/02/17 11:27:30 martin Exp $ */ /* * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.315.2.3 2024/02/06 12:18:55 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.315.2.4 2024/02/17 11:27:30 martin Exp $"); #include "ohci.h" #include "uhci.h" @@ -289,6 +289,7 @@ void ehci_dump(void); Static void ehci_dump_regs(ehci_softc_t *); Static void ehci_dump_sqtds(ehci_soft_qtd_t *); Static void ehci_dump_sqtd(ehci_soft_qtd_t *); +Static void ehci_dump_qh_qtd(struct ehci_qh_qtd_t *); Static void ehci_dump_qtd(ehci_qtd_t *); Static void ehci_dump_sqh(ehci_soft_qh_t *); Static void ehci_dump_sitd(struct ehci_soft_itd *); @@ -1750,6 +1751,24 @@ ehci_dump_sqtd(ehci_soft_qtd_t *sqtd) } Static void +ehci_dump_qh_qtd(struct ehci_qh_qtd_t *qh_qtd) +{ + ehci_qtd_t qtd = { + .qtd_next = qh_qtd->qtd_next, + .qtd_altnext = qh_qtd->qtd_altnext, + .qtd_status = qh_qtd->qtd_status, + }; + + /* Manually memcpy(), because of volatile. */ + for (unsigned i = 0; i < EHCI_QTD_NBUFFERS; i++) { + qtd.qtd_buffer[i] = qh_qtd->qtd_buffer[i]; + qtd.qtd_buffer_hi[i] = qh_qtd->qtd_buffer_hi[i]; + } + + ehci_dump_qtd(&qtd); +} + +Static void ehci_dump_qtd(ehci_qtd_t *qtd) { EHCIHIST_FUNC(); EHCIHIST_CALLED(); @@ -1825,7 +1844,7 @@ ehci_dump_sqh(ehci_soft_qh_t *sqh) link = le32toh(qh->qh_curqtd); ehci_dump_link(link, false); DPRINTFN(10, "Overlay qTD:", 0, 0, 0, 0); - ehci_dump_qtd(&qh->qh_qtd); + ehci_dump_qh_qtd(&qh->qh_qtd); usb_syncmem(&sqh->dma, sqh->offs, sizeof(sqh->qh), BUS_DMASYNC_PREREAD); Index: src/sys/dev/usb/ehcireg.h diff -u src/sys/dev/usb/ehcireg.h:1.37.50.1 src/sys/dev/usb/ehcireg.h:1.37.50.2 --- src/sys/dev/usb/ehcireg.h:1.37.50.1 Tue Feb 6 12:18:55 2024 +++ src/sys/dev/usb/ehcireg.h Sat Feb 17 11:27:30 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehcireg.h,v 1.37.50.1 2024/02/06 12:18:55 martin Exp $ */ +/* $NetBSD: ehcireg.h,v 1.37.50.2 2024/02/17 11:27:30 martin Exp $ */ /* * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc. @@ -394,7 +394,7 @@ typedef struct { * 32-byte aligned, so declare the fields instead of embedding * a ehci_qtd_t directly. */ - struct { + struct ehci_qh_qtd_t { volatile ehci_link_t qtd_next; volatile ehci_link_t qtd_altnext; volatile uint32_t qtd_status;