Lines Matching refs:txq

555 malo_txdma_setup(struct malo_softc *sc, struct malo_txq *txq)
561 error = malo_desc_setup(sc, "tx", &txq->dma,
575 txq->dma.dd_bufptr = bf;
577 STAILQ_INIT(&txq->free);
578 txq->nfree = 0;
579 ds = txq->dma.dd_desc;
582 bf->bf_daddr = DS2PHYS(&txq->dma, ds);
591 STAILQ_INSERT_TAIL(&txq->free, bf, bf_list);
592 txq->nfree++;
633 malo_txdma_cleanup(struct malo_softc *sc, struct malo_txq *txq)
638 STAILQ_FOREACH(bf, &txq->free, bf_list) {
656 STAILQ_INIT(&txq->free);
657 txq->nfree = 0;
658 if (txq->dma.dd_bufptr != NULL) {
659 free(txq->dma.dd_bufptr, M_MALODEV);
660 txq->dma.dd_bufptr = NULL;
662 if (txq->dma.dd_desc_len != 0)
663 malo_desc_cleanup(sc, &txq->dma);
727 struct malo_txq *txq;
732 txq = &sc->malo_txq[i];
733 sc->malo_hwdma.wcbbase[i] = txq->dma.dd_desc_paddr;
744 malo_txq_init(struct malo_softc *sc, struct malo_txq *txq, int qnum)
749 MALO_TXQ_LOCK_INIT(sc, txq);
750 txq->qnum = qnum;
751 txq->txpri = 0; /* XXX */
753 STAILQ_FOREACH(bf, &txq->free, bf_list) {
754 bf->bf_txq = txq;
759 bn = STAILQ_FIRST(&txq->free);
762 STAILQ_INIT(&txq->active);
769 malo_tx_cleanupq(struct malo_softc *sc, struct malo_txq *txq)
772 MALO_TXQ_LOCK_DESTROY(txq);
779 malo_getbuf(struct malo_softc *sc, struct malo_txq *txq)
783 MALO_TXQ_LOCK(txq);
784 bf = STAILQ_FIRST(&txq->free);
786 STAILQ_REMOVE_HEAD(&txq->free, bf_list);
787 txq->nfree--;
789 MALO_TXQ_UNLOCK(txq);
792 "%s: out of xmit buffers on q %d\n", __func__, txq->qnum);
925 malo_tx_processq(struct malo_softc *sc, struct malo_txq *txq)
934 __func__, txq->qnum);
936 MALO_TXQ_LOCK(txq);
937 bf = STAILQ_FIRST(&txq->active);
939 MALO_TXQ_UNLOCK(txq);
943 MALO_TXDESC_SYNC(txq, ds,
946 MALO_TXQ_UNLOCK(txq);
949 STAILQ_REMOVE_HEAD(&txq->active, bf_list);
950 MALO_TXQ_UNLOCK(txq);
954 malo_printtxbuf(bf, txq->qnum, nreaped);
995 MALO_TXQ_LOCK(txq);
996 STAILQ_INSERT_TAIL(&txq->free, bf, bf_list);
997 txq->nfree++;
998 MALO_TXQ_UNLOCK(txq);
1042 struct malo_txq *txq;
1155 txq = bf->bf_txq;
1176 ds->txpriority = txq->qnum;
1193 MALO_TXQ_LOCK(txq);
1197 STAILQ_INSERT_TAIL(&txq->active, bf, bf_list);
1198 MALO_TXDESC_SYNC(txq, ds, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
1201 MALO_TXQ_UNLOCK(txq);
1230 struct malo_txq *txq = &sc->malo_txq[0];
1242 bf = malo_getbuf(sc, txq);
1257 MALO_TXQ_LOCK(txq);
1258 STAILQ_INSERT_HEAD(&txq->free, bf, bf_list);
1259 MALO_TXQ_UNLOCK(txq);
1575 malo_tx_draintxq(struct malo_softc *sc, struct malo_txq *txq)
1586 MALO_TXQ_LOCK(txq);
1587 bf = STAILQ_FIRST(&txq->active);
1589 MALO_TXQ_UNLOCK(txq);
1592 STAILQ_REMOVE_HEAD(&txq->active, bf_list);
1593 MALO_TXQ_UNLOCK(txq);
1599 malo_printtxbuf(bf, txq->qnum, ix);
1616 MALO_TXQ_LOCK(txq);
1617 STAILQ_INSERT_TAIL(&txq->free, bf, bf_list);
1618 txq->nfree++;
1619 MALO_TXQ_UNLOCK(txq);
1775 struct malo_txq *txq;
1788 txq = &sc->malo_txq[0];
1789 bf = malo_getbuf(sc, txq);
1801 MALO_TXQ_LOCK(txq);
1802 STAILQ_INSERT_HEAD(&txq->free, bf, bf_list);
1803 txq->nfree++;
1804 MALO_TXQ_UNLOCK(txq);