The rx descriptor ring bug happens quite often, so printf'ing

occurrences is annoying.  Only printf about it when rtw_debug
contains RTW_DEBUG_BUG.
This commit is contained in:
dyoung 2004-12-25 07:45:53 +00:00
parent 763f8db1c3
commit 1b319bfabc
2 changed files with 30 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtw.c,v 1.22 2004/12/25 07:24:17 dyoung Exp $ */
/* $NetBSD: rtw.c,v 1.23 2004/12/25 07:45:53 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005 David Young. All rights reserved.
*
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.22 2004/12/25 07:24:17 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.23 2004/12/25 07:45:53 dyoung Exp $");
#include "bpfilter.h"
@ -1292,8 +1292,9 @@ rtw_intr_rx(struct rtw_softc *sc, u_int16_t isr)
hrx = &sc->sc_rxdesc[0];
if ((hrx->hrx_stat & htole32(RTW_RXSTAT_OWN)) != 0)
break;
printf("%s: NIC skipped to rxdesc[0]\n",
sc->sc_dev.dv_xname);
RTW_DPRINTF(RTW_DEBUG_BUGS,
("%s: NIC skipped to rxdesc[0]\n",
sc->sc_dev.dv_xname));
next = 0;
continue;
}
@ -1705,7 +1706,8 @@ rtw_intr_ioerror(struct rtw_softc *sc, uint16_t isr)
if ((isr & (RTW_INTR_RDU|RTW_INTR_RXFOVW)) == 0)
return;
printf("%s: restarting xmit/recv\n", sc->sc_dev.dv_xname);
RTW_DPRINTF(RTW_DEBUG_BUGS, ("%s: restarting xmit/recv\n",
sc->sc_dev.dv_xname));
rtw_dump_rings(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtwvar.h,v 1.8 2004/12/25 06:58:37 dyoung Exp $ */
/* $NetBSD: rtwvar.h,v 1.9 2004/12/25 07:45:53 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005 David Young. All rights reserved.
*
@ -37,28 +37,28 @@
#include <sys/callout.h>
#ifdef RTW_DEBUG
#define RTW_DEBUG_TUNE 0x00001
#define RTW_DEBUG_PKTFILT 0x00002
#define RTW_DEBUG_XMIT 0x00004
#define RTW_DEBUG_XMIT_DESC 0x00008
#define RTW_DEBUG_NODE 0x00010
#define RTW_DEBUG_PWR 0x00020
#define RTW_DEBUG_ATTACH 0x00040
#define RTW_DEBUG_REGDUMP 0x00080
#define RTW_DEBUG_ACCESS 0x00100
#define RTW_DEBUG_RESET 0x00200
#define RTW_DEBUG_INIT 0x00400
#define RTW_DEBUG_IOSTATE 0x00800
#define RTW_DEBUG_RECV 0x01000
#define RTW_DEBUG_RECV_DESC 0x02000
#define RTW_DEBUG_IO_KICK 0x04000
#define RTW_DEBUG_INTR 0x08000
#define RTW_DEBUG_PHY 0x10000
#define RTW_DEBUG_PHYIO 0x20000
#define RTW_DEBUG_PHYBITIO 0x40000
#define RTW_DEBUG_TIMEOUT 0x80000
#define RTW_DEBUG_MAX 0x7ffff
#define RTW_DEBUG_TUNE 0x000001
#define RTW_DEBUG_PKTFILT 0x000002
#define RTW_DEBUG_XMIT 0x000004
#define RTW_DEBUG_XMIT_DESC 0x000008
#define RTW_DEBUG_NODE 0x000010
#define RTW_DEBUG_PWR 0x000020
#define RTW_DEBUG_ATTACH 0x000040
#define RTW_DEBUG_REGDUMP 0x000080
#define RTW_DEBUG_ACCESS 0x000100
#define RTW_DEBUG_RESET 0x000200
#define RTW_DEBUG_INIT 0x000400
#define RTW_DEBUG_IOSTATE 0x000800
#define RTW_DEBUG_RECV 0x001000
#define RTW_DEBUG_RECV_DESC 0x002000
#define RTW_DEBUG_IO_KICK 0x004000
#define RTW_DEBUG_INTR 0x008000
#define RTW_DEBUG_PHY 0x010000
#define RTW_DEBUG_PHYIO 0x020000
#define RTW_DEBUG_PHYBITIO 0x040000
#define RTW_DEBUG_TIMEOUT 0x080000
#define RTW_DEBUG_BUGS 0x100000
#define RTW_DEBUG_MAX 0x1fffff
extern int rtw_debug;
#define RTW_DPRINTF(__flags, __x) \