summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/ehci.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2010-04-22 21:31:34 +0000
committerthompsa <thompsa@FreeBSD.org>2010-04-22 21:31:34 +0000
commitbd3f3db8dd41b77e5624bea80abc9248a8f134a6 (patch)
tree9000e5bc0e27a7baa3f0c95de314e4c394588cf1 /sys/dev/usb/controller/ehci.c
parent6fc09494d18ddab1972ded17fb6e798228bacffb (diff)
downloadFreeBSD-src-bd3f3db8dd41b77e5624bea80abc9248a8f134a6.zip
FreeBSD-src-bd3f3db8dd41b77e5624bea80abc9248a8f134a6.tar.gz
Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
the illusion of a tunable setting but was always turned on regardless. MFC after: 1 week
Diffstat (limited to 'sys/dev/usb/controller/ehci.c')
-rw-r--r--sys/dev/usb/controller/ehci.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c
index 28ad987..12cfe53 100644
--- a/sys/dev/usb/controller/ehci.c
+++ b/sys/dev/usb/controller/ehci.c
@@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
((ehci_softc_t *)(((uint8_t *)(bus)) - \
((uint8_t *)&(((ehci_softc_t *)0)->sc_bus))))
-#if USB_DEBUG
+#ifdef USB_DEBUG
static int ehcidebug = 0;
static int ehcinohighspeed = 0;
static int ehciiaadbug = 0;
@@ -258,7 +258,7 @@ ehci_init(ehci_softc_t *sc)
usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0);
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehciiaadbug)
sc->sc_flags |= EHCI_SCFLG_IAADBUG;
if (ehcilostintrbug)
@@ -486,7 +486,7 @@ ehci_init(ehci_softc_t *sc)
usb_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc);
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug) {
ehci_dump_sqh(sc, sc->sc_async_p_last);
}
@@ -685,7 +685,7 @@ ehci_shutdown(ehci_softc_t *sc)
}
}
-#if USB_DEBUG
+#ifdef USB_DEBUG
static void
ehci_dump_regs(ehci_softc_t *sc)
{
@@ -1229,7 +1229,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
xfer->td_transfer_cache = td;
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (status & EHCI_QTD_STATERRS) {
DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x"
"status=%s%s%s%s%s%s%s%s\n",
@@ -1260,7 +1260,7 @@ ehci_non_isoc_done(struct usb_xfer *xfer)
DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
xfer, xfer->endpoint);
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 10) {
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
@@ -1527,7 +1527,7 @@ ehci_interrupt(ehci_softc_t *sc)
DPRINTFN(16, "real interrupt\n");
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 15) {
ehci_dump_regs(sc);
}
@@ -1548,7 +1548,7 @@ ehci_interrupt(ehci_softc_t *sc)
if (status & EHCI_STS_HSE) {
printf("%s: unrecoverable error, "
"controller halted\n", __FUNCTION__);
-#if USB_DEBUG
+#ifdef USB_DEBUG
ehci_dump_regs(sc);
ehci_dump_isoc(sc);
#endif
@@ -1978,7 +1978,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
xfer->td_transfer_last = td;
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 8) {
DPRINTF("nexttog=%d; data before transfer:\n",
xfer->endpoint->toggle_next);
@@ -2106,7 +2106,7 @@ ehci_isoc_fs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
if (pp_last >= &sc->sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) {
pp_last = &sc->sc_isoc_fs_p_last[0];
}
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 15) {
DPRINTF("isoc FS-TD\n");
ehci_dump_sitd(sc, td);
@@ -2160,7 +2160,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
if (pp_last >= &sc->sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) {
pp_last = &sc->sc_isoc_hs_p_last[0];
}
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 15) {
DPRINTF("isoc HS-TD\n");
ehci_dump_itd(sc, td);
@@ -2224,7 +2224,7 @@ ehci_device_done(struct usb_xfer *xfer, usb_error_t error)
if ((methods == &ehci_device_bulk_methods) ||
(methods == &ehci_device_ctrl_methods)) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 8) {
DPRINTF("nexttog=%d; data after transfer:\n",
xfer->endpoint->toggle_next);
@@ -2509,7 +2509,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
uint8_t sb;
uint8_t error;
-#if USB_DEBUG
+#ifdef USB_DEBUG
uint8_t once = 1;
#endif
@@ -2593,7 +2593,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
/* reuse sitd_portaddr and sitd_back from last transfer */
if (*plen > xfer->max_frame_size) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (once) {
once = 0;
printf("%s: frame length(%d) exceeds %d "
@@ -2683,7 +2683,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
}
usb_pc_cpu_flush(td->page_cache);
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 15) {
DPRINTF("FS-TD %d\n", nframes);
ehci_dump_sitd(sc, td);
@@ -2800,7 +2800,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
uint8_t td_no;
uint8_t page_no;
-#if USB_DEBUG
+#ifdef USB_DEBUG
uint8_t once = 1;
#endif
@@ -2878,7 +2878,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
}
/* range check */
if (*plen > xfer->max_frame_size) {
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (once) {
once = 0;
printf("%s: frame length(%d) exceeds %d bytes "
@@ -2962,7 +2962,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC);
}
usb_pc_cpu_flush(td->page_cache);
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcidebug > 15) {
DPRINTF("HS-TD %d\n", nframes);
ehci_dump_itd(sc, td);
@@ -3398,7 +3398,7 @@ ehci_roothub_exec(struct usb_device *udev,
break;
case UHF_PORT_RESET:
DPRINTFN(6, "reset port %d\n", index);
-#if USB_DEBUG
+#ifdef USB_DEBUG
if (ehcinohighspeed) {
/*
* Connect USB device to companion
OpenPOWER on IntegriCloud