linux/drivers/scsi/iscsi_boot_sysfs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Export the iSCSI boot info to userland via sysfs.
 *
 * Copyright (C) 2010 Red Hat, Inc.  All rights reserved.
 * Copyright (C) 2010 Mike Christie
 */

#include <linux/module.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/capability.h>
#include <linux/iscsi_boot_sysfs.h>


MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
/*
 * The kobject and attribute structures.
 */
struct iscsi_boot_attr {};

/*
 * The routine called for all sysfs attributes.
 */
static ssize_t iscsi_boot_show_attribute(struct kobject *kobj,
					 struct attribute *attr, char *buf)
{}

static const struct sysfs_ops iscsi_boot_attr_ops =;

static void iscsi_boot_kobj_release(struct kobject *kobj)
{}

static struct kobj_type iscsi_boot_ktype =;

#define iscsi_boot_rd_attr(fnname, sysfs_name, attr_type)

/* Target attrs */
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();

static struct attribute *target_attrs[] =;

static umode_t iscsi_boot_tgt_attr_is_visible(struct kobject *kobj,
					     struct attribute *attr, int i)
{}

static struct attribute_group iscsi_boot_target_attr_group =;

/* Ethernet attrs */
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();

static struct attribute *ethernet_attrs[] =;

static umode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj,
					     struct attribute *attr, int i)
{}

static struct attribute_group iscsi_boot_ethernet_attr_group =;

/* Initiator attrs */
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();

static struct attribute *initiator_attrs[] =;

static umode_t iscsi_boot_ini_attr_is_visible(struct kobject *kobj,
					     struct attribute *attr, int i)
{}

static struct attribute_group iscsi_boot_initiator_attr_group =;

/* iBFT ACPI Table attributes */
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();
iscsi_boot_rd_attr();

static struct attribute *acpitbl_attrs[] =;

static umode_t iscsi_boot_acpitbl_attr_is_visible(struct kobject *kobj,
					     struct attribute *attr, int i)
{}

static struct attribute_group iscsi_boot_acpitbl_attr_group =;

static struct iscsi_boot_kobj *
iscsi_boot_create_kobj(struct iscsi_boot_kset *boot_kset,
		       struct attribute_group *attr_group,
		       const char *name, int index, void *data,
		       ssize_t (*show) (void *data, int type, char *buf),
		       umode_t (*is_visible) (void *data, int type),
		       void (*release) (void *data))
{}

static void iscsi_boot_remove_kobj(struct iscsi_boot_kobj *boot_kobj)
{}

/**
 * iscsi_boot_create_target() - create boot target sysfs dir
 * @boot_kset: boot kset
 * @index: the target id
 * @data: driver specific data for target
 * @show: attr show function
 * @is_visible: attr visibility function
 * @release: release function
 *
 * Note: The boot sysfs lib will free the data passed in for the caller
 * when all refs to the target kobject have been released.
 */
struct iscsi_boot_kobj *
iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
			 void *data,
			 ssize_t (*show) (void *data, int type, char *buf),
			 umode_t (*is_visible) (void *data, int type),
			 void (*release) (void *data))
{}
EXPORT_SYMBOL_GPL();

/**
 * iscsi_boot_create_initiator() - create boot initiator sysfs dir
 * @boot_kset: boot kset
 * @index: the initiator id
 * @data: driver specific data
 * @show: attr show function
 * @is_visible: attr visibility function
 * @release: release function
 *
 * Note: The boot sysfs lib will free the data passed in for the caller
 * when all refs to the initiator kobject have been released.
 */
struct iscsi_boot_kobj *
iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
			    void *data,
			    ssize_t (*show) (void *data, int type, char *buf),
			    umode_t (*is_visible) (void *data, int type),
			    void (*release) (void *data))
{}
EXPORT_SYMBOL_GPL();

/**
 * iscsi_boot_create_ethernet() - create boot ethernet sysfs dir
 * @boot_kset: boot kset
 * @index: the ethernet device id
 * @data: driver specific data
 * @show: attr show function
 * @is_visible: attr visibility function
 * @release: release function
 *
 * Note: The boot sysfs lib will free the data passed in for the caller
 * when all refs to the ethernet kobject have been released.
 */
struct iscsi_boot_kobj *
iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
			   void *data,
			   ssize_t (*show) (void *data, int type, char *buf),
			   umode_t (*is_visible) (void *data, int type),
			   void (*release) (void *data))
{}
EXPORT_SYMBOL_GPL();

/**
 * iscsi_boot_create_acpitbl() - create boot acpi table sysfs dir
 * @boot_kset: boot kset
 * @index: not used
 * @data: driver specific data
 * @show: attr show function
 * @is_visible: attr visibility function
 * @release: release function
 *
 * Note: The boot sysfs lib will free the data passed in for the caller
 * when all refs to the acpitbl kobject have been released.
 */
struct iscsi_boot_kobj *
iscsi_boot_create_acpitbl(struct iscsi_boot_kset *boot_kset, int index,
			   void *data,
			   ssize_t (*show)(void *data, int type, char *buf),
			   umode_t (*is_visible)(void *data, int type),
			   void (*release)(void *data))
{}
EXPORT_SYMBOL_GPL();

/**
 * iscsi_boot_create_kset() - creates root sysfs tree
 * @set_name: name of root dir
 */
struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name)
{}
EXPORT_SYMBOL_GPL();

/**
 * iscsi_boot_create_host_kset() - creates root sysfs tree for a scsi host
 * @hostno: host number of scsi host
 */
struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno)
{}
EXPORT_SYMBOL_GPL();

/**
 * iscsi_boot_destroy_kset() - destroy kset and kobjects under it
 * @boot_kset: boot kset
 *
 * This will remove the kset and kobjects and attrs under it.
 */
void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset)
{}
EXPORT_SYMBOL_GPL();