PERFORCE change 156276 for review

Weongyo Jeong weongyo at FreeBSD.org
Fri Jan 16 22:27:40 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=156276

Change 156276 by weongyo at 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,


More information about the p4-projects mailing list