#include <linux/errno.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/vmalloc.h>
#include <linux/mlx4/cmd.h>
#include "mlx4.h"
#include "icm.h"
static u32 mlx4_buddy_alloc(struct mlx4_buddy *buddy, int order)
{ … }
static void mlx4_buddy_free(struct mlx4_buddy *buddy, u32 seg, int order)
{ … }
static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order)
{ … }
static void mlx4_buddy_cleanup(struct mlx4_buddy *buddy)
{ … }
u32 __mlx4_alloc_mtt_range(struct mlx4_dev *dev, int order)
{ … }
static u32 mlx4_alloc_mtt_range(struct mlx4_dev *dev, int order)
{ … }
int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift,
struct mlx4_mtt *mtt)
{ … }
EXPORT_SYMBOL_GPL(…);
void __mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
{ … }
static void mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
{ … }
void mlx4_mtt_cleanup(struct mlx4_dev *dev, struct mlx4_mtt *mtt)
{ … }
EXPORT_SYMBOL_GPL(…);
u64 mlx4_mtt_addr(struct mlx4_dev *dev, struct mlx4_mtt *mtt)
{ … }
EXPORT_SYMBOL_GPL(…);
static u32 hw_index_to_key(u32 ind)
{ … }
static u32 key_to_hw_index(u32 key)
{ … }
static int mlx4_SW2HW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox,
int mpt_index)
{ … }
static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox,
int mpt_index)
{ … }
int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
struct mlx4_mpt_entry ***mpt_entry)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mr_hw_write_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
struct mlx4_mpt_entry **mpt_entry)
{ … }
EXPORT_SYMBOL_GPL(…);
void mlx4_mr_hw_put_mpt(struct mlx4_dev *dev,
struct mlx4_mpt_entry **mpt_entry)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry,
u32 pdn)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mr_hw_change_access(struct mlx4_dev *dev,
struct mlx4_mpt_entry *mpt_entry,
u32 access)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd,
u64 iova, u64 size, u32 access, int npages,
int page_shift, struct mlx4_mr *mr)
{ … }
static int mlx4_WRITE_MTT(struct mlx4_dev *dev,
struct mlx4_cmd_mailbox *mailbox,
int num_entries)
{ … }
int __mlx4_mpt_reserve(struct mlx4_dev *dev)
{ … }
static int mlx4_mpt_reserve(struct mlx4_dev *dev)
{ … }
void __mlx4_mpt_release(struct mlx4_dev *dev, u32 index)
{ … }
static void mlx4_mpt_release(struct mlx4_dev *dev, u32 index)
{ … }
int __mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index)
{ … }
static int mlx4_mpt_alloc_icm(struct mlx4_dev *dev, u32 index)
{ … }
void __mlx4_mpt_free_icm(struct mlx4_dev *dev, u32 index)
{ … }
static void mlx4_mpt_free_icm(struct mlx4_dev *dev, u32 index)
{ … }
int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access,
int npages, int page_shift, struct mlx4_mr *mr)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr)
{ … }
int mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr)
{ … }
EXPORT_SYMBOL_GPL(…);
void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
u64 iova, u64 size, int npages,
int page_shift, struct mlx4_mpt_entry *mpt_entry)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mlx4_write_mtt_chunk(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
int start_index, int npages, u64 *page_list)
{ … }
int __mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
int start_index, int npages, u64 *page_list)
{ … }
int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
int start_index, int npages, u64 *page_list)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
struct mlx4_buf *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mw_alloc(struct mlx4_dev *dev, u32 pd, enum mlx4_mw_type type,
struct mlx4_mw *mw)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw)
{ … }
EXPORT_SYMBOL_GPL(…);
void mlx4_mw_free(struct mlx4_dev *dev, struct mlx4_mw *mw)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_init_mr_table(struct mlx4_dev *dev)
{ … }
void mlx4_cleanup_mr_table(struct mlx4_dev *dev)
{ … }
int mlx4_SYNC_TPT(struct mlx4_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);