Lines Matching +full:dma +full:- +full:pool

1 /* SPDX-License-Identifier: GPL-2.0 */
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2022 Linaro Ltd.
12 #include <linux/dma-direction.h>
29 * struct gsi_trans - a GSI transaction
41 * @direction: DMA transfer direction (DMA_NONE for commands)
76 * gsi_trans_pool_init() - Initialize a pool of structures for transactions
77 * @pool: GSI transaction pool pointer
78 * @size: Size of elements in the pool
79 * @count: Minimum number of elements in the pool
80 * @max_alloc: Maximum number of elements allocated at a time from pool
84 int gsi_trans_pool_init(struct gsi_trans_pool *pool, size_t size, u32 count,
88 * gsi_trans_pool_alloc() - Allocate one or more elements from a pool
89 * @pool: Pool pointer
90 * @count: Number of elements to allocate from the pool
92 * Return: Virtual address of element(s) allocated from the pool
94 void *gsi_trans_pool_alloc(struct gsi_trans_pool *pool, u32 count);
97 * gsi_trans_pool_exit() - Inverse of gsi_trans_pool_init()
98 * @pool: Pool pointer
100 void gsi_trans_pool_exit(struct gsi_trans_pool *pool);
103 * gsi_trans_pool_init_dma() - Initialize a pool of DMA-able structures
104 * @dev: Device used for DMA
105 * @pool: Pool pointer
106 * @size: Size of elements in the pool
107 * @count: Minimum number of elements in the pool
108 * @max_alloc: Maximum number of elements allocated at a time from pool
112 * Structures in this pool reside in DMA-coherent memory.
114 int gsi_trans_pool_init_dma(struct device *dev, struct gsi_trans_pool *pool,
118 * gsi_trans_pool_alloc_dma() - Allocate an element from a DMA pool
119 * @pool: DMA pool pointer
120 * @addr: DMA address "handle" associated with the allocation
122 * Return: Virtual address of element allocated from the pool
124 * Only one element at a time may be allocated from a DMA pool.
126 void *gsi_trans_pool_alloc_dma(struct gsi_trans_pool *pool, dma_addr_t *addr);
129 * gsi_trans_pool_exit_dma() - Inverse of gsi_trans_pool_init_dma()
130 * @dev: Device used for DMA
131 * @pool: Pool pointer
133 void gsi_trans_pool_exit_dma(struct device *dev, struct gsi_trans_pool *pool);
136 * gsi_channel_trans_idle() - Return whether no transactions are allocated
146 * gsi_channel_trans_alloc() - Allocate a GSI transaction on a channel
150 * @direction: DMA direction for entire SGL (or DMA_NONE)
160 * gsi_trans_free() - Free a previously-allocated GSI transaction
166 * gsi_trans_cmd_add() - Add an immediate command to a transaction
170 * @addr: DMA address for payload
177 * gsi_trans_page_add() - Add a page transfer to a transaction
187 * gsi_trans_skb_add() - Add a socket transfer to a transaction
191 * Return: 0, or -EMSGSIZE if socket data won't fit in transaction.
196 * gsi_trans_commit() - Commit a GSI transaction
203 * gsi_trans_commit_wait() - Commit a GSI transaction and wait for it
210 * gsi_trans_read_byte() - Issue a single byte read TRE on a channel
213 * @addr: DMA address into which to transfer the one byte
221 * gsi_trans_read_byte_done() - Clean up after a single byte read TRE