linux/drivers/infiniband/hw/usnic/usnic_vnic.h

/*
 * Copyright (c) 2013, 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
 * 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.
 *
 */

#ifndef USNIC_VNIC_H_
#define USNIC_VNIC_H_

#include <linux/pci.h>

#include "vnic_dev.h"

/*                      =USNIC_VNIC_RES_TYPE= =VNIC_RES=   =DESC= */
#define USNIC_VNIC_RES_TYPES\

#define DEFINE_USNIC_VNIC_RES_AT
#define DEFINE_USNIC_VNIC_RES
enum usnic_vnic_res_type {};
#undef DEFINE_USNIC_VNIC_RES
#undef DEFINE_USNIC_VNIC_RES_AT

struct usnic_vnic_res {};

struct usnic_vnic_res_chunk {};

struct usnic_vnic_res_desc {};

struct usnic_vnic_res_spec {};

const char *usnic_vnic_res_type_to_str(enum usnic_vnic_res_type res_type);
const char *usnic_vnic_pci_name(struct usnic_vnic *vnic);
int usnic_vnic_dump(struct usnic_vnic *vnic, char *buf, int buf_sz,
			void *hdr_obj,
			int (*printtitle)(void *, char*, int),
			int (*printcols)(char *, int),
			int (*printrow)(void *, char *, int));
void usnic_vnic_res_spec_update(struct usnic_vnic_res_spec *spec,
				enum usnic_vnic_res_type trgt_type,
				u16 cnt);
int usnic_vnic_res_spec_satisfied(const struct usnic_vnic_res_spec *min_spec,
					struct usnic_vnic_res_spec *res_spec);
int usnic_vnic_spec_dump(char *buf, int buf_sz,
				struct usnic_vnic_res_spec *res_spec);
int usnic_vnic_check_room(struct usnic_vnic *vnic,
				struct usnic_vnic_res_spec *res_spec);
int usnic_vnic_res_cnt(struct usnic_vnic *vnic,
				enum usnic_vnic_res_type type);
int usnic_vnic_res_free_cnt(struct usnic_vnic *vnic,
				enum usnic_vnic_res_type type);
struct usnic_vnic_res_chunk *
usnic_vnic_get_resources(struct usnic_vnic *vnic,
				enum usnic_vnic_res_type type,
				int cnt,
				void *owner);
void usnic_vnic_put_resources(struct usnic_vnic_res_chunk *chunk);
struct pci_dev *usnic_vnic_get_pdev(struct usnic_vnic *vnic);
struct vnic_dev_bar *usnic_vnic_get_bar(struct usnic_vnic *vnic,
				int bar_num);
struct usnic_vnic *usnic_vnic_alloc(struct pci_dev *pdev);
void usnic_vnic_free(struct usnic_vnic *vnic);
u16 usnic_vnic_get_index(struct usnic_vnic *vnic);

#endif /*!USNIC_VNIC_H_*/