161ae650dSJack F Vogel /****************************************************************************** 261ae650dSJack F Vogel 361ae650dSJack F Vogel Copyright (c) 2013-2014, Intel Corporation 461ae650dSJack F Vogel All rights reserved. 561ae650dSJack F Vogel 661ae650dSJack F Vogel Redistribution and use in source and binary forms, with or without 761ae650dSJack F Vogel modification, are permitted provided that the following conditions are met: 861ae650dSJack F Vogel 961ae650dSJack F Vogel 1. Redistributions of source code must retain the above copyright notice, 1061ae650dSJack F Vogel this list of conditions and the following disclaimer. 1161ae650dSJack F Vogel 1261ae650dSJack F Vogel 2. Redistributions in binary form must reproduce the above copyright 1361ae650dSJack F Vogel notice, this list of conditions and the following disclaimer in the 1461ae650dSJack F Vogel documentation and/or other materials provided with the distribution. 1561ae650dSJack F Vogel 1661ae650dSJack F Vogel 3. Neither the name of the Intel Corporation nor the names of its 1761ae650dSJack F Vogel contributors may be used to endorse or promote products derived from 1861ae650dSJack F Vogel this software without specific prior written permission. 1961ae650dSJack F Vogel 2061ae650dSJack F Vogel THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2161ae650dSJack F Vogel AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2261ae650dSJack F Vogel IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2361ae650dSJack F Vogel ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2461ae650dSJack F Vogel LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2561ae650dSJack F Vogel CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2661ae650dSJack F Vogel SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2761ae650dSJack F Vogel INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2861ae650dSJack F Vogel CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2961ae650dSJack F Vogel ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3061ae650dSJack F Vogel POSSIBILITY OF SUCH DAMAGE. 3161ae650dSJack F Vogel 3261ae650dSJack F Vogel ******************************************************************************/ 3361ae650dSJack F Vogel /*$FreeBSD$*/ 3461ae650dSJack F Vogel 3561ae650dSJack F Vogel #ifndef _I40E_ALLOC_H_ 3661ae650dSJack F Vogel #define _I40E_ALLOC_H_ 3761ae650dSJack F Vogel 3861ae650dSJack F Vogel struct i40e_hw; 3961ae650dSJack F Vogel 4061ae650dSJack F Vogel /* Memory allocation types */ 4161ae650dSJack F Vogel enum i40e_memory_type { 4261ae650dSJack F Vogel i40e_mem_arq_buf = 0, /* ARQ indirect command buffer */ 4361ae650dSJack F Vogel i40e_mem_asq_buf = 1, 4461ae650dSJack F Vogel i40e_mem_atq_buf = 2, /* ATQ indirect command buffer */ 4561ae650dSJack F Vogel i40e_mem_arq_ring = 3, /* ARQ descriptor ring */ 4661ae650dSJack F Vogel i40e_mem_atq_ring = 4, /* ATQ descriptor ring */ 4761ae650dSJack F Vogel i40e_mem_pd = 5, /* Page Descriptor */ 4861ae650dSJack F Vogel i40e_mem_bp = 6, /* Backing Page - 4KB */ 4961ae650dSJack F Vogel i40e_mem_bp_jumbo = 7, /* Backing Page - > 4KB */ 5061ae650dSJack F Vogel i40e_mem_reserved 5161ae650dSJack F Vogel }; 5261ae650dSJack F Vogel 5361ae650dSJack F Vogel /* prototype for functions used for dynamic memory allocation */ 54*d94ca7cfSBjoern A. Zeeb enum i40e_status_code i40e_allocate_dma_mem(struct i40e_hw *hw, 5561ae650dSJack F Vogel struct i40e_dma_mem *mem, 56*d94ca7cfSBjoern A. Zeeb enum i40e_memory_type type, 57*d94ca7cfSBjoern A. Zeeb u64 size, u32 alignment); 58*d94ca7cfSBjoern A. Zeeb enum i40e_status_code i40e_free_dma_mem(struct i40e_hw *hw, 5961ae650dSJack F Vogel struct i40e_dma_mem *mem); 60*d94ca7cfSBjoern A. Zeeb enum i40e_status_code i40e_allocate_virt_mem(struct i40e_hw *hw, 6161ae650dSJack F Vogel struct i40e_virt_mem *mem, 6261ae650dSJack F Vogel u32 size); 63*d94ca7cfSBjoern A. Zeeb enum i40e_status_code i40e_free_virt_mem(struct i40e_hw *hw, 6461ae650dSJack F Vogel struct i40e_virt_mem *mem); 6561ae650dSJack F Vogel 6661ae650dSJack F Vogel #endif /* _I40E_ALLOC_H_ */ 67