diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-11-11 19:08:01 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-11-11 19:08:01 +0000 |
commit | 8fa412dce4e707cdf0d07886b654372218759694 (patch) | |
tree | ea1882ae072e1b5306ba6a2422675f6c6fff7a9e /sys/dev/pci | |
parent | 4963886275a9825524772449dd4dc85733192b65 (diff) |
- Fix Yukon ram sizing.
- Keep tx queue running by kicking the tx bmu repeatedly.
- Handle if_timer a bit better.
From NetBSD
ok deraadt@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_sk.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index fbd10d430d9..956aef26c9f 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.47 2004/10/14 15:27:39 brad Exp $ */ +/* $OpenBSD: if_sk.c,v 1.48 2004/11/11 19:08:00 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1528,19 +1528,16 @@ skc_attach(struct device *parent, struct device *self, void *aux) goto fail; break; } - - DPRINTFN(2, ("skc_attach: ramsize=%d(%dk), rboff=%d\n", - sc->sk_ramsize, sc->sk_ramsize / 1024, - sc->sk_rboff)); } else { - sc->sk_ramsize = 0x20000; + u_int8_t val = sk_win_read_1(sc, SK_EPROM0); + sc->sk_ramsize = ( val == 0 ) ? 0x20000 : (( val * 4 )*1024); sc->sk_rboff = SK_RBOFF_0; - - DPRINTFN(2, ("skc_attach: ramsize=%dk (%d), rboff=%d\n", - sc->sk_ramsize / 1024, sc->sk_ramsize, - sc->sk_rboff)); } + DPRINTFN(2, ("skc_attach: ramsize=%d (%dk), rboff=%d\n", + sc->sk_ramsize, sc->sk_ramsize / 1024, + sc->sk_rboff)); + /* Read and save physical media type */ switch(sk_win_read_1(sc, SK_PMDTYPE)) { case SK_PMD_1000BASESX: @@ -1949,8 +1946,11 @@ sk_txeof(struct sk_if_softc *sc_if) } sc_if->sk_cdata.sk_tx_cnt--; SK_INC(idx, SK_TX_RING_CNT); - ifp->if_timer = 0; } + if (sc_if->sk_cdata.sk_tx_cnt == 0) + ifp->if_timer = 0; + else /* nudge chip to keep tx ring moving */ + CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); sc_if->sk_cdata.sk_tx_cons = idx; |