summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-12 23:38:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-12 23:38:56 +0000
commitbfc8d281c5e991a39390df15f090e663a65da421 (patch)
tree9253b047f54e6872b35fdb2a9081aeff87140b76 /sys
parentc9ee967c90fda8f5b50045580338575a21a6936a (diff)
on newer cards, use word count for SET_TX_AVAIL_THRESH; from numerous people, gleamed from plan9/bsdi drivers, and confirmed in last two sentences in 3c590 manual
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/elink3.c11
-rw-r--r--sys/dev/ic/elink3var.h4
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c
index a893c2869a6..cf936ba9ead 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -139,6 +139,13 @@ epconfig(sc, conn)
printf(" address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr));
+ bus_io_write_2(bc, ioh, EP_COMMAND, SET_TX_AVAIL_THRESH | 1800 );
+ GO_WINDOW(5);
+ i = bus_io_read_2(bc, ioh, EP_W5_TX_AVAIL_THRESH);
+ GO_WINDOW(1);
+ if (i == 1800*4)
+ sc->txashift = 2;
+
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_softc = sc;
ifp->if_start = epstart;
@@ -337,13 +344,13 @@ startagain:
if (bus_io_read_2(bc, ioh, EP_W1_FREE_TX) < len + pad + 4) {
bus_io_write_2(bc, ioh, EP_COMMAND,
- SET_TX_AVAIL_THRESH | (len + pad + 4));
+ SET_TX_AVAIL_THRESH | ((len + pad + 4) >> sc->txashift));
/* not enough room in FIFO */
ifp->if_flags |= IFF_OACTIVE;
return;
} else {
bus_io_write_2(bc, ioh, EP_COMMAND,
- SET_TX_AVAIL_THRESH | 2044);
+ SET_TX_AVAIL_THRESH | (2044 >> sc->txashift));
}
IF_DEQUEUE(&ifp->if_snd, m0);
diff --git a/sys/dev/ic/elink3var.h b/sys/dev/ic/elink3var.h
index 19296129b76..e81d49ba2ef 100644
--- a/sys/dev/ic/elink3var.h
+++ b/sys/dev/ic/elink3var.h
@@ -40,7 +40,6 @@ struct ep_softc {
struct arpcom sc_arpcom; /* Ethernet common part */
bus_chipset_tag_t sc_bc; /* bus cookie */
bus_io_handle_t sc_ioh; /* bus i/o handle */
- char ep_connectors; /* Connectors on this card. */
#define MAX_MBS 8 /* # of mbufs we keep around */
struct mbuf *mb[MAX_MBS]; /* spare mbuf storage. */
int next_mb; /* Which mbuf to use next. */
@@ -48,6 +47,9 @@ struct ep_softc {
int tx_start_thresh; /* Current TX_start_thresh. */
int tx_succ_ok; /* # packets sent in sequence */
/* w/o underrun */
+
+ char ep_connectors; /* Connectors on this card. */
+ u_char txashift; /* shift in SET_TX_AVAIL_THRESH */
u_char bustype;
#define EP_BUS_ISA 0x0
#define EP_BUS_PCMCIA 0x1