#include <linux/configfs.h>
#include <rdma/ib_verbs.h>
#include <rdma/rdma_cm.h>
#include "core_priv.h"
#include "cma_priv.h"
struct cma_device;
struct cma_dev_group;
struct cma_dev_port_group { … };
struct cma_dev_group { … };
static struct cma_dev_port_group *to_dev_port_group(struct config_item *item)
{ … }
static bool filter_by_name(struct ib_device *ib_dev, void *cookie)
{ … }
static int cma_configfs_params_get(struct config_item *item,
struct cma_device **pcma_dev,
struct cma_dev_port_group **pgroup)
{ … }
static void cma_configfs_params_put(struct cma_device *cma_dev)
{ … }
static ssize_t default_roce_mode_show(struct config_item *item,
char *buf)
{ … }
static ssize_t default_roce_mode_store(struct config_item *item,
const char *buf, size_t count)
{ … }
CONFIGFS_ATTR(…);
static ssize_t default_roce_tos_show(struct config_item *item, char *buf)
{ … }
static ssize_t default_roce_tos_store(struct config_item *item,
const char *buf, size_t count)
{ … }
CONFIGFS_ATTR(…);
static struct configfs_attribute *cma_configfs_attributes[] = …;
static const struct config_item_type cma_port_group_type = …;
static int make_cma_ports(struct cma_dev_group *cma_dev_group,
struct cma_device *cma_dev)
{ … }
static void release_cma_dev(struct config_item *item)
{
struct config_group *group = container_of(item, struct config_group,
cg_item);
struct cma_dev_group *cma_dev_group = container_of(group,
struct cma_dev_group,
device_group);
kfree(cma_dev_group);
};
static void release_cma_ports_group(struct config_item *item)
{
struct config_group *group = container_of(item, struct config_group,
cg_item);
struct cma_dev_group *cma_dev_group = container_of(group,
struct cma_dev_group,
ports_group);
kfree(cma_dev_group->ports);
cma_dev_group->ports = NULL;
};
static struct configfs_item_operations cma_ports_item_ops = …;
static const struct config_item_type cma_ports_group_type = …;
static struct configfs_item_operations cma_device_item_ops = …;
static const struct config_item_type cma_device_group_type = …;
static struct config_group *make_cma_dev(struct config_group *group,
const char *name)
{ … }
static void drop_cma_dev(struct config_group *cgroup, struct config_item *item)
{ … }
static struct configfs_group_operations cma_subsys_group_ops = …;
static const struct config_item_type cma_subsys_type = …;
static struct configfs_subsystem cma_subsys = …;
int __init cma_configfs_init(void)
{ … }
void __exit cma_configfs_exit(void)
{ … }