Lines Matching refs:rxq
580 struct athn_rxq *rxq = &sc->sc_rxq[0]; in ar5008_rx_alloc() local
586 rxq->bf = malloc(ATHN_NRXBUFS * sizeof(*bf), M_DEVBUF, in ar5008_rx_alloc()
592 BUS_DMA_NOWAIT, &rxq->map); in ar5008_rx_alloc()
596 error = bus_dmamem_alloc(sc->sc_dmat, size, 0, 0, &rxq->seg, 1, in ar5008_rx_alloc()
602 error = bus_dmamem_map(sc->sc_dmat, &rxq->seg, 1, size, in ar5008_rx_alloc()
603 (void **)&rxq->descs, BUS_DMA_NOWAIT | BUS_DMA_COHERENT); in ar5008_rx_alloc()
607 error = bus_dmamap_load(sc->sc_dmat, rxq->map, rxq->descs, in ar5008_rx_alloc()
613 bf = &rxq->bf[i]; in ar5008_rx_alloc()
614 ds = &((struct ar_rx_desc *)rxq->descs)[i]; in ar5008_rx_alloc()
649 bf->bf_daddr = rxq->map->dm_segs[0].ds_addr + in ar5008_rx_alloc()
661 struct athn_rxq *rxq = &sc->sc_rxq[0]; in ar5008_rx_free() local
665 if (rxq->bf == NULL) in ar5008_rx_free()
668 bf = &rxq->bf[i]; in ar5008_rx_free()
674 free(rxq->bf, M_DEVBUF); in ar5008_rx_free()
677 if (rxq->map != NULL) { in ar5008_rx_free()
678 if (rxq->descs != NULL) { in ar5008_rx_free()
679 bus_dmamap_unload(sc->sc_dmat, rxq->map); in ar5008_rx_free()
680 bus_dmamem_unmap(sc->sc_dmat, (void *)rxq->descs, in ar5008_rx_free()
682 bus_dmamem_free(sc->sc_dmat, &rxq->seg, 1); in ar5008_rx_free()
684 bus_dmamap_destroy(sc->sc_dmat, rxq->map); in ar5008_rx_free()
691 struct athn_rxq *rxq = &sc->sc_rxq[0]; in ar5008_rx_enable() local
697 SIMPLEQ_INIT(&rxq->head); in ar5008_rx_enable()
698 rxq->lastds = NULL; in ar5008_rx_enable()
700 bf = &rxq->bf[i]; in ar5008_rx_enable()
707 if (rxq->lastds != NULL) { in ar5008_rx_enable()
708 ((struct ar_rx_desc *)rxq->lastds)->ds_link = in ar5008_rx_enable()
711 SIMPLEQ_INSERT_TAIL(&rxq->head, bf, bf_list); in ar5008_rx_enable()
712 rxq->lastds = ds; in ar5008_rx_enable()
714 bus_dmamap_sync(sc->sc_dmat, rxq->map, 0, rxq->map->dm_mapsize, in ar5008_rx_enable()
718 AR_WRITE(sc, AR_RXDP, SIMPLEQ_FIRST(&rxq->head)->bf_daddr); in ar5008_rx_enable()
790 struct athn_rxq *rxq = &sc->sc_rxq[0]; in ar5008_rx_process() local
799 bf = SIMPLEQ_FIRST(&rxq->head); in ar5008_rx_process()
940 SIMPLEQ_REMOVE_HEAD(&rxq->head, bf_list); in ar5008_rx_process()
946 if (__predict_true(!SIMPLEQ_EMPTY(&rxq->head))) in ar5008_rx_process()
947 ((struct ar_rx_desc *)rxq->lastds)->ds_link = bf->bf_daddr; in ar5008_rx_process()
950 SIMPLEQ_INSERT_TAIL(&rxq->head, bf, bf_list); in ar5008_rx_process()
951 rxq->lastds = ds; in ar5008_rx_process()