Lines Matching full:tx
264 bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, BUS_DMASYNC_PREWRITE); in eqos_setup_txdesc()
265 sc->tx.desc_ring[index].des0 = htole32((uint32_t)paddr); in eqos_setup_txdesc()
266 sc->tx.desc_ring[index].des1 = htole32((uint32_t)(paddr >> 32)); in eqos_setup_txdesc()
267 sc->tx.desc_ring[index].des2 = htole32(tdes2 | len); in eqos_setup_txdesc()
268 sc->tx.desc_ring[index].des3 = htole32(tdes3 | total_len); in eqos_setup_txdesc()
275 int first = sc->tx.head; in eqos_setup_txbuf()
279 error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, in eqos_setup_txbuf()
280 sc->tx.buf_map[first].map, m, segs, &nsegs, 0); in eqos_setup_txbuf()
284 device_printf(sc->dev, "TX packet too big trying defrag\n"); in eqos_setup_txbuf()
285 bus_dmamap_unload(sc->tx.buf_tag, sc->tx.buf_map[first].map); in eqos_setup_txbuf()
289 error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, in eqos_setup_txbuf()
290 sc->tx.buf_map[first].map, m, segs, &nsegs, 0); in eqos_setup_txbuf()
295 if (TX_QUEUED(sc->tx.head, sc->tx.tail) + nsegs > TX_DESC_COUNT) { in eqos_setup_txbuf()
296 bus_dmamap_unload(sc->tx.buf_tag, sc->tx.buf_map[first].map); in eqos_setup_txbuf()
297 device_printf(sc->dev, "TX packet no more queue space\n"); in eqos_setup_txbuf()
301 bus_dmamap_sync(sc->tx.buf_tag, sc->tx.buf_map[first].map, in eqos_setup_txbuf()
304 sc->tx.buf_map[first].mbuf = m; in eqos_setup_txbuf()
309 eqos_setup_txdesc(sc, sc->tx.head, flags, segs[idx].ds_addr, in eqos_setup_txbuf()
313 sc->tx.head = TX_NEXT(sc->tx.head); in eqos_setup_txbuf()
320 bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, BUS_DMASYNC_PREWRITE); in eqos_setup_txbuf()
321 sc->tx.desc_ring[first].des3 |= htole32(EQOS_TDES3_OWN); in eqos_setup_txbuf()
476 (uint32_t)(sc->tx.desc_ring_paddr >> 32)); in eqos_init_rings()
478 (uint32_t)sc->tx.desc_ring_paddr); in eqos_init_rings()
602 if (TX_QUEUED(sc->tx.head, sc->tx.tail) >= in eqos_start_locked()
621 bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, in eqos_start_locked()
624 /* Start and run TX DMA */ in eqos_start_locked()
626 (uint32_t)sc->tx.desc_ring_paddr + DESC_OFFSET(sc->tx.head)); in eqos_start_locked()
669 /* Flush data in the TX FIFO */ in eqos_stop()
680 device_printf(sc->dev, "timeout flushing TX queue\n"); in eqos_stop()
753 while (sc->tx.tail != sc->tx.head) { in eqos_txintr()
754 tdes3 = le32toh(sc->tx.desc_ring[sc->tx.tail].des3); in eqos_txintr()
758 bmap = &sc->tx.buf_map[sc->tx.tail]; in eqos_txintr()
760 bus_dmamap_sync(sc->tx.buf_tag, bmap->map, in eqos_txintr()
762 bus_dmamap_unload(sc->tx.buf_tag, bmap->map); in eqos_txintr()
767 eqos_setup_txdesc(sc, sc->tx.tail, 0, 0, 0, 0); in eqos_txintr()
781 sc->tx.tail = TX_NEXT(sc->tx.tail); in eqos_txintr()
783 if (sc->tx.tail == sc->tx.head) in eqos_txintr()
879 device_printf(sc->dev, "RX/TX status interrupt\n"); in eqos_intr()
1010 /* Set up TX descriptor ring, descriptors, and dma maps */ in eqos_setup_dma()
1021 &sc->tx.desc_tag); in eqos_setup_dma()
1023 device_printf(sc->dev, "could not create TX ring DMA tag\n"); in eqos_setup_dma()
1027 error = bus_dmamem_alloc(sc->tx.desc_tag, in eqos_setup_dma()
1028 (void**)&sc->tx.desc_ring, in eqos_setup_dma()
1030 &sc->tx.desc_map); in eqos_setup_dma()
1033 "could not allocate TX descriptor ring.\n"); in eqos_setup_dma()
1038 error = bus_dmamap_load(sc->tx.desc_tag, sc->tx.desc_map, in eqos_setup_dma()
1039 sc->tx.desc_ring, TX_DESC_SIZE, in eqos_setup_dma()
1040 eqos_get1paddr, &sc->tx.desc_ring_paddr, in eqos_setup_dma()
1044 "could not load TX descriptor ring map.\n"); in eqos_setup_dma()
1058 &sc->tx.buf_tag); in eqos_setup_dma()
1060 device_printf(sc->dev, "could not create TX buffer DMA tag.\n"); in eqos_setup_dma()
1065 if ((error = bus_dmamap_create(sc->tx.buf_tag, BUS_DMA_COHERENT, in eqos_setup_dma()
1066 &sc->tx.buf_map[i].map))) { in eqos_setup_dma()
1067 device_printf(sc->dev, "cannot create TX buffer map\n"); in eqos_setup_dma()
1143 device_printf(sc->dev, "TX ring @ 0x%lx, RX ring @ 0x%lx\n", in eqos_setup_dma()
1144 sc->tx.desc_ring_paddr, sc->rx.desc_ring_paddr); in eqos_setup_dma()
1282 if (sc->tx.desc_tag) { in eqos_detach()
1283 if (sc->tx.desc_map) { in eqos_detach()
1284 bus_dmamap_unload(sc->tx.desc_tag, sc->tx.desc_map); in eqos_detach()
1285 bus_dmamem_free(sc->tx.desc_tag, sc->tx.desc_ring, in eqos_detach()
1286 sc->tx.desc_map); in eqos_detach()
1288 bus_dma_tag_destroy(sc->tx.desc_tag); in eqos_detach()
1290 if (sc->tx.buf_tag) { in eqos_detach()
1292 m_free(sc->tx.buf_map[i].mbuf); in eqos_detach()
1293 bus_dmamap_destroy(sc->tx.buf_tag, in eqos_detach()
1294 sc->tx.buf_map[i].map); in eqos_detach()
1296 bus_dma_tag_destroy(sc->tx.buf_tag); in eqos_detach()