1 /* SPDX-License-Identifier: GPL-2.0 */ 2 3 #ifndef __NETMEM_PRIV_H 4 #define __NETMEM_PRIV_H 5 netmem_get_pp_magic(netmem_ref netmem)6static inline unsigned long netmem_get_pp_magic(netmem_ref netmem) 7 { 8 return __netmem_clear_lsb(netmem)->pp_magic; 9 } 10 netmem_or_pp_magic(netmem_ref netmem,unsigned long pp_magic)11static inline void netmem_or_pp_magic(netmem_ref netmem, unsigned long pp_magic) 12 { 13 __netmem_clear_lsb(netmem)->pp_magic |= pp_magic; 14 } 15 netmem_clear_pp_magic(netmem_ref netmem)16static inline void netmem_clear_pp_magic(netmem_ref netmem) 17 { 18 __netmem_clear_lsb(netmem)->pp_magic = 0; 19 } 20 netmem_is_pp(netmem_ref netmem)21static inline bool netmem_is_pp(netmem_ref netmem) 22 { 23 return (netmem_get_pp_magic(netmem) & PP_MAGIC_MASK) == PP_SIGNATURE; 24 } 25 netmem_set_pp(netmem_ref netmem,struct page_pool * pool)26static inline void netmem_set_pp(netmem_ref netmem, struct page_pool *pool) 27 { 28 __netmem_clear_lsb(netmem)->pp = pool; 29 } 30 netmem_set_dma_addr(netmem_ref netmem,unsigned long dma_addr)31static inline void netmem_set_dma_addr(netmem_ref netmem, 32 unsigned long dma_addr) 33 { 34 __netmem_clear_lsb(netmem)->dma_addr = dma_addr; 35 } 36 #endif 37