Lines Matching refs:pd

239 pgt_reinit_rx_desc_frag(struct pgt_softc *sc, struct pgt_desc *pd)  in pgt_reinit_rx_desc_frag()  argument
241 pd->pd_fragp->pf_addr = htole32((uint32_t)pd->pd_dmaaddr); in pgt_reinit_rx_desc_frag()
242 pd->pd_fragp->pf_size = htole16(PGT_FRAG_SIZE); in pgt_reinit_rx_desc_frag()
243 pd->pd_fragp->pf_flags = 0; in pgt_reinit_rx_desc_frag()
245 bus_dmamap_sync(sc->sc_dmat, pd->pd_dmam, 0, pd->pd_dmam->dm_mapsize, in pgt_reinit_rx_desc_frag()
251 struct pgt_desc *pd) in pgt_load_tx_desc_frag() argument
255 error = bus_dmamap_load(sc->sc_dmat, pd->pd_dmam, pd->pd_mem, in pgt_load_tx_desc_frag()
263 pd->pd_dmaaddr = pd->pd_dmam->dm_segs[0].ds_addr; in pgt_load_tx_desc_frag()
264 pd->pd_fragp->pf_addr = htole32((uint32_t)pd->pd_dmaaddr); in pgt_load_tx_desc_frag()
265 pd->pd_fragp->pf_size = htole16(PGT_FRAG_SIZE); in pgt_load_tx_desc_frag()
266 pd->pd_fragp->pf_flags = htole16(0); in pgt_load_tx_desc_frag()
268 bus_dmamap_sync(sc->sc_dmat, pd->pd_dmam, 0, pd->pd_dmam->dm_mapsize, in pgt_load_tx_desc_frag()
275 pgt_unload_tx_desc_frag(struct pgt_softc *sc, struct pgt_desc *pd) in pgt_unload_tx_desc_frag() argument
277 bus_dmamap_unload(sc->sc_dmat, pd->pd_dmam); in pgt_unload_tx_desc_frag()
278 pd->pd_dmaaddr = 0; in pgt_unload_tx_desc_frag()
369 struct pgt_desc *pd; in pgt_cleanup_queue() local
375 TAILQ_FOREACH(pd, &sc->sc_freeq[pq], pd_link) { in pgt_cleanup_queue()
376 pd->pd_fragnum = i; in pgt_cleanup_queue()
377 pd->pd_fragp = &pqfrags[i]; in pgt_cleanup_queue()
379 pgt_reinit_rx_desc_frag(sc, pd); in pgt_cleanup_queue()
1250 struct pgt_desc *pd; in pgt_txdone() local
1252 pd = TAILQ_FIRST(&sc->sc_dirtyq[pq]); in pgt_txdone()
1253 TAILQ_REMOVE(&sc->sc_dirtyq[pq], pd, pd_link); in pgt_txdone()
1255 TAILQ_INSERT_TAIL(&sc->sc_freeq[pq], pd, pd_link); in pgt_txdone()
1257 bus_dmamap_sync(sc->sc_dmat, pd->pd_dmam, 0, in pgt_txdone()
1258 pd->pd_dmam->dm_mapsize, in pgt_txdone()
1263 sc->sc_dev.dv_xname, pd->pd_fragnum, pq)); in pgt_txdone()
1267 pmf = (struct pgt_mgmt_frame *)pd->pd_mem; in pgt_txdone()
1271 pd, pmf->pmf_version, pmf->pmf_operation, in pgt_txdone()
1275 pgt_unload_tx_desc_frag(sc, pd); in pgt_txdone()
1281 struct pgt_desc *pd; in pgt_rxdone() local
1283 pd = TAILQ_FIRST(&sc->sc_freeq[pq]); in pgt_rxdone()
1284 TAILQ_REMOVE(&sc->sc_freeq[pq], pd, pd_link); in pgt_rxdone()
1286 TAILQ_INSERT_TAIL(&sc->sc_dirtyq[pq], pd, pd_link); in pgt_rxdone()
1288 bus_dmamap_sync(sc->sc_dmat, pd->pd_dmam, 0, in pgt_rxdone()
1289 pd->pd_dmam->dm_mapsize, in pgt_rxdone()
1293 sc->sc_dev.dv_xname, pd->pd_fragnum, pq)); in pgt_rxdone()
1295 pd->pd_fragp->pf_flags & ~htole16(PF_FLAG_MF)) in pgt_rxdone()
1297 sc->sc_dev.dv_xname, pq, letoh16(pd->pd_fragp->pf_flags))); in pgt_rxdone()
1354 struct pgt_desc *pd; in pgt_mgmtrx_completion() local
1358 pd = TAILQ_FIRST(&sc->sc_dirtyq[PGT_QUEUE_MGMT_RX]); in pgt_mgmtrx_completion()
1359 TAILQ_REMOVE(&sc->sc_dirtyq[PGT_QUEUE_MGMT_RX], pd, pd_link); in pgt_mgmtrx_completion()
1362 pd, pd_link); in pgt_mgmtrx_completion()
1364 if (letoh16(pd->pd_fragp->pf_size) < sizeof(*pmf)) { in pgt_mgmtrx_completion()
1368 letoh16(pd->pd_fragp->pf_size))); in pgt_mgmtrx_completion()
1371 pmf = (struct pgt_mgmt_frame *)pd->pd_mem; in pgt_mgmtrx_completion()
1458 pgt_reinit_rx_desc_frag(sc, pd); in pgt_mgmtrx_completion()
1470 struct pgt_desc *pd; in pgt_datarx_completion() local
1481 while ((pd = TAILQ_FIRST(&sc->sc_dirtyq[pq])) != NULL) { in pgt_datarx_completion()
1482 TAILQ_REMOVE(&sc->sc_dirtyq[pq], pd, pd_link); in pgt_datarx_completion()
1484 datalen = letoh16(pd->pd_fragp->pf_size); in pgt_datarx_completion()
1485 dataoff = letoh32(pd->pd_fragp->pf_addr) - pd->pd_dmaaddr; in pgt_datarx_completion()
1486 morefrags = pd->pd_fragp->pf_flags & htole16(PF_FLAG_MF); in pgt_datarx_completion()
1491 pd->pd_fragp->pf_flags)); in pgt_datarx_completion()
1515 bcopy(pd->pd_mem + dataoff, mtod(m, char *), datalen); in pgt_datarx_completion()
1522 TAILQ_INSERT_TAIL(&sc->sc_freeq[pq], pd, pd_link); in pgt_datarx_completion()
1524 pgt_reinit_rx_desc_frag(sc, pd); in pgt_datarx_completion()
1536 TAILQ_INSERT_TAIL(&sc->sc_freeq[pq], pd, pd_link); in pgt_datarx_completion()
1538 pgt_reinit_rx_desc_frag(sc, pd); in pgt_datarx_completion()
1648 struct pgt_desc *pd; in pgt_mgmt_request() local
1656 pd = TAILQ_FIRST(&sc->sc_freeq[PGT_QUEUE_MGMT_TX]); in pgt_mgmt_request()
1657 if (pd == NULL) in pgt_mgmt_request()
1659 error = pgt_load_tx_desc_frag(sc, PGT_QUEUE_MGMT_TX, pd); in pgt_mgmt_request()
1662 pmf = (struct pgt_mgmt_frame *)pd->pd_mem; in pgt_mgmt_request()
1685 pgt_desc_transmit(sc, PGT_QUEUE_MGMT_TX, pd, in pgt_mgmt_request()
1730 pgt_desc_transmit(struct pgt_softc *sc, enum pgt_queue pq, struct pgt_desc *pd, in pgt_desc_transmit() argument
1733 TAILQ_REMOVE(&sc->sc_freeq[pq], pd, pd_link); in pgt_desc_transmit()
1735 TAILQ_INSERT_TAIL(&sc->sc_dirtyq[pq], pd, pd_link); in pgt_desc_transmit()
1739 pd->pd_fragnum, pq)); in pgt_desc_transmit()
1744 pd->pd_fragp->pf_flags |= htole16(PF_FLAG_MF); in pgt_desc_transmit()
1745 pd->pd_fragp->pf_size = htole16(len); in pgt_desc_transmit()
1746 bus_dmamap_sync(sc->sc_dmat, pd->pd_dmam, 0, in pgt_desc_transmit()
1747 pd->pd_dmam->dm_mapsize, in pgt_desc_transmit()
2099 struct pgt_desc *pd; in pgt_start() local
2119 pd = TAILQ_FIRST(&sc->sc_freeq[PGT_QUEUE_DATA_LOW_TX]); in pgt_start()
2125 PGT_QUEUE_DATA_LOW_TX, pd); in pgt_start()
2131 m_copydata(m, 0, m->m_pkthdr.len, pd->pd_mem); in pgt_start()
2133 pd, m->m_pkthdr.len, 0); in pgt_start()
2148 pd2 = TAILQ_NEXT(pd, pd_link); in pgt_start()
2150 PGT_QUEUE_DATA_LOW_TX, pd); in pgt_start()
2155 pgt_unload_tx_desc_frag(sc, pd); in pgt_start()
2157 PGT_QUEUE_DATA_LOW_TX], pd, in pgt_start()
2166 m_copydata(m, 0, PGT_FRAG_SIZE, pd->pd_mem); in pgt_start()
2168 pd, PGT_FRAG_SIZE, 1); in pgt_start()
2975 struct pgt_desc *pd; in pgt_drain_tx_queue() local
2977 pd = TAILQ_FIRST(&sc->sc_dirtyq[pq]); in pgt_drain_tx_queue()
2978 TAILQ_REMOVE(&sc->sc_dirtyq[pq], pd, pd_link); in pgt_drain_tx_queue()
2980 TAILQ_INSERT_TAIL(&sc->sc_freeq[pq], pd, pd_link); in pgt_drain_tx_queue()
2982 pgt_unload_tx_desc_frag(sc, pd); in pgt_drain_tx_queue()
2985 sc->sc_dev.dv_xname, pd->pd_fragnum, pq)); in pgt_drain_tx_queue()
3118 struct pgt_desc *pd; in pgt_dma_alloc_queue() local
3146 pd = malloc(sizeof(*pd), M_DEVBUF, M_WAITOK); in pgt_dma_alloc_queue()
3149 PGT_FRAG_SIZE, 0, BUS_DMA_ALLOCNOW, &pd->pd_dmam); in pgt_dma_alloc_queue()
3153 free(pd, M_DEVBUF, 0); in pgt_dma_alloc_queue()
3158 0, &pd->pd_dmas, 1, &nsegs, BUS_DMA_WAITOK); in pgt_dma_alloc_queue()
3162 free(pd, M_DEVBUF, 0); in pgt_dma_alloc_queue()
3166 error = bus_dmamem_map(sc->sc_dmat, &pd->pd_dmas, nsegs, in pgt_dma_alloc_queue()
3167 PGT_FRAG_SIZE, (caddr_t *)&pd->pd_mem, BUS_DMA_WAITOK); in pgt_dma_alloc_queue()
3171 free(pd, M_DEVBUF, 0); in pgt_dma_alloc_queue()
3176 error = bus_dmamap_load(sc->sc_dmat, pd->pd_dmam, in pgt_dma_alloc_queue()
3177 pd->pd_mem, PGT_FRAG_SIZE, NULL, BUS_DMA_NOWAIT); in pgt_dma_alloc_queue()
3181 bus_dmamem_free(sc->sc_dmat, &pd->pd_dmas, in pgt_dma_alloc_queue()
3183 free(pd, M_DEVBUF, 0); in pgt_dma_alloc_queue()
3186 pd->pd_dmaaddr = pd->pd_dmam->dm_segs[0].ds_addr; in pgt_dma_alloc_queue()
3188 TAILQ_INSERT_TAIL(&sc->sc_freeq[pq], pd, pd_link); in pgt_dma_alloc_queue()
3233 struct pgt_desc *pd; in pgt_dma_free_queue() local
3236 pd = TAILQ_FIRST(&sc->sc_freeq[pq]); in pgt_dma_free_queue()
3237 TAILQ_REMOVE(&sc->sc_freeq[pq], pd, pd_link); in pgt_dma_free_queue()
3238 if (pd->pd_dmam != NULL) { in pgt_dma_free_queue()
3239 bus_dmamap_unload(sc->sc_dmat, pd->pd_dmam); in pgt_dma_free_queue()
3240 pd->pd_dmam = NULL; in pgt_dma_free_queue()
3242 bus_dmamem_free(sc->sc_dmat, &pd->pd_dmas, 1); in pgt_dma_free_queue()
3243 free(pd, M_DEVBUF, 0); in pgt_dma_free_queue()