Index: dev/bfe/if_bfe.c =================================================================== RCS file: /usr/store/mlaier/fcvs/src/sys/dev/bfe/if_bfe.c,v retrieving revision 1.15.2.1 diff -u -1 -0 -r1.15.2.1 if_bfe.c --- dev/bfe/if_bfe.c 4 Sep 2004 19:24:17 -0000 1.15.2.1 +++ dev/bfe/if_bfe.c 9 Oct 2004 12:52:29 -0000 @@ -1350,21 +1350,21 @@ } /* * Set up to transmit a packet */ static void bfe_start(struct ifnet *ifp) { struct bfe_softc *sc; struct mbuf *m_head = NULL; - int idx; + int idx, queued = 0; sc = ifp->if_softc; idx = sc->bfe_tx_prod; BFE_LOCK(sc); /* * Not much point trying to send if the link is down * or we have nothing to send. */ @@ -1386,36 +1386,41 @@ /* * Pack the data into the tx ring. If we dont have * enough room, let the chip drain the ring. */ if(bfe_encap(sc, m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_flags |= IFF_OACTIVE; break; } + queued++; + /* * If there's a BPF listener, bounce a copy of this frame * to him. */ BPF_MTAP(ifp, m_head); } - sc->bfe_tx_prod = idx; - /* Transmit - twice due to apparent hardware bug */ - CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc)); - CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc)); + if (queued) { + sc->bfe_tx_prod = idx; + /* Transmit - twice due to apparent hardware bug */ + CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc)); + CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc)); + + /* + * 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; BFE_UNLOCK(sc); } static void bfe_init(void *xsc) { struct bfe_softc *sc = (struct bfe_softc*)xsc; struct ifnet *ifp = &sc->arpcom.ac_if; BFE_LOCK(sc); Index: dev/if_ndis/if_ndis.c =================================================================== RCS file: /usr/store/mlaier/fcvs/src/sys/dev/if_ndis/if_ndis.c,v retrieving revision 1.69 diff -u -1 -0 -r1.69 if_ndis.c --- dev/if_ndis/if_ndis.c 3 Aug 2004 17:00:39 -0000 1.69 +++ dev/if_ndis/if_ndis.c 9 Oct 2004 12:53:06 -0000 @@ -24,21 +24,21 @@ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.69 2004/08/03 17:00:39 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.70 2004/10/08 16:14:42 mlaier Exp $"); #include "opt_bdg.h" #include #include #include #include #include #include #include @@ -1284,20 +1284,23 @@ * so we must not wrap past the end of sc->ndis_txarray[]. * If it looks like we're about to wrap, break out here * so the this batch of packets can be transmitted, then * wait for txeof to ask us to send the rest. */ if (sc->ndis_txidx == 0) break; } + if (pcnt == 0) + return; + if (sc->ndis_txpending == 0) ifp->if_flags |= IFF_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. */ ifp->if_timer = 5; NDIS_UNLOCK(sc); Index: pci/if_sis.c =================================================================== RCS file: /usr/store/mlaier/fcvs/src/sys/pci/if_sis.c,v retrieving revision 1.103 diff -u -1 -0 -r1.103 if_sis.c --- pci/if_sis.c 2 Jul 2004 12:16:02 -0000 1.103 +++ pci/if_sis.c 9 Oct 2004 13:26:03 -0000 @@ -24,21 +24,21 @@ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.103 2004/07/02 12:16:02 mlaier Exp $"); +__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.104 2004/10/08 16:14:42 mlaier Exp $"); /* * SiS 900/SiS 7016 fast ethernet PCI NIC driver. Datasheets are * available from http://www.sis.com.tw. * * This driver also supports the NatSemi DP83815. Datasheets are * available from http://www.national.com. * * Written by Bill Paul * Electrical Engineering Department @@ -1947,21 +1947,21 @@ * copy of the pointers since the transmit list fragment pointers are * physical addresses. */ static void sis_start(ifp) struct ifnet *ifp; { struct sis_softc *sc; struct mbuf *m_head = NULL; - u_int32_t idx; + u_int32_t idx, queued = 0; sc = ifp->if_softc; SIS_LOCK(sc); if (!sc->sis_link) { SIS_UNLOCK(sc); return; } idx = sc->sis_cdata.sis_tx_prod; @@ -1975,36 +1975,40 @@ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; if (sis_encap(sc, &m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_flags |= IFF_OACTIVE; break; } + queued++; + /* * If there's a BPF listener, bounce a copy of this frame * to him. */ BPF_MTAP(ifp, m_head); } - /* Transmit */ - sc->sis_cdata.sis_tx_prod = idx; - SIS_SETBIT(sc, SIS_CSR, SIS_CSR_TX_ENABLE); + if (queued) { + /* Transmit */ + sc->sis_cdata.sis_tx_prod = idx; + SIS_SETBIT(sc, SIS_CSR, SIS_CSR_TX_ENABLE); - /* - * 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; + } SIS_UNLOCK(sc); return; } static void sis_init(xsc) void *xsc; {