FreeBSD/sys/dev/vnic/nicvf_queues.c
/* Free queue's descriptor memory */
Free queue's descriptor memory
Free queue ' s descriptor memory
static void
nicvf_free_q_desc_mem(struct nicvf *nic, struct q_desc_mem *dmem)
{
	int err;
	if ((dmem == NULL) || (dmem->base == NULL))
		return;
	bus_dmamap_sync(dmem->dmat, dmem->dmap, BUS_DMASYNC_POSTREAD);
	bus_dmamap_unload(dmem->dmat, dmem->dmap);
	bus_dmamem_free(dmem->dmat, dmem->base, dmem->dmap);
	err = bus_dma_tag_destroy(dmem->dmat);
	KASSERT(err == 0,
	    ("%s: Trying to destroy BUSY DMA tag", __func__));
	dmem->phys_base = 0;
	dmem->base = NULL;
}
static void nicvf_free_q_desc_mem ( struct nicvf * nic , struct q_desc_mem * dmem ) { int err ; if ( ( dmem == NULL ) || ( dmem -> base == NULL ) ) return ; bus_dmamap_sync ( dmem -> dmat , dmem -> dmap , BUS_DMASYNC_POSTREAD ) ; bus_dmamap_unload ( dmem -> dmat , dmem -> dmap ) ; bus_dmamem_free ( dmem -> dmat , dmem -> base , dmem -> dmap ) ; err = bus_dma_tag_destroy ( dmem -> dmat ) ; KASSERT ( err == 0 , ( " " , __func__ ) ) ; dmem -> phys_base = 0 ; dmem -> base = NULL ; }
Free queue's descriptor memory
Free queue ' s descriptor memory
/* Unload a map */ /* Free DMA memory */ /* Destroy DMA tag */