Lines Matching refs:idx

184 txdesc_clear(struct dwc_softc *sc, int idx)  in txdesc_clear()  argument
188 sc->txdesc_ring[idx].addr1 = (uint32_t)(0); in txdesc_clear()
189 sc->txdesc_ring[idx].desc0 = 0; in txdesc_clear()
190 sc->txdesc_ring[idx].desc1 = 0; in txdesc_clear()
194 txdesc_setup(struct dwc_softc *sc, int idx, bus_addr_t paddr, in txdesc_setup() argument
215 sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); in txdesc_setup()
216 sc->txdesc_ring[idx].desc0 = desc0; in txdesc_setup()
217 sc->txdesc_ring[idx].desc1 = desc1; in txdesc_setup()
219 sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; in txdesc_setup()
224 rxdesc_setup(struct dwc_softc *sc, int idx, bus_addr_t paddr) in rxdesc_setup() argument
228 sc->rxdesc_ring[idx].addr1 = (uint32_t)paddr; in rxdesc_setup()
229 nidx = next_rxidx(sc, idx); in rxdesc_setup()
230 sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + in rxdesc_setup()
233 sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | in rxdesc_setup()
236 sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | in rxdesc_setup()
240 sc->rxdesc_ring[idx].desc0 = RDESC0_OWN; in rxdesc_setup()
246 dma1000_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp) in dma1000_setup_txbuf() argument
255 error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, in dma1000_setup_txbuf()
262 bus_dmamap_unload(sc->txbuf_tag, sc->txbuf_map[idx].map); in dma1000_setup_txbuf()
266 error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, in dma1000_setup_txbuf()
273 bus_dmamap_unload(sc->txbuf_tag, sc->txbuf_map[idx].map); in dma1000_setup_txbuf()
293 bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map, in dma1000_setup_txbuf()
296 sc->txbuf_map[idx].mbuf = m; in dma1000_setup_txbuf()
308 sc->txbuf_map[idx].last_desc_idx = last; in dma1000_setup_txbuf()
314 dma1000_setup_rxbuf(struct dwc_softc *sc, int idx, struct mbuf *m) in dma1000_setup_rxbuf() argument
321 error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map, in dma1000_setup_rxbuf()
328 bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, in dma1000_setup_rxbuf()
331 sc->rxbuf_map[idx].mbuf = m; in dma1000_setup_rxbuf()
332 rxdesc_setup(sc, idx, seg.ds_addr); in dma1000_setup_rxbuf()
427 int idx, last_idx; in dma1000_txfinish_locked() local
437 idx = sc->tx_desc_tail; in dma1000_txfinish_locked()
439 while (idx != last_idx) { in dma1000_txfinish_locked()
440 desc = &sc->txdesc_ring[idx]; in dma1000_txfinish_locked()
445 idx = next_txidx(sc, idx); in dma1000_txfinish_locked()
514 int error, idx; in dma1000_rxfinish_locked() local
519 idx = sc->rx_idx; in dma1000_rxfinish_locked()
520 desc = sc->rxdesc_ring + idx; in dma1000_rxfinish_locked()
524 m = dwc_rxfinish_one(sc, desc, sc->rxbuf_map + idx); in dma1000_rxfinish_locked()
531 error = dma1000_setup_rxbuf(sc, idx, m); in dma1000_rxfinish_locked()
624 int idx; in dma1000_init() local
689 for (idx = 0; idx < TX_DESC_COUNT; idx++) { in dma1000_init()
690 nidx = next_txidx(sc, idx); in dma1000_init()
691 sc->txdesc_ring[idx].addr2 = sc->txdesc_ring_paddr + in dma1000_init()
713 for (idx = 0; idx < TX_MAP_COUNT; idx++) { in dma1000_init()
715 &sc->txbuf_map[idx].map); in dma1000_init()
723 for (idx = 0; idx < TX_DESC_COUNT; idx++) in dma1000_init()
724 txdesc_clear(sc, idx); in dma1000_init()
783 for (idx = 0; idx < RX_DESC_COUNT; idx++) { in dma1000_init()
785 &sc->rxbuf_map[idx].map); in dma1000_init()
796 if ((error = dma1000_setup_rxbuf(sc, idx, m)) != 0) { in dma1000_init()
818 int idx; in dma1000_free() local
821 for (idx = 0; idx < RX_DESC_COUNT; ++idx) { in dma1000_free()
822 if ((map = sc->rxbuf_map[idx].map) != NULL) { in dma1000_free()
825 m_freem(sc->rxbuf_map[idx].mbuf); in dma1000_free()
839 for (idx = 0; idx < TX_DESC_COUNT; ++idx) { in dma1000_free()
840 if ((map = sc->txbuf_map[idx].map) != NULL) { in dma1000_free()