Lines Matching +full:sleep +full:- +full:map
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
279 * @sleep: if true, sleep where possible
281 * If sleep is true, and if the current thread is allowed to sleep, pause so
286 ice_usec_delay(uint32_t time, bool sleep) in ice_usec_delay() argument
288 if (sleep && THREAD_CAN_SLEEP()) in ice_usec_delay()
295 * ice_msec_delay - Delay for the specified number of milliseconds
297 * @sleep: if true, sleep where possible
299 * If sleep is true, and if the current thread is allowed to sleep, pause so
304 ice_msec_delay(uint32_t time, bool sleep) in ice_msec_delay() argument
306 if (sleep && THREAD_CAN_SLEEP()) in ice_msec_delay()
313 * ice_msec_pause - pause (sleep) the thread for a time in milliseconds
314 * @time: milliseconds to sleep
316 * Wrapper for ice_msec_delay with sleep set to true.
325 * ice_msec_spin - Spin the thread for a time in milliseconds
328 * Wrapper for ice_msec_delay with sleep sent to false.
341 * ice_dmamap_cb - Callback function DMA maps
354 *(bus_addr_t *) arg = segs->ds_addr; in ice_dmamap_cb()
359 * ice_alloc_dma_mem - Request OS to allocate DMA memory
365 * track this memory using a bus DMA tag and map.
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
431 * Release the bus DMA tag and map, and free the DMA memory associated with
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()