summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-05-22 05:40:53 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-05-22 05:40:53 +0000
commit7196e1ff6e85aa6b24d93f33e122afb275e0d3c2 (patch)
treef7b74c73899e133c5cbe9df33bf55a9fc81ea56b /sys/dev
parent2c4cf22d337fc5f0a8603bda6dda0916d0a216c8 (diff)
- Enable parity error detection on 900B and 635(A).
- SIS_CFG_EDB_MASTER_EN indicates the EDB bus is used instead of the PCI bus. When this bit is set, the Max DMA Burst Size for TX/RX DMA should be no larger than 64 bytes. - Do not call mii_pollstat() from within device tick routines; the status information is updated by mii_tick(). From FreeBSD Testing by uwe@, mpf@ and me.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_sis.c34
-rw-r--r--sys/dev/pci/if_sisreg.h11
2 files changed, 32 insertions, 13 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c
index c0f516b47bb..3a5853cafac 100644
--- a/sys/dev/pci/if_sis.c
+++ b/sys/dev/pci/if_sis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.44 2005/04/05 00:13:57 brad Exp $ */
+/* $OpenBSD: if_sis.c,v 1.45 2005/05/22 05:40:52 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -527,7 +527,7 @@ int sis_mii_writereg(sc, frame)
{
int s;
- s = splimp();
+ s = splimp();
/*
* Set up frame for TX.
*/
@@ -971,6 +971,13 @@ void sis_attach(parent, self, aux)
/* Reset the adapter. */
sis_reset(sc);
+ if (sc->sis_type == SIS_TYPE_900 &&
+ (sc->sis_rev == SIS_REV_635 ||
+ sc->sis_rev == SIS_REV_900B)) {
+ SIO_SET(SIS_CFG_RND_CNT);
+ SIO_SET(SIS_CFG_PERR_DETECT);
+ }
+
printf(":");
/*
@@ -1482,13 +1489,11 @@ void sis_tick(xsc)
mii = &sc->sc_mii;
mii_tick(mii);
- if (!sc->sis_link) {
- mii_pollstat(mii);
- if (mii->mii_media_status & IFM_ACTIVE &&
- IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)
- sc->sis_link++;
- if (!IFQ_IS_EMPTY(&ifp->if_snd))
- sis_start(ifp);
+ if (!sc->sis_link && mii->mii_media_status & IFM_ACTIVE &&
+ IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
+ sc->sis_link++;
+ if (!IFQ_IS_EMPTY(&ifp->if_snd))
+ sis_start(ifp);
}
timeout_add(&sc->sis_timeout, hz);
@@ -1793,8 +1798,15 @@ void sis_init(xsc)
CSR_WRITE_4(sc, SIS_TX_LISTPTR, sc->sc_listmap->dm_segs[0].ds_addr +
offsetof(struct sis_list_data, sis_tx_list[0]));
- /* Set RX configuration */
- CSR_WRITE_4(sc, SIS_RX_CFG, SIS_RXCFG);
+ /* SIS_CFG_EDB_MASTER_EN indicates the EDB bus is used instead of
+ * the PCI bus. When this bit is set, the Max DMA Burst Size
+ * for TX/RX DMA should be no larger than 16 double words.
+ */
+ if (CSR_READ_4(sc, SIS_CFG) & SIS_CFG_EDB_MASTER_EN) {
+ CSR_WRITE_4(sc, SIS_RX_CFG, SIS_RXCFG64);
+ } else {
+ CSR_WRITE_4(sc, SIS_RX_CFG, SIS_RXCFG256);
+ }
/* Accept Long Packets for VLAN support */
SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_JABBER);
diff --git a/sys/dev/pci/if_sisreg.h b/sys/dev/pci/if_sisreg.h
index ac681f90fb2..46e17202835 100644
--- a/sys/dev/pci/if_sisreg.h
+++ b/sys/dev/pci/if_sisreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sisreg.h,v 1.20 2005/04/05 00:13:57 brad Exp $ */
+/* $OpenBSD: if_sisreg.h,v 1.21 2005/05/22 05:40:52 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -121,6 +121,9 @@
#define SIS_CFG_OUTOFWIN_TIMER 0x00000020
#define SIS_CFG_SINGLE_BACKOFF 0x00000040
#define SIS_CFG_PCIREQ_ALG 0x00000080
+#define SIS_CFG_FAIR_BACKOFF 0x00000200 /* 635 & 900B Specific */
+#define SIS_CFG_RND_CNT 0x00000400 /* 635 & 900B Specific */
+#define SIS_CFG_EDB_MASTER_EN 0x00002000
#define SIS_EECTL_DIN 0x00000001
#define SIS_EECTL_DOUT 0x00000002
@@ -263,8 +266,10 @@
#define SIS_RXDMA_128BYTES 0x00600000
#define SIS_RXDMA_256BYTES 0x00700000
-#define SIS_RXCFG \
+#define SIS_RXCFG256 \
(SIS_RXCFG_DRAIN(64)|SIS_RXDMA_256BYTES)
+#define SIS_RXCFG64 \
+ (SIS_RXCFG_DRAIN(64)|SIS_RXDMA_64BYTES)
#define SIS_RXFILTCTL_ADDR 0x000F0000
#define NS_RXFILTCTL_MCHASH 0x00200000
@@ -385,6 +390,8 @@ struct sis_ring_data {
/*
* SiS 900 PCI revision codes.
*/
+#define SIS_REV_900B 0x0003
+#define SIS_REV_630A 0x0080
#define SIS_REV_630E 0x0081
#define SIS_REV_630S 0x0082
#define SIS_REV_630EA1 0x0083