linux/drivers/infiniband/core/uverbs_main.c

/*
 * Copyright (c) 2005 Topspin Communications.  All rights reserved.
 * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
 * Copyright (c) 2005 Mellanox Technologies. All rights reserved.
 * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
 * Copyright (c) 2005 PathScale, 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/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/file.h>
#include <linux/cdev.h>
#include <linux/anon_inodes.h>
#include <linux/slab.h>
#include <linux/sched/mm.h>

#include <linux/uaccess.h>

#include <rdma/ib.h>
#include <rdma/uverbs_std_types.h>
#include <rdma/rdma_netlink.h>

#include "uverbs.h"
#include "core_priv.h"
#include "rdma_core.h"

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

enum {};

#define IB_UVERBS_BASE_DEV

static dev_t dynamic_uverbs_dev;

static DEFINE_IDA(uverbs_ida);
static int ib_uverbs_add_one(struct ib_device *device);
static void ib_uverbs_remove_one(struct ib_device *device, void *client_data);

static char *uverbs_devnode(const struct device *dev, umode_t *mode)
{}

static const struct class uverbs_class =;

/*
 * Must be called with the ufile->device->disassociate_srcu held, and the lock
 * must be held until use of the ucontext is finished.
 */
struct ib_ucontext *ib_uverbs_get_ucontext_file(struct ib_uverbs_file *ufile)
{}
EXPORT_SYMBOL();

int uverbs_dealloc_mw(struct ib_mw *mw)
{}

static void ib_uverbs_release_dev(struct device *device)
{}

void ib_uverbs_release_ucq(struct ib_uverbs_completion_event_file *ev_file,
			   struct ib_ucq_object *uobj)
{}

void ib_uverbs_release_uevent(struct ib_uevent_object *uobj)
{}

void ib_uverbs_detach_umcast(struct ib_qp *qp,
			     struct ib_uqp_object *uobj)
{}

static void ib_uverbs_comp_dev(struct ib_uverbs_device *dev)
{}

void ib_uverbs_release_file(struct kref *ref)
{}

static ssize_t ib_uverbs_event_read(struct ib_uverbs_event_queue *ev_queue,
				    struct file *filp, char __user *buf,
				    size_t count, loff_t *pos,
				    size_t eventsz)
{}

static ssize_t ib_uverbs_async_event_read(struct file *filp, char __user *buf,
					  size_t count, loff_t *pos)
{}

static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf,
					 size_t count, loff_t *pos)
{}

static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
					 struct file *filp,
					 struct poll_table_struct *wait)
{}

static __poll_t ib_uverbs_async_event_poll(struct file *filp,
					       struct poll_table_struct *wait)
{}

static __poll_t ib_uverbs_comp_event_poll(struct file *filp,
					      struct poll_table_struct *wait)
{}

static int ib_uverbs_async_event_fasync(int fd, struct file *filp, int on)
{}

static int ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on)
{}

const struct file_operations uverbs_event_fops =;

const struct file_operations uverbs_async_event_fops =;

void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
{}

void ib_uverbs_async_handler(struct ib_uverbs_async_event_file *async_file,
			     __u64 element, __u64 event,
			     struct list_head *obj_list, u32 *counter)
{}

static void uverbs_uobj_event(struct ib_uevent_object *eobj,
			      struct ib_event *event)
{}

void ib_uverbs_cq_event_handler(struct ib_event *event, void *context_ptr)
{}

void ib_uverbs_qp_event_handler(struct ib_event *event, void *context_ptr)
{}

void ib_uverbs_wq_event_handler(struct ib_event *event, void *context_ptr)
{}

void ib_uverbs_srq_event_handler(struct ib_event *event, void *context_ptr)
{}

static void ib_uverbs_event_handler(struct ib_event_handler *handler,
				    struct ib_event *event)
{}

void ib_uverbs_init_event_queue(struct ib_uverbs_event_queue *ev_queue)
{}

void ib_uverbs_init_async_event_file(
	struct ib_uverbs_async_event_file *async_file)
{}

static ssize_t verify_hdr(struct ib_uverbs_cmd_hdr *hdr,
			  struct ib_uverbs_ex_cmd_hdr *ex_hdr, size_t count,
			  const struct uverbs_api_write_method *method_elm)
{}

static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
			     size_t count, loff_t *pos)
{}

static const struct vm_operations_struct rdma_umap_ops;

static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma)
{}

/*
 * The VMA has been dup'd, initialize the vm_private_data with a new tracking
 * struct
 */
static void rdma_umap_open(struct vm_area_struct *vma)
{}

static void rdma_umap_close(struct vm_area_struct *vma)
{}

/*
 * Once the zap_vma_ptes has been called touches to the VMA will come here and
 * we return a dummy writable zero page for all the pfns.
 */
static vm_fault_t rdma_umap_fault(struct vm_fault *vmf)
{}

static const struct vm_operations_struct rdma_umap_ops =;

void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
{}

/*
 * ib_uverbs_open() does not need the BKL:
 *
 *  - the ib_uverbs_device structures are properly reference counted and
 *    everything else is purely local to the file being created, so
 *    races against other open calls are not a problem;
 *  - there is no ioctl method to race against;
 *  - the open method will either immediately run -ENXIO, or all
 *    required initialization will be done.
 */
static int ib_uverbs_open(struct inode *inode, struct file *filp)
{}

static int ib_uverbs_close(struct inode *inode, struct file *filp)
{}

static const struct file_operations uverbs_fops =;

static const struct file_operations uverbs_mmap_fops =;

static int ib_uverbs_get_nl_info(struct ib_device *ibdev, void *client_data,
				 struct ib_client_nl_info *res)
{}

static struct ib_client uverbs_client =;
MODULE_ALIAS_RDMA_CLIENT();

static ssize_t ibdev_show(struct device *device, struct device_attribute *attr,
			  char *buf)
{}
static DEVICE_ATTR_RO(ibdev);

static ssize_t abi_version_show(struct device *device,
				struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(abi_version);

static struct attribute *ib_dev_attrs[] =;

static const struct attribute_group dev_attr_group =;

static CLASS_ATTR_STRING(abi_version, S_IRUGO,
			 __stringify(IB_USER_VERBS_ABI_VERSION));

static int ib_uverbs_create_uapi(struct ib_device *device,
				 struct ib_uverbs_device *uverbs_dev)
{}

static int ib_uverbs_add_one(struct ib_device *device)
{}

static void ib_uverbs_free_hw_resources(struct ib_uverbs_device *uverbs_dev,
					struct ib_device *ib_dev)
{}

static void ib_uverbs_remove_one(struct ib_device *device, void *client_data)
{}

static int __init ib_uverbs_init(void)
{}

static void __exit ib_uverbs_cleanup(void)
{}

module_init();
module_exit(ib_uverbs_cleanup);