Date: Sat, 17 Jan 2009 06:27:38 GMT From: Weongyo Jeong <weongyo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 156276 for review Message-ID: <200901170627.n0H6Rc8k011824@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=156276 Change 156276 by weongyo@weongyo_ws on 2009/01/17 06:26:52 cleanup missed elements of the debug messages. Affected files ... .. //depot/projects/vap/sys/dev/usb/if_uath.c#4 edit Differences ... ==== //depot/projects/vap/sys/dev/usb/if_uath.c#4 (text+ko) ==== @@ -134,6 +134,9 @@ UATH_DEBUG_RATES = 0x00001000, /* rates */ UATH_DEBUG_CRYPTO = 0x00002000, /* crypto */ UATH_DEBUG_LED = 0x00004000, /* LED */ + UATH_DEBUG_CMDS = 0x00008000, /* commands */ + UATH_DEBUG_CMDS_DUMP = 0x00010000, /* command buffer dump */ + UATH_DEBUG_XMIT_DUMP = 0x00020000, /* xmit dump */ UATH_DEBUG_ANY = 0xffffffff }; #define DPRINTF(sc, m, fmt, ...) do { \ @@ -1185,10 +1188,10 @@ bcopy(idata, (uint8_t *)(hdr + 1), ilen); #ifdef UATH_DEBUG - if (uath_debug >= 5) { + if (sc->sc_debug & UATH_DEBUG_CMDS) { printf("%s: send %s [ix %u flags 0x%x] olen %d\n", __func__, uath_codename(code), sc->sc_cmd_idx, flags, olen); - if (uath_debug >= 6) + if (sc->sc_debug & UATH_DEBUG_CMDS_DUMP) uath_dump_cmd(cmd->buf, xferlen, '+'); } #endif @@ -1354,12 +1357,12 @@ hdr = (struct uath_cmd_hdr *)cmd->buf; /* NB: msgid is passed thru w/o byte swapping */ #ifdef UATH_DEBUG - if (uath_debug >= 5) { + if (sc->sc_debug & UATH_DEBUG_CMDS) { int len = be32toh(hdr->len); printf("%s: %s [ix %u] len %u status %u\n", __func__, uath_codename(be32toh(hdr->code)), hdr->msgid, len, be32toh(hdr->magic)); - if (uath_debug >= 6) + if (sc->sc_debug & UATH_DEBUG_CMDS_DUMP) uath_dump_cmd(cmd->buf, len > UATH_MAX_RXCMDSZ ? sizeof(*hdr) : len, '-'); } @@ -1738,9 +1741,9 @@ desc->flags = htobe32(0); #ifdef UATH_DEBUG - if (uath_debug >= 5) { + if (sc->sc_debug & UATH_DEBUG_CMDS) { printf("send flush ix %u\n", data_idx); - if (uath_debug >= 6) + if (sc->sc_debug & UATH_DEBUG_CMDS_DUMP) uath_dump_cmd(data->buf, xferlen, '+'); } #endif @@ -1895,13 +1898,12 @@ desc->buflen = htobe32(m0->m_pkthdr.len); #ifdef UATH_DEBUG - if (uath_debug >= 5) { - printf("send frame ix %u framelen %d msglen %d connid 0x%x " - "txqid 0x%x\n", data_idx, framelen, msglen, - be32toh(desc->connid), be32toh(desc->txqid)); - if (uath_debug >= 6) - uath_dump_cmd(data->buf, xferlen, '+'); - } + DPRINTF(sc, UATH_DEBUG_XMIT, + "send frame ix %u framelen %d msglen %d connid 0x%x txqid 0x%x\n", + data_idx, framelen, msglen, be32toh(desc->connid), + be32toh(desc->txqid)); + if (sc->sc_debug & UATH_DEBUG_XMIT_DUMP) + uath_dump_cmd(data->buf, xferlen, '+'); #endif usbd_setup_xfer(data->xfer, sc->sc_data_txpipe, data, data->buf, xferlen, USBD_FORCE_SHORT_XFER | USBD_NO_COPY, UATH_DATA_TIMEOUT,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901170627.n0H6Rc8k011824>