Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / net / ethernet / ti / k3-cppi-desc-pool.h
blob851d352b338bdb7380387e5b9c7a71e31dfbcc80
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* TI K3 CPPI5 descriptors pool
4 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
5 */
7 #ifndef K3_CPPI_DESC_POOL_H_
8 #define K3_CPPI_DESC_POOL_H_
10 #include <linux/device.h>
11 #include <linux/types.h>
13 struct k3_cppi_desc_pool;
15 void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool);
16 struct k3_cppi_desc_pool *
17 k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
18 size_t desc_size,
19 const char *name);
20 #define k3_cppi_desc_pool_create(dev, size, desc_size) \
21 k3_cppi_desc_pool_create_name(dev, size, desc_size, NULL)
22 dma_addr_t
23 k3_cppi_desc_pool_virt2dma(struct k3_cppi_desc_pool *pool, void *addr);
24 void *
25 k3_cppi_desc_pool_dma2virt(struct k3_cppi_desc_pool *pool, dma_addr_t dma);
26 void *k3_cppi_desc_pool_alloc(struct k3_cppi_desc_pool *pool);
27 void k3_cppi_desc_pool_free(struct k3_cppi_desc_pool *pool, void *addr);
28 size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool);
29 size_t k3_cppi_desc_pool_desc_size(const struct k3_cppi_desc_pool *pool);
30 void *k3_cppi_desc_pool_cpuaddr(const struct k3_cppi_desc_pool *pool);
31 void k3_cppi_desc_pool_desc_info_set(struct k3_cppi_desc_pool *pool,
32 int desc_idx, void *info);
33 void *k3_cppi_desc_pool_desc_info(const struct k3_cppi_desc_pool *pool,
34 int desc_idx);
36 #endif /* K3_CPPI_DESC_POOL_H_ */