summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2001-11-10 17:09:28 +0000
committeraugustss <augustss@NetBSD.org>2001-11-10 17:09:28 +0000
commitff875692db404ec78c77e8e4975e201534f24180 (patch)
treef1b12ace957758f3dee3f8c22b0cd0a3a1735d0c /sys/dev/usb
parent3d3d59f852b8695e5fbf4f0f5319b604b976075c (diff)
Improve dump routines.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ohci.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 1140f84f28d..af1a50a1f41 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.106 2001/11/09 15:01:57 augustss Exp $ */
+/* $NetBSD: ohci.c,v 1.107 2001/11/10 17:09:28 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@@ -1823,15 +1823,15 @@ ohci_dump_td(ohci_soft_td_t *std)
"\20\23R\24OUT\25IN\31TOG1\32SETTOGGLE",
sbuf, sizeof(sbuf));
- DPRINTF(("TD(%p) at %08lx: %s delay=%d ec=%d cc=%d\ncbp=0x%08lx "
- "nexttd=0x%08lx be=0x%08lx\n",
- std, (u_long)std->physaddr, sbuf,
- OHCI_TD_GET_DI(le32toh(std->td.td_flags)),
- OHCI_TD_GET_EC(le32toh(std->td.td_flags)),
- OHCI_TD_GET_CC(le32toh(std->td.td_flags)),
- (u_long)le32toh(std->td.td_cbp),
- (u_long)le32toh(std->td.td_nexttd),
- (u_long)le32toh(std->td.td_be)));
+ printf("TD(%p) at %08lx: %s delay=%d ec=%d cc=%d\ncbp=0x%08lx "
+ "nexttd=0x%08lx be=0x%08lx\n",
+ std, (u_long)std->physaddr, sbuf,
+ OHCI_TD_GET_DI(le32toh(std->td.td_flags)),
+ OHCI_TD_GET_EC(le32toh(std->td.td_flags)),
+ OHCI_TD_GET_CC(le32toh(std->td.td_flags)),
+ (u_long)le32toh(std->td.td_cbp),
+ (u_long)le32toh(std->td.td_nexttd),
+ (u_long)le32toh(std->td.td_be));
}
void
@@ -1839,20 +1839,20 @@ ohci_dump_itd(ohci_soft_itd_t *sitd)
{
int i;
- DPRINTF(("ITD(%p) at %08lx: sf=%d di=%d fc=%d cc=%d\n"
- "bp0=0x%08lx next=0x%08lx be=0x%08lx\n",
- sitd, (u_long)sitd->physaddr,
- OHCI_ITD_GET_SF(le32toh(sitd->itd.itd_flags)),
- OHCI_ITD_GET_DI(le32toh(sitd->itd.itd_flags)),
- OHCI_ITD_GET_FC(le32toh(sitd->itd.itd_flags)),
- OHCI_ITD_GET_CC(le32toh(sitd->itd.itd_flags)),
- (u_long)le32toh(sitd->itd.itd_bp0),
- (u_long)le32toh(sitd->itd.itd_nextitd),
- (u_long)le32toh(sitd->itd.itd_be)));
+ printf("ITD(%p) at %08lx: sf=%d di=%d fc=%d cc=%d\n"
+ "bp0=0x%08lx next=0x%08lx be=0x%08lx\n",
+ sitd, (u_long)sitd->physaddr,
+ OHCI_ITD_GET_SF(le32toh(sitd->itd.itd_flags)),
+ OHCI_ITD_GET_DI(le32toh(sitd->itd.itd_flags)),
+ OHCI_ITD_GET_FC(le32toh(sitd->itd.itd_flags)),
+ OHCI_ITD_GET_CC(le32toh(sitd->itd.itd_flags)),
+ (u_long)le32toh(sitd->itd.itd_bp0),
+ (u_long)le32toh(sitd->itd.itd_nextitd),
+ (u_long)le32toh(sitd->itd.itd_be));
for (i = 0; i < OHCI_ITD_NOFFSET; i++)
- DPRINTF(("offs[%d]=0x%04x ", i,
- (u_int)le16toh(sitd->itd.itd_offset[i])));
- DPRINTF(("\n"));
+ printf("offs[%d]=0x%04x ", i,
+ (u_int)le16toh(sitd->itd.itd_offset[i]));
+ printf("\n");
}
void
@@ -1873,7 +1873,7 @@ ohci_dump_ed(ohci_soft_ed_t *sed)
bitmask_snprintf((u_long)le32toh(sed->ed.ed_headp),
"\20\1HALT\2CARRY", sbuf2, sizeof(sbuf2));
- DPRINTF(("ED(%p) at 0x%08lx: addr=%d endpt=%d maxp=%d flags=%s\ntailp=0x%08lx "
+ printf("ED(%p) at 0x%08lx: addr=%d endpt=%d maxp=%d flags=%s\ntailp=0x%08lx "
"headflags=%s headp=0x%08lx nexted=0x%08lx\n",
sed, (u_long)sed->physaddr,
OHCI_ED_GET_FA(le32toh(sed->ed.ed_flags)),
@@ -1881,7 +1881,7 @@ ohci_dump_ed(ohci_soft_ed_t *sed)
OHCI_ED_GET_MAXP(le32toh(sed->ed.ed_flags)), sbuf,
(u_long)le32toh(sed->ed.ed_tailp), sbuf2,
(u_long)le32toh(sed->ed.ed_headp),
- (u_long)le32toh(sed->ed.ed_nexted)));
+ (u_long)le32toh(sed->ed.ed_nexted));
}
#endif
@@ -2021,6 +2021,9 @@ ohci_close_pipe(usbd_pipe_handle pipe, ohci_soft_ed_t *head)
(int)le32toh(sed->ed.ed_headp),
(int)le32toh(sed->ed.ed_tailp),
pipe, std);
+#ifdef USB_DEBUG
+ usbd_dump_pipe(&opipe->pipe);
+#endif
#ifdef OHCI_DEBUG
ohci_dump_ed(sed);
if (std)
@@ -2078,7 +2081,9 @@ ohci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
* has run.
*/
usb_delay_ms(opipe->pipe.device->bus, 1); /* Hardware finishes in 1ms */
- usb_delay_ms(opipe->pipe.device->bus, 50); /* XXX software finish */
+ /* XXX should have some communication with softintr() to know
+ when it's done */
+ usb_delay_ms(opipe->pipe.device->bus, 250);
/*
* Step 3: Remove any vestiges of the xfer from the hardware.