Lines Matching +full:dma +full:- +full:mem

1 /* SPDX-License-Identifier: BSD-3-Clause */
54 MALLOC_DEFINE(M_ICE_OSDEP, "ice-osdep", "Intel(R) 100Gb Network Driver osdep allocations");
69 * ice_hw_to_dev - Given a hw private struct, find the associated device_t
84 return sc->dev; in ice_hw_to_dev()
88 * ice_debug - Log a debug message if the type is enabled
93 * Check if hw->debug_mask has enabled the given message type. If so, log the
103 if (!(mask & hw->debug_mask)) in ice_debug()
113 * ice_debug_array - Format and print an array of values to the console
134 if (!(mask & hw->debug_mask)) in ice_debug_array()
140 /* Make sure the row-size isn't too large */ in ice_debug_array()
148 * ice_info_fwlog - Format and print an array of values to the console
176 /* Make sure the row-size isn't too large */ in ice_info_fwlog()
184 * rd32 - Read a 32bit hardware register value
195 return bus_space_read_4(sc->bar0.tag, sc->bar0.handle, reg); in rd32()
199 * rd64 - Read a 64bit hardware register value
205 * @pre For 32-bit builds, assumes that the 64bit register read can be
206 * safely broken up into two 32-bit register reads.
215 data = bus_space_read_8(sc->bar0.tag, sc->bar0.handle, reg); in rd64()
221 data = bus_space_read_4(sc->bar0.tag, sc->bar0.handle, reg); in rd64()
222 data |= ((uint64_t)bus_space_read_4(sc->bar0.tag, sc->bar0.handle, reg + 4)) << 32; in rd64()
229 * wr32 - Write a 32bit hardware register
241 bus_space_write_4(sc->bar0.tag, sc->bar0.handle, reg, val); in wr32()
245 * wr64 - Write a 64bit hardware register
252 * @pre For 32-bit builds, assumes that the 64bit register write can be safely
253 * broken up into two 32-bit register writes.
261 bus_space_write_8(sc->bar0.tag, sc->bar0.handle, reg, val); in wr64()
271 bus_space_write_4(sc->bar0.tag, sc->bar0.handle, reg, lo_val); in wr64()
272 bus_space_write_4(sc->bar0.tag, sc->bar0.handle, reg + 4, hi_val); in wr64()
277 * ice_usec_delay - Delay for the specified number of microseconds
295 * ice_msec_delay - Delay for the specified number of milliseconds
313 * ice_msec_pause - pause (sleep) the thread for a time in milliseconds
325 * ice_msec_spin - Spin the thread for a time in milliseconds
337 * Manage DMA'able memory.
341 * ice_dmamap_cb - Callback function DMA maps
347 * Callback used by the bus DMA code to obtain the segment address.
354 *(bus_addr_t *) arg = segs->ds_addr; in ice_dmamap_cb()
359 * ice_alloc_dma_mem - Request OS to allocate DMA memory
361 * @mem: structure defining the DMA memory request
364 * Allocates some memory for DMA use. Use the FreeBSD bus DMA interface to
365 * track this memory using a bus DMA tag and map.
367 * Returns a pointer to the DMA memory address.
370 ice_alloc_dma_mem(struct ice_hw *hw, struct ice_dma_mem *mem, u64 size) in ice_alloc_dma_mem() argument
386 &mem->tag); in ice_alloc_dma_mem()
393 err = bus_dmamem_alloc(mem->tag, (void **)&mem->va, in ice_alloc_dma_mem()
394 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &mem->map); in ice_alloc_dma_mem()
401 err = bus_dmamap_load(mem->tag, mem->map, mem->va, in ice_alloc_dma_mem()
404 &mem->pa, in ice_alloc_dma_mem()
412 mem->size = size; in ice_alloc_dma_mem()
413 bus_dmamap_sync(mem->tag, mem->map, in ice_alloc_dma_mem()
415 return (mem->va); in ice_alloc_dma_mem()
417 bus_dmamem_free(mem->tag, mem->va, mem->map); in ice_alloc_dma_mem()
419 bus_dma_tag_destroy(mem->tag); in ice_alloc_dma_mem()
421 mem->map = NULL; in ice_alloc_dma_mem()
422 mem->tag = NULL; in ice_alloc_dma_mem()
427 * ice_free_dma_mem - Free DMA memory allocated by ice_alloc_dma_mem
429 * @mem: DMA memory to free
431 * Release the bus DMA tag and map, and free the DMA memory associated with
435 ice_free_dma_mem(struct ice_hw __unused *hw, struct ice_dma_mem *mem) in ice_free_dma_mem() argument
437 bus_dmamap_sync(mem->tag, mem->map, in ice_free_dma_mem()
439 bus_dmamap_unload(mem->tag, mem->map); in ice_free_dma_mem()
440 bus_dmamem_free(mem->tag, mem->va, mem->map); in ice_free_dma_mem()
441 bus_dma_tag_destroy(mem->tag); in ice_free_dma_mem()
442 mem->map = NULL; in ice_free_dma_mem()
443 mem->tag = NULL; in ice_free_dma_mem()