linux/drivers/infiniband/hw/cxgb4/resource.c

/*
 * Copyright (c) 2009-2010 Chelsio, 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.
 */
/* Crude resource management */
#include <linux/spinlock.h>
#include <linux/genalloc.h>
#include <linux/ratelimit.h>
#include "iw_cxgb4.h"

static int c4iw_init_qid_table(struct c4iw_rdev *rdev)
{}

/* nr_* must be power of 2 */
int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_tpt,
		       u32 nr_pdid, u32 nr_srqt)
{}

/*
 * returns 0 if no resource available
 */
u32 c4iw_get_resource(struct c4iw_id_table *id_table)
{}

void c4iw_put_resource(struct c4iw_id_table *id_table, u32 entry)
{}

u32 c4iw_get_cqid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx)
{}

void c4iw_put_cqid(struct c4iw_rdev *rdev, u32 qid,
		   struct c4iw_dev_ucontext *uctx)
{}

u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_dev_ucontext *uctx)
{}

void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qid,
		   struct c4iw_dev_ucontext *uctx)
{}

void c4iw_destroy_resource(struct c4iw_resource *rscp)
{}

/*
 * PBL Memory Manager.  Uses Linux generic allocator.
 */

#define MIN_PBL_SHIFT

u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size)
{}

static void destroy_pblpool(struct kref *kref)
{}

void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size)
{}

int c4iw_pblpool_create(struct c4iw_rdev *rdev)
{}

void c4iw_pblpool_destroy(struct c4iw_rdev *rdev)
{}

/*
 * RQT Memory Manager.  Uses Linux generic allocator.
 */

#define MIN_RQT_SHIFT

u32 c4iw_rqtpool_alloc(struct c4iw_rdev *rdev, int size)
{}

static void destroy_rqtpool(struct kref *kref)
{}

void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size)
{}

int c4iw_rqtpool_create(struct c4iw_rdev *rdev)
{}

void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev)
{}

int c4iw_alloc_srq_idx(struct c4iw_rdev *rdev)
{}

void c4iw_free_srq_idx(struct c4iw_rdev *rdev, int idx)
{}

/*
 * On-Chip QP Memory.
 */
#define MIN_OCQP_SHIFT

u32 c4iw_ocqp_pool_alloc(struct c4iw_rdev *rdev, int size)
{}

void c4iw_ocqp_pool_free(struct c4iw_rdev *rdev, u32 addr, int size)
{}

int c4iw_ocqp_pool_create(struct c4iw_rdev *rdev)
{}

void c4iw_ocqp_pool_destroy(struct c4iw_rdev *rdev)
{}