linux/drivers/infiniband/hw/hfi1/sysfs.c

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * Copyright(c) 2015-2017 Intel Corporation.
 */

#include <linux/ctype.h>
#include <rdma/ib_sysfs.h>

#include "hfi.h"
#include "mad.h"
#include "trace.h"

static struct hfi1_pportdata *hfi1_get_pportdata_kobj(struct kobject *kobj)
{}

/*
 * Start of per-port congestion control structures and support code
 */

/*
 * Congestion control table size followed by table entries
 */
static ssize_t cc_table_bin_read(struct file *filp, struct kobject *kobj,
				 struct bin_attribute *bin_attr, char *buf,
				 loff_t pos, size_t count)
{}
static BIN_ATTR_RO(cc_table_bin, PAGE_SIZE);

/*
 * Congestion settings: port control, control map and an array of 16
 * entries for the congestion entries - increase, timer, event log
 * trigger threshold and the minimum injection rate delay.
 */
static ssize_t cc_setting_bin_read(struct file *filp, struct kobject *kobj,
				   struct bin_attribute *bin_attr,
				   char *buf, loff_t pos, size_t count)
{}
static BIN_ATTR_RO(cc_setting_bin, PAGE_SIZE);

static struct bin_attribute *port_cc_bin_attributes[] =;

static ssize_t cc_prescan_show(struct ib_device *ibdev, u32 port_num,
			       struct ib_port_attribute *attr, char *buf)
{}

static ssize_t cc_prescan_store(struct ib_device *ibdev, u32 port_num,
				struct ib_port_attribute *attr, const char *buf,
				size_t count)
{}
static IB_PORT_ATTR_ADMIN_RW(cc_prescan);

static struct attribute *port_cc_attributes[] =;

static const struct attribute_group port_cc_group =;

/* Start sc2vl */
struct hfi1_sc2vl_attr {};

static ssize_t sc2vl_attr_show(struct ib_device *ibdev, u32 port_num,
			       struct ib_port_attribute *attr, char *buf)
{}

#define HFI1_SC2VL_ATTR(N)

HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();
HFI1_SC2VL_ATTR();

static struct attribute *port_sc2vl_attributes[] =;

static const struct attribute_group port_sc2vl_group =;
/* End sc2vl */

/* Start sl2sc */
struct hfi1_sl2sc_attr {};

static ssize_t sl2sc_attr_show(struct ib_device *ibdev, u32 port_num,
			       struct ib_port_attribute *attr, char *buf)
{}

#define HFI1_SL2SC_ATTR(N)

HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();
HFI1_SL2SC_ATTR();

static struct attribute *port_sl2sc_attributes[] =;

static const struct attribute_group port_sl2sc_group =;

/* End sl2sc */

/* Start vl2mtu */

struct hfi1_vl2mtu_attr {};

static ssize_t vl2mtu_attr_show(struct ib_device *ibdev, u32 port_num,
				struct ib_port_attribute *attr, char *buf)
{}

#define HFI1_VL2MTU_ATTR(N)

HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();
HFI1_VL2MTU_ATTR();

static struct attribute *port_vl2mtu_attributes[] =;

static const struct attribute_group port_vl2mtu_group =;

/* end of per-port file structures and support code */

/*
 * Start of per-unit (or driver, in some cases, but replicated
 * per unit) functions (these get a device *)
 */
static ssize_t hw_rev_show(struct device *device, struct device_attribute *attr,
			   char *buf)
{}
static DEVICE_ATTR_RO(hw_rev);

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

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

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

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

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

static ssize_t chip_reset_store(struct device *device,
				struct device_attribute *attr, const char *buf,
				size_t count)
{}
static DEVICE_ATTR_WO(chip_reset);

/*
 * Convert the reported temperature from an integer (reported in
 * units of 0.25C) to a floating point number.
 */
#define temp_d(t)
#define temp_f(t)

/*
 * Dump tempsense values, in decimal, to ease shell-scripts.
 */
static ssize_t tempsense_show(struct device *device,
			      struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(tempsense);

/*
 * end of per-unit (or driver, in some cases, but replicated
 * per unit) functions
 */

/* start of per-unit file structures and support code */
static struct attribute *hfi1_attributes[] =;

const struct attribute_group ib_hfi1_attr_group =;

const struct attribute_group *hfi1_attr_port_groups[] =;

struct sde_attribute {};

static ssize_t sde_show(struct kobject *kobj, struct attribute *attr, char *buf)
{}

static ssize_t sde_store(struct kobject *kobj, struct attribute *attr,
			 const char *buf, size_t count)
{}

static const struct sysfs_ops sde_sysfs_ops =;

static struct kobj_type sde_ktype =;

#define SDE_ATTR(_name, _mode, _show, _store)

static ssize_t sde_show_cpu_to_sde_map(struct sdma_engine *sde, char *buf)
{}

static ssize_t sde_store_cpu_to_sde_map(struct sdma_engine *sde,
					const char *buf, size_t count)
{}

static ssize_t sde_show_vl(struct sdma_engine *sde, char *buf)
{}

static SDE_ATTR(cpu_list, S_IWUSR | S_IRUGO,
		sde_show_cpu_to_sde_map,
		sde_store_cpu_to_sde_map);
static SDE_ATTR(vl, S_IRUGO, sde_show_vl, NULL);

static struct sde_attribute *sde_attribs[] =;

/*
 * Register and create our files in /sys/class/infiniband.
 */
int hfi1_verbs_register_sysfs(struct hfi1_devdata *dd)
{}

/*
 * Unregister and remove our files in /sys/class/infiniband.
 */
void hfi1_verbs_unregister_sysfs(struct hfi1_devdata *dd)
{}