summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/fxp.c7
-rw-r--r--sys/dev/ic/fxpreg.h4
-rw-r--r--sys/dev/ic/fxpvar.h3
-rw-r--r--sys/dev/pci/if_fxp_pci.c16
4 files changed, 24 insertions, 6 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 9140fb11d68..7c0cbb78c65 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.63 2004/12/23 19:40:21 deraadt Exp $ */
+/* $OpenBSD: fxp.c,v 1.64 2005/01/14 18:14:12 deraadt Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -129,7 +129,7 @@ static u_char fxp_cb_config_template[] = {
0x16, /* 0 Byte count. */
0x08, /* 1 Fifo limit */
0x00, /* 2 Adaptive ifs */
- 0x00, /* 3 void1 */
+ 0x00, /* 3 ctrl0 */
0x00, /* 4 rx_dma_bytecount */
0x80, /* 5 tx_dma_bytecount */
0xb2, /* 6 ctrl 1*/
@@ -1312,6 +1312,9 @@ fxp_init(xsc)
cbp->stripping |= 0x01; /* truncate rx packets */
}
+ if (sc->sc_flags & FXPF_MWI_ENABLE)
+ cbp->ctrl0 |= 0x01; /* enable PCI MWI command */
+
if(!sc->phy_10Mbps_only) /* interface mode */
cbp->mediatype |= 0x01;
else
diff --git a/sys/dev/ic/fxpreg.h b/sys/dev/ic/fxpreg.h
index 99f1cd81a0a..ffb02907684 100644
--- a/sys/dev/ic/fxpreg.h
+++ b/sys/dev/ic/fxpreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxpreg.h,v 1.7 2004/12/08 22:35:13 pascoe Exp $ */
+/* $OpenBSD: fxpreg.h,v 1.8 2005/01/14 18:14:12 deraadt Exp $ */
/*
* Copyright (c) 1995, David Greenman
@@ -129,7 +129,7 @@ struct fxp_cb_config {
volatile u_int8_t byte_count;
volatile u_int8_t fifo_limit;
volatile u_int8_t adaptive_ifs;
- volatile u_int8_t void1;
+ volatile u_int8_t ctrl0;
volatile u_int8_t rx_dma_bytecount;
volatile u_int8_t tx_dma_bytecount;
volatile u_int8_t ctrl1;
diff --git a/sys/dev/ic/fxpvar.h b/sys/dev/ic/fxpvar.h
index bf7e0e1b819..6e274a417c0 100644
--- a/sys/dev/ic/fxpvar.h
+++ b/sys/dev/ic/fxpvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxpvar.h,v 1.20 2004/12/23 19:40:21 deraadt Exp $ */
+/* $OpenBSD: fxpvar.h,v 1.21 2005/01/14 18:14:12 deraadt Exp $ */
/* $NetBSD: if_fxpvar.h,v 1.1 1997/06/05 02:01:58 thorpej Exp $ */
/*
@@ -104,6 +104,7 @@ struct fxp_softc {
struct mbuf *rfa_headm; /* first mbuf in receive frame area */
struct mbuf *rfa_tailm; /* last mbuf in receive frame area */
int sc_flags; /* misc. flags */
+#define FXPF_MWI_ENABLE 0x10 /* enable use of PCI MWI command */
#define FXPF_DISABLE_STANDBY 0x20 /* currently need to work-around */
#define FXPF_UCODE 0x40 /* ucode load already attempted */
struct timeout stats_update_to; /* Pointer to timeout structure */
diff --git a/sys/dev/pci/if_fxp_pci.c b/sys/dev/pci/if_fxp_pci.c
index 08a360d4a54..da30fa9d0f2 100644
--- a/sys/dev/pci/if_fxp_pci.c
+++ b/sys/dev/pci/if_fxp_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fxp_pci.c,v 1.31 2004/09/20 04:24:00 brad Exp $ */
+/* $OpenBSD: if_fxp_pci.c,v 1.32 2005/01/14 18:14:14 deraadt Exp $ */
/*
* Copyright (c) 1995, David Greenman
@@ -237,6 +237,20 @@ fxp_pci_attach(parent, self, aux)
PCI_COMMAND_MASTER_ENABLE |
pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG));
+ /*
+ * enable PCI Memory Write and Invalidate command
+ */
+ if (rev >= FXP_REV_82558_A4)
+ if (PCI_CACHELINE(pci_conf_read(pa->pa_pc, pa->pa_tag,
+ PCI_BHLC_REG))) {
+ pci_conf_write(pa->pa_pc, pa->pa_tag,
+ PCI_COMMAND_STATUS_REG,
+ PCI_COMMAND_INVALIDATE_ENABLE |
+ pci_conf_read(pa->pa_pc, pa->pa_tag,
+ PCI_COMMAND_STATUS_REG));
+ sc->sc_flags |= FXPF_MWI_ENABLE;
+ }
+
/* Do generic parts of attach. */
if (fxp_attach_common(sc, intrstr)) {
/* Failed! */