FreeBSD/sys/dev/bxe/bxe.c
/*
 * Get DMA memory from the OS.
 *
 * Validates that the OS has provided DMA buffers in response to a
 * bus_dmamap_load call and saves the physical address of those buffers.
 * When the callback is used the OS will return 0 for the mapping function
 * (bus_dmamap_load) so we use the value of map_arg->maxsegs to pass any
 * failures back to the caller.
 *
 * Returns:
 *   Nothing.
 */
Get DMA memory from the OS.
Validates that the OS has provided DMA buffers in response to a
bus_dmamap_load call and saves the physical address of those buffers.
When the callback is used the OS will return 0 for the mapping function
(bus_dmamap_load) so we use the value of map_arg->maxsegs to pass any
failures back to the caller.

Nothing.
Get DMA memory from the OS . Validates that the OS has provided DMA buffers in response to a bus_dmamap_load call and saves the physical address of those buffers . When the callback is used the OS will return 0 for the mapping function ( bus_dmamap_load ) so we use the value of map_arg - > maxsegs to pass any failures back to the caller . Nothing .
static void
bxe_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
{
    struct bxe_dma *dma = arg;
    if (error) {
        dma->paddr = 0;
        dma->nseg  = 0;
        BLOGE(dma->sc, "Failed DMA alloc '%s' (%d)!\n", dma->msg, error);
    } else {
        dma->paddr = segs->ds_addr;
        dma->nseg  = nseg;
    }
}
static void bxe_dma_map_addr ( void * arg , bus_dma_segment_t * segs , int nseg , int error ) { struct bxe_dma * dma = arg ; if ( error ) { dma -> paddr = 0 ; dma -> nseg = 0 ; BLOGE ( dma -> sc , " \n " , dma -> msg , error ) ; } else { dma -> paddr = segs -> ds_addr ; dma -> nseg = nseg ; } }
Get DMA memory from the OS.
Get DMA memory from the OS .