Lines Matching full:tx

262 	bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, BUS_DMASYNC_PREWRITE);  in eqos_setup_txdesc()
263 sc->tx.desc_ring[index].des0 = htole32((uint32_t)paddr); in eqos_setup_txdesc()
264 sc->tx.desc_ring[index].des1 = htole32((uint32_t)(paddr >> 32)); in eqos_setup_txdesc()
265 sc->tx.desc_ring[index].des2 = htole32(tdes2 | len); in eqos_setup_txdesc()
266 sc->tx.desc_ring[index].des3 = htole32(tdes3 | total_len); in eqos_setup_txdesc()
273 int first = sc->tx.head; in eqos_setup_txbuf()
277 error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, in eqos_setup_txbuf()
278 sc->tx.buf_map[first].map, m, segs, &nsegs, 0); in eqos_setup_txbuf()
282 device_printf(sc->dev, "TX packet too big trying defrag\n"); in eqos_setup_txbuf()
283 bus_dmamap_unload(sc->tx.buf_tag, sc->tx.buf_map[first].map); in eqos_setup_txbuf()
287 error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, in eqos_setup_txbuf()
288 sc->tx.buf_map[first].map, m, segs, &nsegs, 0); in eqos_setup_txbuf()
293 if (TX_QUEUED(sc->tx.head, sc->tx.tail) + nsegs > TX_DESC_COUNT) { in eqos_setup_txbuf()
294 bus_dmamap_unload(sc->tx.buf_tag, sc->tx.buf_map[first].map); in eqos_setup_txbuf()
295 device_printf(sc->dev, "TX packet no more queue space\n"); in eqos_setup_txbuf()
299 bus_dmamap_sync(sc->tx.buf_tag, sc->tx.buf_map[first].map, in eqos_setup_txbuf()
302 sc->tx.buf_map[first].mbuf = m; in eqos_setup_txbuf()
307 eqos_setup_txdesc(sc, sc->tx.head, flags, segs[idx].ds_addr, in eqos_setup_txbuf()
311 sc->tx.head = TX_NEXT(sc->tx.head); in eqos_setup_txbuf()
318 bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, BUS_DMASYNC_PREWRITE); in eqos_setup_txbuf()
319 sc->tx.desc_ring[first].des3 |= htole32(EQOS_TDES3_OWN); in eqos_setup_txbuf()
473 (uint32_t)(sc->tx.desc_ring_paddr >> 32)); in eqos_init_rings()
475 (uint32_t)sc->tx.desc_ring_paddr); in eqos_init_rings()
586 if (TX_QUEUED(sc->tx.head, sc->tx.tail) >= in eqos_start_locked()
605 bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, in eqos_start_locked()
608 /* Start and run TX DMA */ in eqos_start_locked()
610 (uint32_t)sc->tx.desc_ring_paddr + DESC_OFFSET(sc->tx.head)); in eqos_start_locked()
653 /* Flush data in the TX FIFO */ in eqos_stop()
664 device_printf(sc->dev, "timeout flushing TX queue\n"); in eqos_stop()
738 while (sc->tx.tail != sc->tx.head) { in eqos_txintr()
739 tdes3 = le32toh(sc->tx.desc_ring[sc->tx.tail].des3); in eqos_txintr()
743 bmap = &sc->tx.buf_map[sc->tx.tail]; in eqos_txintr()
745 bus_dmamap_sync(sc->tx.buf_tag, bmap->map, in eqos_txintr()
747 bus_dmamap_unload(sc->tx.buf_tag, bmap->map); in eqos_txintr()
752 eqos_setup_txdesc(sc, sc->tx.tail, 0, 0, 0, 0); in eqos_txintr()
766 sc->tx.tail = TX_NEXT(sc->tx.tail); in eqos_txintr()
768 if (sc->tx.tail == sc->tx.head) in eqos_txintr()
864 device_printf(sc->dev, "RX/TX status interrupt\n"); in eqos_intr()
997 /* Set up TX descriptor ring, descriptors, and dma maps */ in eqos_setup_dma()
1003 NULL, NULL, &sc->tx.desc_tag))) { in eqos_setup_dma()
1004 device_printf(sc->dev, "could not create TX ring DMA tag\n"); in eqos_setup_dma()
1008 if ((error = bus_dmamem_alloc(sc->tx.desc_tag, in eqos_setup_dma()
1009 (void**)&sc->tx.desc_ring, in eqos_setup_dma()
1011 &sc->tx.desc_map))) { in eqos_setup_dma()
1013 "could not allocate TX descriptor ring.\n"); in eqos_setup_dma()
1017 if ((error = bus_dmamap_load(sc->tx.desc_tag, sc->tx.desc_map, in eqos_setup_dma()
1018 sc->tx.desc_ring, in eqos_setup_dma()
1019 TX_DESC_SIZE, eqos_get1paddr, &sc->tx.desc_ring_paddr, 0))) { in eqos_setup_dma()
1021 "could not load TX descriptor ring map.\n"); in eqos_setup_dma()
1030 &sc->tx.buf_tag))) { in eqos_setup_dma()
1031 device_printf(sc->dev, "could not create TX buffer DMA tag.\n"); in eqos_setup_dma()
1036 if ((error = bus_dmamap_create(sc->tx.buf_tag, BUS_DMA_COHERENT, in eqos_setup_dma()
1037 &sc->tx.buf_map[i].map))) { in eqos_setup_dma()
1038 device_printf(sc->dev, "cannot create TX buffer map\n"); in eqos_setup_dma()
1099 device_printf(sc->dev, "TX ring @ 0x%lx, RX ring @ 0x%lx\n", in eqos_setup_dma()
1100 sc->tx.desc_ring_paddr, sc->rx.desc_ring_paddr); in eqos_setup_dma()
1230 if (sc->tx.desc_tag) { in eqos_detach()
1231 if (sc->tx.desc_map) { in eqos_detach()
1232 bus_dmamap_unload(sc->tx.desc_tag, sc->tx.desc_map); in eqos_detach()
1233 bus_dmamem_free(sc->tx.desc_tag, sc->tx.desc_ring, in eqos_detach()
1234 sc->tx.desc_map); in eqos_detach()
1236 bus_dma_tag_destroy(sc->tx.desc_tag); in eqos_detach()
1238 if (sc->tx.buf_tag) { in eqos_detach()
1240 m_free(sc->tx.buf_map[i].mbuf); in eqos_detach()
1241 bus_dmamap_destroy(sc->tx.buf_tag, in eqos_detach()
1242 sc->tx.buf_map[i].map); in eqos_detach()
1244 bus_dma_tag_destroy(sc->tx.buf_tag); in eqos_detach()