avoid different struct type problem. Index: ehci.c =================================================================== RCS file: /cvsroot/src/sys/dev/usb/ehci.c,v retrieving revision 1.321 diff -p -u -r1.321 ehci.c --- ehci.c 5 Feb 2024 23:04:18 -0000 1.321 +++ ehci.c 6 Feb 2024 23:41:38 -0000 @@ -294,6 +294,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 *); @@ -1755,6 +1756,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(); @@ -1830,7 +1849,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: ehcireg.h =================================================================== RCS file: /cvsroot/src/sys/dev/usb/ehcireg.h,v retrieving revision 1.38 diff -p -u -r1.38 ehcireg.h --- ehcireg.h 5 Feb 2024 23:07:42 -0000 1.38 +++ ehcireg.h 6 Feb 2024 23:41:38 -0000 @@ -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;