summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sisreg.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2001-11-27 16:29:11 +0000
committerluigi <luigi@FreeBSD.org>2001-11-27 16:29:11 +0000
commitd6ea22c61785f66fda317a412e9febf626847326 (patch)
treea80590a6c440662787b8d2bbe7f8fef3f0069094 /sys/pci/if_sisreg.h
parenta2f0a76ebcd5b63f172b9f17a662de0c4d59ff22 (diff)
downloadFreeBSD-src-d6ea22c61785f66fda317a412e9febf626847326.zip
FreeBSD-src-d6ea22c61785f66fda317a412e9febf626847326.tar.gz
Fix a bug in the driver -- under load, the receive unit could become
idle and the driver would not detect the event, requiring userland to cycle the interface to bring it up again. The fix consists in adding SIS_IMR_RX_IDLE to the interrupt mask and add a command in sis_intr() to restart the receiver when this happens. While at it, make the test of status bits more efficient.
Diffstat (limited to 'sys/pci/if_sisreg.h')
-rw-r--r--sys/pci/if_sisreg.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/pci/if_sisreg.h b/sys/pci/if_sisreg.h
index 21cb22a..7ac424f 100644
--- a/sys/pci/if_sisreg.h
+++ b/sys/pci/if_sisreg.h
@@ -185,6 +185,7 @@
#define SIS_INTRS \
(SIS_IMR_RX_OFLOW|SIS_IMR_TX_UFLOW|SIS_IMR_TX_OK|\
SIS_IMR_TX_IDLE|SIS_IMR_RX_OK|SIS_IMR_RX_ERR|\
+ SIS_IMR_RX_IDLE|\
SIS_IMR_SYSERR)
#define SIS_IER_INTRENB 0x00000001
@@ -306,7 +307,7 @@ struct sis_desc {
#define SIS_LASTDESC(x) (!((x)->sis_ctl & SIS_CMDSTS_MORE)))
#define SIS_OWNDESC(x) ((x)->sis_ctl & SIS_CMDSTS_OWN)
-#define SIS_INC(x, y) (x) = (x + 1) % y
+#define SIS_INC(x, y) { if (++(x) == y) x=0 ; }
#define SIS_RXBYTES(x) ((x)->sis_ctl & SIS_CMDSTS_BUFLEN)
#define SIS_RXSTAT_COLL 0x00010000
OpenPOWER on IntegriCloud