When reporting an ICR value, use bitmask_snprintf to
give a human-readable description of the value.
This commit is contained in:
parent
7c89e5223a
commit
047e3dd5d8
|
@ -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 @@ sunscpal_dma_poll(sc)
|
|||
|
||||
#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 @@ sunscpal_dma_stop(sc)
|
|||
|
||||
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue