diff options
Diffstat (limited to 'sys/compat/linuxkpi/common/include/net/page_pool')
| -rw-r--r-- | sys/compat/linuxkpi/common/include/net/page_pool/helpers.h | 79 | ||||
| -rw-r--r-- | sys/compat/linuxkpi/common/include/net/page_pool/types.h | 36 | 
2 files changed, 115 insertions, 0 deletions
| diff --git a/sys/compat/linuxkpi/common/include/net/page_pool/helpers.h b/sys/compat/linuxkpi/common/include/net/page_pool/helpers.h new file mode 100644 index 000000000000..3469c39c7757 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/net/page_pool/helpers.h @@ -0,0 +1,79 @@ +/*- + * Copyright (c) 2023-2025 Bjoern A. Zeeb + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef	_LINUXKPI_NET_PAGE_POOL_HELPERS_H +#define	_LINUXKPI_NET_PAGE_POOL_HELPERS_H + +#include <linux/kernel.h>	/* pr_debug */ +#include <linux/types.h> +#include <linux/dma-mapping.h> +#include <net/page_pool/types.h> + +static inline struct page_pool * +page_pool_create(const struct page_pool_params *ppparams) +{ + +	pr_debug("%s: TODO\n", __func__); +	return (NULL); +} + +static inline void +page_pool_destroy(struct page_pool *ppool) +{ + +	pr_debug("%s: TODO\n", __func__); +} + +static inline struct page * +page_pool_dev_alloc_frag(struct page_pool *ppool, uint32_t *offset, +    size_t size) +{ + +	pr_debug("%s: TODO\n", __func__); +	return (NULL); +} + +static inline dma_addr_t +page_pool_get_dma_addr(struct page *page) +{ + +	pr_debug("%s: TODO\n", __func__); +	return (0); +} + +static inline enum dma_data_direction +page_pool_get_dma_dir(const struct page_pool *ppool) +{ + +	pr_debug("%s: TODO\n", __func__); +	return (DMA_BIDIRECTIONAL); +} + +static inline void +page_pool_put_full_page(struct page_pool *ppool, struct page *page, +    bool allow_direct) +{ + +	pr_debug("%s: TODO\n", __func__); +} + +static inline int +page_pool_ethtool_stats_get_count(void) +{ + +	pr_debug("%s: TODO\n", __func__); +	return (0); +} + +static inline uint8_t * +page_pool_ethtool_stats_get_strings(uint8_t *x) +{ + +	pr_debug("%s: TODO\n", __func__); +	return (x); +} + +#endif	/* _LINUXKPI_NET_PAGE_POOL_HELPERS_H */ diff --git a/sys/compat/linuxkpi/common/include/net/page_pool/types.h b/sys/compat/linuxkpi/common/include/net/page_pool/types.h new file mode 100644 index 000000000000..6747be50b9b2 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/net/page_pool/types.h @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2023-2025 Bjoern A. Zeeb + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef	_LINUXKPI_NET_PAGE_POOL_TYPES_H +#define	_LINUXKPI_NET_PAGE_POOL_TYPES_H + +#include <linux/types.h> +#include <linux/dma-mapping.h> +#include <net/netmem.h> + +struct device; +struct napi_struct; + +struct page_pool_params { +	struct device			*dev; +	uint32_t			flags; +	uint32_t			order; +	uint32_t			pool_size; +	uint32_t			max_len; +	uint32_t			offset; +	int				nid;		/* NUMA */ +	enum dma_data_direction		dma_dir; +	struct napi_struct		*napi; +}; + +struct page_pool { +}; + +#define	PP_FLAG_DMA_MAP		BIT(0) +#define	PP_FLAG_DMA_SYNC_DEV	BIT(1) +#define	PP_FLAG_PAGE_FRAG	BIT(2) + +#endif	/* _LINUXKPI_NET_PAGE_POOL_TYPES_H */ | 
