From owner-p4-projects@FreeBSD.ORG Sat Jan 17 06:27:39 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5A6BF106567E; Sat, 17 Jan 2009 06:27:39 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18EE9106567C for ; Sat, 17 Jan 2009 06:27:39 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E03B18FC08 for ; Sat, 17 Jan 2009 06:27:38 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H6Rc2L011826 for ; Sat, 17 Jan 2009 06:27:38 GMT (envelope-from weongyo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n0H6Rc8k011824 for perforce@freebsd.org; Sat, 17 Jan 2009 06:27:38 GMT (envelope-from weongyo@FreeBSD.org) Date: Sat, 17 Jan 2009 06:27:38 GMT Message-Id: <200901170627.n0H6Rc8k011824@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to weongyo@FreeBSD.org using -f From: Weongyo Jeong To: Perforce Change Reviews Cc: Subject: PERFORCE change 156276 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 06:27:40 -0000 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,