From f6a82ef7336c1e001dc4f5af1fecd06016f57599 Mon Sep 17 00:00:00 2001 From: jonathan Date: Fri, 22 Nov 1996 04:48:26 +0000 Subject: [PATCH] * 3c509s drop the low-oder bits of EP_THRESH_DISABLE (2047) on a write, and the result reads back as zero. Mask probe code accordingly. --- sys/dev/ic/elink3.c | 9 +++++---- sys/dev/ic/elink3reg.h | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index a4827956da0b..9ddf0b5e4733 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $NetBSD: elink3.c,v 1.12 1996/11/17 23:58:29 jonathan Exp $ */ +/* $NetBSD: elink3.c,v 1.13 1996/11/22 04:48:26 jonathan Exp $ */ /* * Copyright (c) 1994 Herb Peyerl @@ -158,16 +158,17 @@ epconfig(sc, conn) * threshold value was shifted or not. */ bus_space_write_2(iot, ioh, EP_COMMAND, - SET_TX_AVAIL_THRESH | EP_THRESH_DISABLE ); + SET_TX_AVAIL_THRESH | EP_LARGEWIN_PROBE ); GO_WINDOW(5); i = bus_space_read_2(iot, ioh, EP_W5_TX_AVAIL_THRESH); GO_WINDOW(1); switch (i) { - case EP_THRESH_DISABLE: + case EP_LARGEWIN_PROBE: + case (EP_LARGEWIN_PROBE & EP_LARGEWIN_MASK): sc->ep_pktlenshift = 0; break; - case (EP_THRESH_DISABLE << 2): + case (EP_LARGEWIN_PROBE << 2): sc->ep_pktlenshift = 2; break; diff --git a/sys/dev/ic/elink3reg.h b/sys/dev/ic/elink3reg.h index dc9c14f392eb..72abcd05686f 100644 --- a/sys/dev/ic/elink3reg.h +++ b/sys/dev/ic/elink3reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: elink3reg.h,v 1.6 1996/11/17 23:58:30 jonathan Exp $ */ +/* $NetBSD: elink3reg.h,v 1.7 1996/11/22 04:48:27 jonathan Exp $ */ /* * Copyright (c) 1995 Herb Peyerl @@ -359,3 +359,7 @@ #define IS_PCI_AUI (1<<5) #define IS_PCI_BNC (1<<4) #define IS_PCI_UTP (1<<3) + +/* Used to probe for large-packet support */ +#define EP_LARGEWIN_PROBE EP_THRESH_DISABLE +#define EP_LARGEWIN_MASK 0xffc