]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
ioat: Add %b format string for CHANERR codes
authorcem <cem@FreeBSD.org>
Mon, 26 Oct 2015 03:30:50 +0000 (03:30 +0000)
committercem <cem@FreeBSD.org>
Mon, 26 Oct 2015 03:30:50 +0000 (03:30 +0000)
Sponsored by: EMC / Isilon Storage Division

sys/dev/ioat/ioat.c
sys/dev/ioat/ioat_hw.h

index 1b0c381470bb691760199fb6c97a7c8fe05de387..6c96811cf0cc04c918acffde1b6e61a79ec7f8e1 100644 (file)
@@ -349,7 +349,8 @@ ioat_start_channel(struct ioat_softc *ioat)
 
        chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET);
        ioat_log_message(0, "could not start channel: "
-           "status = %#jx error = %x\n", (uintmax_t)status, chanerr);
+           "status = %#jx error = %b\n", (uintmax_t)status, (int)chanerr,
+           IOAT_CHANERR_STR);
        return (ENXIO);
 }
 
@@ -1105,7 +1106,8 @@ ioat_halted_debug(struct ioat_softc *ioat, uint32_t chanerr)
 {
        struct ioat_descriptor *desc;
 
-       ioat_log_message(0, "Channel halted (%x)\n", chanerr);
+       ioat_log_message(0, "Channel halted (%b)\n", (int)chanerr,
+           IOAT_CHANERR_STR);
        if (chanerr == 0)
                return;
 
index d2bba62a6a20e5f06d70bfa18cdf99a6f87ad24a..b3a21cb14dc7f77a175c2b70ba7ddf57d7122874 100644 (file)
@@ -126,6 +126,13 @@ __FBSDID("$FreeBSD$");
 #define        IOAT_CHANERR_RATVERR            (1 << 26)
 #define        IOAT_CHANERR_RRTVERR            (1 << 27)
 
+#define        IOAT_CHANERR_STR \
+    "\20\34RRTVERR\33RATVERR\32RGTVERR\31RDIFFERR\30BBERR\27RTVERR\26ATVERR" \
+    "\25GTVERR\24DIFFERR\23DCNTERR\21CXPERR\20UNAFFERR\17SEDERR\16INTCFGERR" \
+    "\15CMPADDERR\14DXSERR\13DCERR\12WDERR\11RDERR\10DUNCORERR\07CUNCORERR" \
+    "\06CCMDERR\05CHADDERR\04DERR\03NDADDERR\02XDADDERR\01XSADDERR"
+
+
 #define        IOAT_CFG_CHANERR_INT_OFFSET             0x180
 #define        IOAT_CFG_CHANERRMASK_INT_OFFSET         0x184