Lines Matching defs:txq

553 malo_txdma_setup(struct malo_softc *sc, struct malo_txq *txq)
559 error = malo_desc_setup(sc, "tx", &txq->dma,
573 txq->dma.dd_bufptr = bf;
575 STAILQ_INIT(&txq->free);
576 txq->nfree = 0;
577 ds = txq->dma.dd_desc;
580 bf->bf_daddr = DS2PHYS(&txq->dma, ds);
589 STAILQ_INSERT_TAIL(&txq->free, bf, bf_list);
590 txq->nfree++;
631 malo_txdma_cleanup(struct malo_softc *sc, struct malo_txq *txq)
636 STAILQ_FOREACH(bf, &txq->free, bf_list) {
654 STAILQ_INIT(&txq->free);
655 txq->nfree = 0;
656 if (txq->dma.dd_bufptr != NULL) {
657 free(txq->dma.dd_bufptr, M_MALODEV);
658 txq->dma.dd_bufptr = NULL;
660 if (txq->dma.dd_desc_len != 0)
661 malo_desc_cleanup(sc, &txq->dma);
725 struct malo_txq *txq;
730 txq = &sc->malo_txq[i];
731 sc->malo_hwdma.wcbbase[i] = txq->dma.dd_desc_paddr;
742 malo_txq_init(struct malo_softc *sc, struct malo_txq *txq, int qnum)
747 MALO_TXQ_LOCK_INIT(sc, txq);
748 txq->qnum = qnum;
749 txq->txpri = 0; /* XXX */
751 STAILQ_FOREACH(bf, &txq->free, bf_list) {
752 bf->bf_txq = txq;
757 bn = STAILQ_FIRST(&txq->free);
760 STAILQ_INIT(&txq->active);
767 malo_tx_cleanupq(struct malo_softc *sc, struct malo_txq *txq)
770 MALO_TXQ_LOCK_DESTROY(txq);
777 malo_getbuf(struct malo_softc *sc, struct malo_txq *txq)
781 MALO_TXQ_LOCK(txq);
782 bf = STAILQ_FIRST(&txq->free);
784 STAILQ_REMOVE_HEAD(&txq->free, bf_list);
785 txq->nfree--;
787 MALO_TXQ_UNLOCK(txq);
790 "%s: out of xmit buffers on q %d\n", __func__, txq->qnum);
927 malo_tx_processq(struct malo_softc *sc, struct malo_txq *txq)
936 __func__, txq->qnum);
938 MALO_TXQ_LOCK(txq);
939 bf = STAILQ_FIRST(&txq->active);
941 MALO_TXQ_UNLOCK(txq);
945 MALO_TXDESC_SYNC(txq, ds,
948 MALO_TXQ_UNLOCK(txq);
951 STAILQ_REMOVE_HEAD(&txq->active, bf_list);
952 MALO_TXQ_UNLOCK(txq);
956 malo_printtxbuf(bf, txq->qnum, nreaped);
996 MALO_TXQ_LOCK(txq);
997 STAILQ_INSERT_TAIL(&txq->free, bf, bf_list);
998 txq->nfree++;
999 MALO_TXQ_UNLOCK(txq);
1043 struct malo_txq *txq;
1156 txq = bf->bf_txq;
1177 ds->txpriority = txq->qnum;
1194 MALO_TXQ_LOCK(txq);
1198 STAILQ_INSERT_TAIL(&txq->active, bf, bf_list);
1199 MALO_TXDESC_SYNC(txq, ds, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
1202 MALO_TXQ_UNLOCK(txq);
1231 struct malo_txq *txq = &sc->malo_txq[0];
1243 bf = malo_getbuf(sc, txq);
1258 MALO_TXQ_LOCK(txq);
1259 STAILQ_INSERT_HEAD(&txq->free, bf, bf_list);
1260 MALO_TXQ_UNLOCK(txq);
1576 malo_tx_draintxq(struct malo_softc *sc, struct malo_txq *txq)
1587 MALO_TXQ_LOCK(txq);
1588 bf = STAILQ_FIRST(&txq->active);
1590 MALO_TXQ_UNLOCK(txq);
1593 STAILQ_REMOVE_HEAD(&txq->active, bf_list);
1594 MALO_TXQ_UNLOCK(txq);
1600 malo_printtxbuf(bf, txq->qnum, ix);
1617 MALO_TXQ_LOCK(txq);
1618 STAILQ_INSERT_TAIL(&txq->free, bf, bf_list);
1619 txq->nfree++;
1620 MALO_TXQ_UNLOCK(txq);
1776 struct malo_txq *txq;
1789 txq = &sc->malo_txq[0];
1790 bf = malo_getbuf(sc, txq);
1802 MALO_TXQ_LOCK(txq);
1803 STAILQ_INSERT_HEAD(&txq->free, bf, bf_list);
1804 txq->nfree++;
1805 MALO_TXQ_UNLOCK(txq);