Index: if_pcn.c =================================================================== RCS file: /usr/store/mlaier/fcvs/src/sys/pci/if_pcn.c,v retrieving revision 1.59.2.2 diff -u -r1.59.2.2 if_pcn.c --- if_pcn.c 9 Sep 2004 13:19:39 -0000 1.59.2.2 +++ if_pcn.c 8 Oct 2004 15:17:03 -0000 @@ -559,7 +559,9 @@ ifp->if_watchdog = pcn_watchdog; ifp->if_init = pcn_init; ifp->if_baudrate = 10000000; - ifp->if_snd.ifq_maxlen = PCN_TX_LIST_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, PCN_TX_LIST_CNT - 1); + ifp->if_snd.ifq_drv_maxlen = PCN_TX_LIST_CNT - 1; + IFQ_SET_READY(&ifp->if_snd); /* * Do MII setup. @@ -880,7 +882,7 @@ if (!sc->pcn_link && mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { sc->pcn_link++; - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) pcn_start(ifp); } @@ -927,7 +929,7 @@ } } - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) pcn_start(ifp); PCN_UNLOCK(sc); @@ -1001,6 +1003,7 @@ struct pcn_softc *sc; struct mbuf *m_head = NULL; u_int32_t idx; + int queued = 0; sc = ifp->if_softc; @@ -1019,16 +1022,18 @@ } while(sc->pcn_cdata.pcn_tx_chain[idx] == NULL) { - IF_DEQUEUE(&ifp->if_snd, m_head); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; if (pcn_encap(sc, m_head, &idx)) { - IF_PREPEND(&ifp->if_snd, m_head); + 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. @@ -1037,14 +1042,16 @@ } - /* Transmit */ - sc->pcn_cdata.pcn_tx_prod = idx; - pcn_csr_write(sc, PCN_CSR_CSR, PCN_CSR_TX|PCN_CSR_INTEN); + if (queued) { + /* Transmit */ + sc->pcn_cdata.pcn_tx_prod = idx; + pcn_csr_write(sc, PCN_CSR_CSR, PCN_CSR_TX|PCN_CSR_INTEN); - /* - * 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; + } PCN_UNLOCK(sc); @@ -1311,7 +1318,7 @@ pcn_reset(sc); pcn_init(sc); - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) pcn_start(ifp); PCN_UNLOCK(sc);