linux/drivers/infiniband/hw/mthca/mthca_mr.c

/*
 * Copyright (c) 2004 Topspin Communications.  All rights reserved.
 * Copyright (c) 2005 Mellanox Technologies. 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/slab.h>
#include <linux/errno.h>

#include "mthca_dev.h"
#include "mthca_cmd.h"
#include "mthca_memfree.h"

struct mthca_mtt {};

/*
 * Must be packed because mtt_seg is 64 bits but only aligned to 32 bits.
 */
struct mthca_mpt_entry {} __packed;

#define MTHCA_MPT_FLAG_SW_OWNS
#define MTHCA_MPT_FLAG_MIO
#define MTHCA_MPT_FLAG_BIND_ENABLE
#define MTHCA_MPT_FLAG_PHYSICAL
#define MTHCA_MPT_FLAG_REGION

#define MTHCA_MTT_FLAG_PRESENT

#define MTHCA_MPT_STATUS_SW
#define MTHCA_MPT_STATUS_HW

#define SINAI_FMR_KEY_INC

/*
 * Buddy allocator for MTT segments (currently not very efficient
 * since it doesn't keep a free list and just searches linearly
 * through the bitmaps)
 */

static u32 mthca_buddy_alloc(struct mthca_buddy *buddy, int order)
{}

static void mthca_buddy_free(struct mthca_buddy *buddy, u32 seg, int order)
{}

static int mthca_buddy_init(struct mthca_buddy *buddy, int max_order)
{}

static void mthca_buddy_cleanup(struct mthca_buddy *buddy)
{}

static u32 mthca_alloc_mtt_range(struct mthca_dev *dev, int order,
				 struct mthca_buddy *buddy)
{}

static struct mthca_mtt *__mthca_alloc_mtt(struct mthca_dev *dev, int size,
					   struct mthca_buddy *buddy)
{}

struct mthca_mtt *mthca_alloc_mtt(struct mthca_dev *dev, int size)
{}

void mthca_free_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt)
{}

static int __mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
			     int start_index, u64 *buffer_list, int list_len)
{}

int mthca_write_mtt_size(struct mthca_dev *dev)
{}

static void mthca_tavor_write_mtt_seg(struct mthca_dev *dev,
				      struct mthca_mtt *mtt, int start_index,
				      u64 *buffer_list, int list_len)
{}

static void mthca_arbel_write_mtt_seg(struct mthca_dev *dev,
				      struct mthca_mtt *mtt, int start_index,
				      u64 *buffer_list, int list_len)
{}

int mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
		    int start_index, u64 *buffer_list, int list_len)
{}

static inline u32 tavor_hw_index_to_key(u32 ind)
{}

static inline u32 tavor_key_to_hw_index(u32 key)
{}

static inline u32 arbel_hw_index_to_key(u32 ind)
{}

static inline u32 arbel_key_to_hw_index(u32 key)
{}

static inline u32 hw_index_to_key(struct mthca_dev *dev, u32 ind)
{}

static inline u32 key_to_hw_index(struct mthca_dev *dev, u32 key)
{}

static inline u32 adjust_key(struct mthca_dev *dev, u32 key)
{}

int mthca_mr_alloc(struct mthca_dev *dev, u32 pd, int buffer_size_shift,
		   u64 iova, u64 total_size, u32 access, struct mthca_mr *mr)
{}

int mthca_mr_alloc_notrans(struct mthca_dev *dev, u32 pd,
			   u32 access, struct mthca_mr *mr)
{}

int mthca_mr_alloc_phys(struct mthca_dev *dev, u32 pd,
			u64 *buffer_list, int buffer_size_shift,
			int list_len, u64 iova, u64 total_size,
			u32 access, struct mthca_mr *mr)
{}

/* Free mr */
static void mthca_free_region(struct mthca_dev *dev, u32 lkey)
{}

void mthca_free_mr(struct mthca_dev *dev, struct mthca_mr *mr)
{}

int mthca_init_mr_table(struct mthca_dev *dev)
{}

void mthca_cleanup_mr_table(struct mthca_dev *dev)
{}