summaryrefslogtreecommitdiff
path: root/sys/dev/ste
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2009-12-23 19:38:22 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2009-12-23 19:38:22 +0000
commitae49e7a6950ed98530b76565c60a5512fbbf0429 (patch)
tree274300ae2f11cfed3c3f30f2dd4edee0684d6f90 /sys/dev/ste
parent95a3c23b516ca6c9ffea8960feea398846e09407 (diff)
Notes
Diffstat (limited to 'sys/dev/ste')
-rw-r--r--sys/dev/ste/if_ste.c13
-rw-r--r--sys/dev/ste/if_stereg.h6
2 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/ste/if_ste.c b/sys/dev/ste/if_ste.c
index 75f7fab5a928..8c8b121ff1da 100644
--- a/sys/dev/ste/if_ste.c
+++ b/sys/dev/ste/if_ste.c
@@ -877,6 +877,13 @@ ste_tick(void *arg)
*/
if ((sc->ste_flags & STE_FLAG_LINK) == 0)
ste_miibus_statchg(sc->ste_dev);
+ /*
+ * Because we are not generating Tx completion
+ * interrupt for every frame, reclaim transmitted
+ * buffers here.
+ */
+ ste_txeof(sc);
+ ste_txeoc(sc);
ste_stats_update(sc);
ste_watchdog(sc);
callout_reset(&sc->ste_callout, hz, ste_tick, sc);
@@ -1953,7 +1960,11 @@ ste_encap(struct ste_softc *sc, struct mbuf **m_head, struct ste_chain *txc)
* Tx descriptors here. Otherwise we race with controller.
*/
desc->ste_next = 0;
- desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS | STE_TXCTL_DMAINTR);
+ if ((sc->ste_cdata.ste_tx_prod % STE_TX_INTR_FRAMES) == 0)
+ desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS |
+ STE_TXCTL_DMAINTR);
+ else
+ desc->ste_ctl = htole32(STE_TXCTL_ALIGN_DIS);
txc->ste_mbuf = *m_head;
STE_INC(sc->ste_cdata.ste_tx_prod, STE_TX_LIST_CNT);
sc->ste_cdata.ste_tx_cnt++;
diff --git a/sys/dev/ste/if_stereg.h b/sys/dev/ste/if_stereg.h
index b5b423998220..db0d2e7f92d1 100644
--- a/sys/dev/ste/if_stereg.h
+++ b/sys/dev/ste/if_stereg.h
@@ -494,6 +494,12 @@ struct ste_desc_onefrag {
#define STE_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF)
#define STE_ADDR_HI(x) ((uint64_t)(x) >> 32)
+/*
+ * Since Tx status can hold up to 31 status bytes we should
+ * check Tx status before controller fills it up. Otherwise
+ * Tx MAC stalls.
+ */
+#define STE_TX_INTR_FRAMES 16
#define STE_TX_TIMEOUT 5
#define STE_TIMEOUT 1000
#define STE_MIN_FRAMELEN 60