summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/if_xl.c28
-rw-r--r--sys/dev/pci/if_xlreg.h5
2 files changed, 27 insertions, 6 deletions
diff --git a/sys/dev/pci/if_xl.c b/sys/dev/pci/if_xl.c
index fa877078fa3..ec5653ed8b5 100644
--- a/sys/dev/pci/if_xl.c
+++ b/sys/dev/pci/if_xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xl.c,v 1.12 1998/10/09 00:15:35 deraadt Exp $ */
+/* $OpenBSD: if_xl.c,v 1.13 1998/11/11 23:25:02 jason Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -31,7 +31,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: if_xl.c,v 1.12 1998/09/25 17:34:19 wpaul Exp $
+ * $FreeBSD: if_xl.c,v 1.16 1998/10/22 16:46:26 wpaul Exp $
*/
/*
@@ -195,7 +195,7 @@
#if !defined(lint) && !defined(__OpenBSD__)
static char rcsid[] =
- "$FreeBSD: if_xl.c,v 1.12 1998/09/25 17:34:19 wpaul Exp $";
+ "$FreeBSD: if_xl.c,v 1.16 1998/10/22 16:46:26 wpaul Exp $";
#endif
#ifdef __FreeBSD__
@@ -219,6 +219,8 @@ static struct xl_type xl_devs[] = {
"3Com 3c905B Fast Etherlink XL 10/100BaseTX" },
{ TC_VENDORID, TC_DEVICEID_CYCLONE_10_100BT4,
"3Com 3c905B Fast Etherlink XL 10/100BaseT4" },
+ { TC_VENDORID, TC_DEVICEID_CYCLONE_10_100FX,
+ "3Com 3c905B Fast Etherlink XL 10/100BaseFX/SC" },
{ TC_VENDORID, TC_DEVICEID_CYCLONE_10_100BT_SERV,
"3Com 3c980 Fast Etherlink XL 10/100BaseTX" },
{ 0, 0, NULL }
@@ -1067,7 +1069,7 @@ static void xl_getmode_mii(sc)
if (bootverbose)
printf("xl%d: forcing on autoneg support for BT4\n",
sc->xl_unit);
- ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0 NULL):
+ ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
sc->ifmedia.ifm_media = IFM_ETHER|IFM_AUTO;
#endif
}
@@ -2087,6 +2089,10 @@ static void xl_txeoc(sc)
* first generation 3c90X chips.
*/
CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
+ if (sc->xl_type == XL_TYPE_905B) {
+ CSR_WRITE_2(sc, XL_COMMAND,
+ XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4));
+ }
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_ENABLE);
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);
} else {
@@ -2510,6 +2516,20 @@ static void xl_init(xsc)
*/
CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
+ /*
+ * If this is a 3c905B, also set the tx reclaim threshold.
+ * This helps cut down on the number of tx reclaim errors
+ * that could happen on a busy network. The chip multiplies
+ * the register value by 16 to obtain the actual threshold
+ * in bytes, so we divide by 16 when setting the value here.
+ * The existing threshold value can be examined by reading
+ * the register at offset 9 in window 5.
+ */
+ if (sc->xl_type == XL_TYPE_905B) {
+ CSR_WRITE_2(sc, XL_COMMAND,
+ XL_CMD_SET_TX_RECLAIM|(XL_PACKET_SIZE >> 4));
+ }
+
/* Set RX filter bits. */
XL_SEL_WIN(5);
rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
diff --git a/sys/dev/pci/if_xlreg.h b/sys/dev/pci/if_xlreg.h
index 413430dbf6c..009150c7291 100644
--- a/sys/dev/pci/if_xlreg.h
+++ b/sys/dev/pci/if_xlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xlreg.h,v 1.6 1998/09/29 02:14:29 jason Exp $ */
+/* $OpenBSD: if_xlreg.h,v 1.7 1998/11/11 23:25:02 jason Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -31,7 +31,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: if_xlreg.h,v 1.5 1998/09/25 17:34:19 wpaul Exp $
+ * $FreeBSD: if_xlreg.h,v 1.8 1998/10/22 15:52:25 wpaul Exp $
*/
#define XL_EE_READ 0x0080 /* read, 5 bit address */
@@ -363,6 +363,7 @@
*/
#define XL_W5_STAT_ENB 0x0C
#define XL_W5_INTR_ENB 0x0A
+#define XL_W5_RECLAIM_THRESH 0x09 /* 3c905B only */
#define XL_W5_RX_FILTER 0x08
#define XL_W5_RX_EARLYTHRESH 0x06
#define XL_W5_TX_AVAILTHRESH 0x02