linux/drivers/infiniband/hw/qib/qib_sysfs.c

/*
 * Copyright (c) 2012 Intel Corporation.  All rights reserved.
 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
 * Copyright (c) 2006 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/ctype.h>
#include <rdma/ib_sysfs.h>

#include "qib.h"
#include "qib_mad.h"

static struct qib_pportdata *qib_get_pportdata_kobj(struct kobject *kobj)
{}

/*
 * Get/Set heartbeat enable. OR of 1=enabled, 2=auto
 */
static ssize_t hrtbt_enable_show(struct ib_device *ibdev, u32 port_num,
				 struct ib_port_attribute *attr, char *buf)
{}

static ssize_t hrtbt_enable_store(struct ib_device *ibdev, u32 port_num,
				  struct ib_port_attribute *attr,
				  const char *buf, size_t count)
{}
static IB_PORT_ATTR_RW(hrtbt_enable);

static ssize_t loopback_store(struct ib_device *ibdev, u32 port_num,
			      struct ib_port_attribute *attr, const char *buf,
			      size_t count)
{}
static IB_PORT_ATTR_WO(loopback);

static ssize_t led_override_store(struct ib_device *ibdev, u32 port_num,
				  struct ib_port_attribute *attr,
				  const char *buf, size_t count)
{}
static IB_PORT_ATTR_WO(led_override);

static ssize_t status_show(struct ib_device *ibdev, u32 port_num,
			   struct ib_port_attribute *attr, char *buf)
{}
static IB_PORT_ATTR_RO(status);

/*
 * For userland compatibility, these offsets must remain fixed.
 * They are strings for QIB_STATUS_*
 */
static const char * const qib_status_str[] =;

static ssize_t status_str_show(struct ib_device *ibdev, u32 port_num,
			       struct ib_port_attribute *attr, char *buf)
{}
static IB_PORT_ATTR_RO(status_str);

/* end of per-port functions */

static struct attribute *port_linkcontrol_attributes[] =;

static const struct attribute_group port_linkcontrol_group =;

/*
 * 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_ccmgta_attributes[] =;

static umode_t qib_ccmgta_is_bin_visible(struct kobject *kobj,
				 struct bin_attribute *attr, int n)
{}

static const struct attribute_group port_ccmgta_attribute_group =;

/* Start sl2vl */

struct qib_sl2vl_attr {};

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

#define QIB_SL2VL_ATTR(N)

QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();
QIB_SL2VL_ATTR();

static struct attribute *port_sl2vl_attributes[] =;

static const struct attribute_group port_sl2vl_group =;

/* End sl2vl */

/* Start diag_counters */

struct qib_diagc_attr {};

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

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

#define QIB_DIAGC_ATTR(N)

QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();
QIB_DIAGC_ATTR();

static u64 get_all_cpu_total(u64 __percpu *cntr)
{}

static ssize_t qib_store_per_cpu(struct qib_devdata *dd, const char *buf,
				 size_t count, u64 *zero, u64 cur)
{}

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

static ssize_t rc_acks_store(struct ib_device *ibdev, u32 port_num,
			     struct ib_port_attribute *attr, const char *buf,
			     size_t count)
{}
static IB_PORT_ATTR_RW(rc_acks);

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

static ssize_t rc_qacks_store(struct ib_device *ibdev, u32 port_num,
			      struct ib_port_attribute *attr, const char *buf,
			      size_t count)
{}
static IB_PORT_ATTR_RW(rc_qacks);

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

static ssize_t rc_delayed_comp_store(struct ib_device *ibdev, u32 port_num,
				     struct ib_port_attribute *attr,
				     const char *buf, size_t count)
{}
static IB_PORT_ATTR_RW(rc_delayed_comp);

static struct attribute *port_diagc_attributes[] =;

static const struct attribute_group port_diagc_group =;

/* End diag_counters */

const struct attribute_group *qib_attr_port_groups[] =;

/* 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 hca_type_show(struct device *device,
			     struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(hca_type);
static DEVICE_ATTR(board_id, 0444, hca_type_show, NULL);

static DEVICE_STRING_ATTR_RO(version, 0444, QIB_DRIVER_VERSION);

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

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

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);

/*
 * Dump tempsense regs. 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 *qib_attributes[] =;

const struct attribute_group qib_attr_group =;