Lines Matching defs:txs
145 struct gem_txsoft *txs;
236 txs = &sc->sc_txsoft[i];
237 txs->txs_mbuf = NULL;
238 txs->txs_ndescs = 0;
240 &txs->txs_dmamap)) != 0) {
246 STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q);
636 struct gem_txsoft *txs;
653 while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) {
655 if (txs->txs_ndescs != 0) {
656 bus_dmamap_sync(sc->sc_tdmatag, txs->txs_dmamap,
658 bus_dmamap_unload(sc->sc_tdmatag, txs->txs_dmamap);
659 if (txs->txs_mbuf != NULL) {
660 m_freem(txs->txs_mbuf);
661 txs->txs_mbuf = NULL;
664 STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q);
1074 struct gem_txsoft *txs;
1083 if ((txs = STAILQ_FIRST(&sc->sc_txfreeq)) == NULL) {
1111 error = bus_dmamap_load_mbuf_sg(sc->sc_tdmatag, txs->txs_dmamap,
1122 txs->txs_dmamap, *m_head, txsegs, &nsegs,
1147 txs->txs_ndescs = 0;
1148 bus_dmamap_unload(sc->sc_tdmatag, txs->txs_dmamap);
1152 txs->txs_ndescs = nsegs;
1153 txs->txs_firstdesc = sc->sc_txnext;
1154 nexttx = txs->txs_firstdesc;
1167 txs->txs_lastdesc = nexttx;
1175 sc->sc_txdescs[txs->txs_lastdesc].gd_flags |=
1185 sc->sc_txdescs[txs->txs_firstdesc].gd_flags |=
1188 sc->sc_txdescs[txs->txs_firstdesc].gd_flags |=
1192 bus_dmamap_sync(sc->sc_tdmatag, txs->txs_dmamap,
1197 __func__, txs->txs_firstdesc, txs->txs_lastdesc,
1198 txs->txs_ndescs);
1201 STAILQ_INSERT_TAIL(&sc->sc_txdirtyq, txs, txs_q);
1202 txs->txs_mbuf = *m_head;
1204 sc->sc_txnext = GEM_NEXTTX(txs->txs_lastdesc);
1205 sc->sc_txfree -= txs->txs_ndescs;
1375 struct gem_txsoft *txs;
1392 while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) {
1395 printf(" txsoft %p transmit chain:\n", txs);
1396 for (i = txs->txs_firstdesc;; i = GEM_NEXTTX(i)) {
1404 if (i == txs->txs_lastdesc)
1419 CTR4(KTR_GEM, "%s: txs->txs_firstdesc = %d, "
1420 "txs->txs_lastdesc = %d, txlast = %d",
1421 __func__, txs->txs_firstdesc, txs->txs_lastdesc, txlast);
1423 if (txs->txs_firstdesc <= txs->txs_lastdesc) {
1424 if ((txlast >= txs->txs_firstdesc) &&
1425 (txlast <= txs->txs_lastdesc))
1429 if ((txlast >= txs->txs_firstdesc) ||
1430 (txlast <= txs->txs_lastdesc))
1439 sc->sc_txfree += txs->txs_ndescs;
1441 bus_dmamap_sync(sc->sc_tdmatag, txs->txs_dmamap,
1443 bus_dmamap_unload(sc->sc_tdmatag, txs->txs_dmamap);
1444 if (txs->txs_mbuf != NULL) {
1445 m_freem(txs->txs_mbuf);
1446 txs->txs_mbuf = NULL;
1449 STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q);