Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic When reporting an ICR value, use bitmask_snprintf to
details: https://anonhg.NetBSD.org/src/rev/f45a08b340b5
branches: trunk
changeset: 512735:f45a08b340b5
user: fredette <fredette%NetBSD.org@localhost>
date: Sun Jul 15 16:32:40 2001 +0000
description:
When reporting an ICR value, use bitmask_snprintf to
give a human-readable description of the value.
diffstat:
sys/dev/ic/sunscpal.c | 10 +++++++---
sys/dev/ic/sunscpalreg.h | 4 +++-
2 files changed, 10 insertions(+), 4 deletions(-)
diffs (49 lines):
diff -r 1d7ead6123d7 -r f45a08b340b5 sys/dev/ic/sunscpal.c
--- a/sys/dev/ic/sunscpal.c Sun Jul 15 16:29:29 2001 +0000
+++ b/sys/dev/ic/sunscpal.c Sun Jul 15 16:32:40 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunscpal.c,v 1.5 2001/07/08 18:06:46 wiz Exp $ */
+/* $NetBSD: sunscpal.c,v 1.6 2001/07/15 16:32:40 fredette Exp $ */
/*
* Copyright (c) 2001 Matthew Fredette
@@ -309,7 +309,9 @@
#ifdef SUNSCPAL_DEBUG
if (sunscpal_debug & SUNSCPAL_DBG_DMA) {
- printf("sunscpal_dma_poll: done, icr=0x%x\n", SUNSCPAL_READ_2(sc, sunscpal_icr));
+ char buffer[64];
+ bitmask_snprintf(SUNSCPAL_READ_2(sc, sunscpal_icr), SUNSCPAL_ICR_BITS, buffer, sizeof(buffer));
+ printf("sunscpal_dma_poll: done, icr=%s\n", buffer);
}
#endif
}
@@ -352,7 +354,9 @@
if (icr & (SUNSCPAL_ICR_BUS_ERROR)) {
- printf("sc: DMA error, icr=0x%x, reset\n", icr);
+ char buffer[64];
+ bitmask_snprintf(icr, SUNSCPAL_ICR_BITS, buffer, sizeof(buffer));
+ printf("sc: DMA error, icr=%s, reset\n", buffer);
sr->sr_xs->error = XS_DRIVER_STUFFUP;
sc->sc_state |= SUNSCPAL_ABORTING;
goto out;
diff -r 1d7ead6123d7 -r f45a08b340b5 sys/dev/ic/sunscpalreg.h
--- a/sys/dev/ic/sunscpalreg.h Sun Jul 15 16:29:29 2001 +0000
+++ b/sys/dev/ic/sunscpalreg.h Sun Jul 15 16:32:40 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunscpalreg.h,v 1.1 2001/04/20 16:35:22 fredette Exp $ */
+/* $NetBSD: sunscpalreg.h,v 1.2 2001/07/15 16:32:40 fredette Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -70,6 +70,8 @@
#define SUNSCPAL_ICR_DMA_ENABLE 0x0002 /* (rw) enable DMA */
#define SUNSCPAL_ICR_INTERRUPT_ENABLE 0x0001 /* (rw) enable interrupts */
+#define SUNSCPAL_ICR_BITS "\20\1INTEN\2DMAEN\3WM\4PAREN\5RESET\6SEL\7BSY\10PAR\11INPUT\12CMD\13MSG\14REQ\15INTRQ\16ODD\17BUSERR\20PARERR"
+
/*
* This chip keeps its DMA count with its bits flipped. Normally, you
* would just use the ~ operator everywhere. However, apparently that
Home |
Main Index |
Thread Index |
Old Index