linux/drivers/scsi/qla2xxx/qla_dfs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2014 QLogic Corporation
 */
#include "qla_def.h"

#include <linux/debugfs.h>
#include <linux/seq_file.h>

static struct dentry *qla2x00_dfs_root;
static atomic_t qla2x00_dfs_root_count;

#define QLA_DFS_RPORT_DEVLOSS_TMO

static int
qla_dfs_rport_get(struct fc_port *fp, int attr_id, u64 *val)
{}

static int
qla_dfs_rport_set(struct fc_port *fp, int attr_id, u64 val)
{}

#define DEFINE_QLA_DFS_RPORT_RW_ATTR(_attr_id, _attr)

/*
 * Wrapper for getting fc_port fields.
 *
 * _attr    : Attribute name.
 * _get_val : Accessor macro to retrieve the value.
 */
#define DEFINE_QLA_DFS_RPORT_FIELD_GET(_attr, _get_val)

#define DEFINE_QLA_DFS_RPORT_ACCESS(_attr, _get_val)

#define DEFINE_QLA_DFS_RPORT_FIELD(_attr)

DEFINE_QLA_DFS_RPORT_RW_ATTR();

DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD();
DEFINE_QLA_DFS_RPORT_FIELD_GET();
DEFINE_QLA_DFS_RPORT_FIELD_GET();

void
qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
{}

void
qla2x00_dfs_remove_rport(scsi_qla_host_t *vha, struct fc_port *fp)
{}

static int
qla2x00_dfs_tgt_sess_show(struct seq_file *s, void *unused)
{}

DEFINE_SHOW_ATTRIBUTE();

static int
qla2x00_dfs_tgt_port_database_show(struct seq_file *s, void *unused)
{}

DEFINE_SHOW_ATTRIBUTE();

static int
qla_dfs_fw_resource_cnt_show(struct seq_file *s, void *unused)
{}

DEFINE_SHOW_ATTRIBUTE();

static int
qla_dfs_tgt_counters_show(struct seq_file *s, void *unused)
{}

DEFINE_SHOW_ATTRIBUTE();

static int
qla2x00_dfs_fce_show(struct seq_file *s, void *unused)
{}

static int
qla2x00_dfs_fce_open(struct inode *inode, struct file *file)
{}

static int
qla2x00_dfs_fce_release(struct inode *inode, struct file *file)
{}

static const struct file_operations dfs_fce_ops =;

static int
qla_dfs_naqp_show(struct seq_file *s, void *unused)
{}

/*
 * Helper macros for setting up debugfs entries.
 * _name: The name of the debugfs entry
 * _ctx_struct: The context that was passed when creating the debugfs file
 *
 * QLA_DFS_SETUP_RD could be used when there is only a show function.
 * - show function take the name qla_dfs_<sysfs-name>_show
 *
 * QLA_DFS_SETUP_RW could be used when there are both show and write functions.
 * - show function take the name  qla_dfs_<sysfs-name>_show
 * - write function take the name qla_dfs_<sysfs-name>_write
 *
 * To have a new debugfs entry, do:
 * 1. Create a "struct dentry *" in the appropriate structure in the format
 * dfs_<sysfs-name>
 * 2. Setup debugfs entries using QLA_DFS_SETUP_RD / QLA_DFS_SETUP_RW
 * 3. Create debugfs file in qla2x00_dfs_setup() using QLA_DFS_CREATE_FILE
 * or QLA_DFS_ROOT_CREATE_FILE
 * 4. Remove debugfs file in qla2x00_dfs_remove() using QLA_DFS_REMOVE_FILE
 * or QLA_DFS_ROOT_REMOVE_FILE
 *
 * Example for creating "TEST" sysfs file:
 * 1. struct qla_hw_data { ... struct dentry *dfs_TEST; }
 * 2. QLA_DFS_SETUP_RD(TEST);
 * 3. In qla2x00_dfs_setup():
 * QLA_DFS_CREATE_FILE(ha, TEST, 0600, ha->dfs_dir, vha);
 * 4. In qla2x00_dfs_remove():
 * QLA_DFS_REMOVE_FILE(ha, TEST);
 */
#define QLA_DFS_SETUP_RD(_name)

#define QLA_DFS_SETUP_RW(_name)

#define QLA_DFS_ROOT_CREATE_FILE(_name, _perm, _ctx)

#define QLA_DFS_ROOT_REMOVE_FILE(_name)

#define QLA_DFS_CREATE_FILE(_struct, _name, _perm, _parent, _ctx)

#define QLA_DFS_REMOVE_FILE(_struct, _name)

static ssize_t
qla_dfs_naqp_write(struct file *file, const char __user *buffer,
    size_t count, loff_t *pos)
{}
QLA_DFS_SETUP_RW();

int
qla2x00_dfs_setup(scsi_qla_host_t *vha)
{}

int
qla2x00_dfs_remove(scsi_qla_host_t *vha)
{}