summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-01-01 21:53:25 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-01-01 21:53:25 +0000
commit618fe9101d1ab84ebe06ccf302436940d4bf46ab (patch)
tree91e811a8b9e0525c4987c01648b8e89250b2bc91
parent48321070ea548f8aa9b7590b5484cdf28b2da962 (diff)
rev 1.92
only clear the IFF_OACTIVE flag when we have a chance of being able to queue a packet to the hardware... instead of when the hardware queue is empty.. don't initalize cur_tx now that it doesn't need to be... rev 1.90 _OACTIVE is now handled better... From FreeBSD ok krw@
-rw-r--r--sys/dev/pci/if_sk.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index a6361b10004..fb8dc32bbe3 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.56 2005/01/01 07:11:19 krw Exp $ */
+/* $OpenBSD: if_sk.c,v 1.57 2005/01/01 21:53:24 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -1704,11 +1704,13 @@ sk_start(struct ifnet *ifp)
return;
/* Transmit */
- sc_if->sk_cdata.sk_tx_prod = idx;
- CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START);
+ if (idx != sc_if->sk_cdata.sk_tx_prod) {
+ sc_if->sk_cdata.sk_tx_prod = idx;
+ CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START);
- /* Set a timeout in case the chip goes out to lunch. */
- ifp->if_timer = 5;
+ /* Set a timeout in case the chip goes out to lunch. */
+ ifp->if_timer = 5;
+ }
}
@@ -1912,7 +1914,7 @@ void
sk_txeof(struct sk_if_softc *sc_if)
{
struct sk_softc *sc = sc_if->sk_softc;
- struct sk_tx_desc *cur_tx = NULL;
+ struct sk_tx_desc *cur_tx;
struct ifnet *ifp = &sc_if->arpcom.ac_if;
u_int32_t idx;
struct sk_txmap_entry *entry;
@@ -1955,10 +1957,10 @@ sk_txeof(struct sk_if_softc *sc_if)
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;
-
- if (cur_tx != NULL)
+ if (sc_if->sk_cdata.sk_tx_cnt < SK_TX_RING_CNT - 2)
ifp->if_flags &= ~IFF_OACTIVE;
+
+ sc_if->sk_cdata.sk_tx_cons = idx;
}
void