static void q2t_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd);
static int q2t_unreg_sess(struct q2t_sess *sess);
+#ifndef CONFIG_SCST_PROC
+
/** SYSFS **/
static ssize_t q2t_version_show(struct kobject *kobj,
NULL,
};
+#endif /* CONFIG_SCST_PROC */
+
static ssize_t q2t_enable_tgt(struct scst_tgt *tgt, const char *buf,
size_t size);
static bool q2t_is_tgt_enabled(struct scst_tgt *tgt);
.on_hw_pending_cmd_timeout = q2t_on_hw_pending_cmd_timeout,
.enable_tgt = q2t_enable_tgt,
.is_tgt_enabled = q2t_is_tgt_enabled,
+#ifndef CONFIG_SCST_PROC
.tgtt_attrs = q2t_attrs,
.tgt_attrs = q2t_tgt_attrs,
+#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
.default_trace_flags = Q2T_DEFAULT_LOG_FLAGS,
.trace_flags = &trace_flag,
return qla_tgt_mode_enabled(ha);
}
+#ifndef CONFIG_SCST_PROC
+
static ssize_t q2t_show_expl_conf_enabled(struct kobject *kobj,
struct kobj_attribute *attr, char *buffer)
{
return strlen(buf);
}
-#ifdef CONFIG_SCST_PROC
+#else /* CONFIG_SCST_PROC */
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#include <scst_const.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
+#define kobj_attribute device_attribute
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
#ifndef RHEL_RELEASE_CODE
typedef _Bool bool;
/* Optional local trace table help string */
const char *trace_tbl_help;
+#ifndef CONFIG_SCST_PROC
/* Optional sysfs attributes */
const struct attribute **tgtt_attrs;
/* Optional sysfs target attributes */
const struct attribute **tgt_attrs;
+#endif
/** Private, must be inited to 0 by memset() **/
/* Optional local trace table help string */
const char *trace_tbl_help;
+#ifndef CONFIG_SCST_PROC
/* Optional sysfs attributes */
const struct attribute **devt_attrs;
/* Optional sysfs device attributes */
const struct attribute **dev_attrs;
+#endif
/* Pointer to dev handler's private data */
void *devt_priv;
static int dev_user_exit_dev(struct scst_user_dev *dev);
#ifdef CONFIG_SCST_PROC
+
static int dev_user_read_proc(struct seq_file *seq,
struct scst_dev_type *dev_type);
-#endif
-static int dev_usr_parse(struct scst_cmd *cmd);
+#else /* CONFIG_SCST_PROC */
static ssize_t dev_user_sysfs_commands_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf);
NULL,
};
+#endif /* CONFIG_SCST_PROC */
+
+static int dev_usr_parse(struct scst_cmd *cmd);
+
/** Data **/
static struct kmem_cache *user_cmd_cachep;
dev->devtype.dev_done_atomic = 1;
#ifdef CONFIG_SCST_PROC
dev->devtype.no_proc = 1;
-#endif
+#else
dev->devtype.dev_attrs = dev_user_dev_attrs;
+#endif
dev->devtype.attach = dev_user_attach;
dev->devtype.detach = dev_user_detach;
dev->devtype.attach_tgt = dev_user_attach_tgt;
return res;
}
+#ifndef CONFIG_SCST_PROC
+
static ssize_t dev_user_sysfs_commands_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return pos;
}
-#ifdef CONFIG_SCST_PROC
+#else /* CONFIG_SCST_PROC */
+
/*
* Called when a file in the /proc/scsi_tgt/scst_user is read
*/
/** SYSFS **/
+#ifndef CONFIG_SCST_PROC
+
static ssize_t vdisk_mgmt_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf);
static ssize_t vdisk_mgmt_store(struct kobject *kobj,
NULL,
};
+#endif /* CONFIG_SCST_PROC */
+
static DEFINE_MUTEX(scst_vdisk_mutex);
/* Both protected by scst_vdisk_mutex */
.detach_tgt = vdisk_detach_tgt,
.parse = vdisk_parse,
.exec = vdisk_do_job,
+ .task_mgmt_fn = vdisk_task_mgmt_fn,
#ifdef CONFIG_SCST_PROC
.read_proc = vdisk_read_proc,
.write_proc = vdisk_write_proc,
-#endif
- .task_mgmt_fn = vdisk_task_mgmt_fn,
+#else
.devt_attrs = vdisk_attrs,
.dev_attrs = vdisk_fileio_attrs,
+#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
.default_trace_flags = SCST_DEFAULT_DEV_LOG_FLAGS,
.trace_flags = &trace_flag,
.parse = vdisk_parse,
.exec = vdisk_do_job,
.task_mgmt_fn = vdisk_task_mgmt_fn,
+#ifndef CONFIG_SCST_PROC
.devt_attrs = vdisk_attrs,
.dev_attrs = vdisk_blockio_attrs,
+#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
.default_trace_flags = SCST_DEFAULT_DEV_LOG_FLAGS,
.trace_flags = &trace_flag,
.parse = vdisk_parse,
.exec = vdisk_do_job,
.task_mgmt_fn = vdisk_task_mgmt_fn,
+#ifndef CONFIG_SCST_PROC
.devt_attrs = vdisk_attrs,
.dev_attrs = vdisk_nullio_attrs,
+#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
.default_trace_flags = SCST_DEFAULT_DEV_LOG_FLAGS,
.trace_flags = &trace_flag,
.detach_tgt = vdisk_detach_tgt,
.parse = vcdrom_parse,
.exec = vcdrom_exec,
+ .task_mgmt_fn = vdisk_task_mgmt_fn,
#ifdef CONFIG_SCST_PROC
.read_proc = vcdrom_read_proc,
.write_proc = vcdrom_write_proc,
-#endif
- .task_mgmt_fn = vdisk_task_mgmt_fn,
+#else
.devt_attrs = vdisk_attrs,
.dev_attrs = vcdrom_attrs,
+#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
.default_trace_flags = SCST_DEFAULT_DEV_LOG_FLAGS,
.trace_flags = &trace_flag,
return res;
}
+#ifndef CONFIG_SCST_PROC
+
static int vdisk_mgmt_cmd(const char *buffer, int length,
struct vdev_type *vdt)
{
return res;
}
-#ifdef CONFIG_SCST_PROC
+#else /* CONFIG_SCST_PROC */
/*
* ProcFS