#include <linux/kernel.h>
#include <linux/rio.h>
#include <linux/rio_drv.h>
#include <linux/stat.h>
#include <linux/capability.h>
#include "rio.h"
#define rio_config_attr(field, format_string) …
rio_config_attr(did, "0x%04x\n");
rio_config_attr(vid, "0x%04x\n");
rio_config_attr(device_rev, "0x%08x\n");
rio_config_attr(asm_did, "0x%04x\n");
rio_config_attr(asm_vid, "0x%04x\n");
rio_config_attr(asm_rev, "0x%04x\n");
rio_config_attr(destid, "0x%04x\n");
rio_config_attr(hopcount, "0x%02x\n");
static ssize_t routes_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(routes);
static ssize_t lprev_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(lprev);
static ssize_t lnext_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(lnext);
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(modalias);
static struct attribute *rio_dev_attrs[] = …;
static ssize_t
rio_read_config(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{ … }
static ssize_t
rio_write_config(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{ … }
static struct bin_attribute rio_config_attr = …;
static struct bin_attribute *rio_dev_bin_attrs[] = …;
static umode_t rio_dev_is_attr_visible(struct kobject *kobj,
struct attribute *attr, int n)
{ … }
static const struct attribute_group rio_dev_group = …;
const struct attribute_group *rio_dev_groups[] = …;
static ssize_t scan_store(const struct bus_type *bus, const char *buf, size_t count)
{ … }
static BUS_ATTR_WO(scan);
static struct attribute *rio_bus_attrs[] = …;
static const struct attribute_group rio_bus_group = …;
const struct attribute_group *rio_bus_groups[] = …;
static ssize_t
port_destid_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(port_destid);
static ssize_t sys_size_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(sys_size);
static struct attribute *rio_mport_attrs[] = …;
static const struct attribute_group rio_mport_group = …;
const struct attribute_group *rio_mport_groups[] = …;