linux/drivers/net/ethernet/mellanox/mlx4/mr.c

/*
 * Copyright (c) 2004 Topspin Communications.  All rights reserved.
 * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. All rights reserved.
 * Copyright (c) 2006, 2007 Cisco Systems, Inc.  All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#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)
{}

/* Must protect against concurrent access */
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();