mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 13:16:34 +00:00
Patch from Uri Yanai <Uri.Yanai@ngsoft.com> fixing compilation for kernels below 2.6.28
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2659 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -47,6 +47,14 @@ Before installation make sure that the link
|
||||
"/lib/modules/`you_kernel_version`/build" points to the source code for
|
||||
your currently running kernel.
|
||||
|
||||
If your kernel version is <2.6.28, then you should consider applying
|
||||
kernel patch scst_fc_vport_create.patch from the "kernel" subdirectory.
|
||||
Without it, creating and removing NPIV targets using SCST sysfs
|
||||
interface will be disabled. NOTE: you will still be able to create and
|
||||
remove NPIV targets using the standard Linux interface (i.e. echoing
|
||||
wwpn:wwnn into /sys/class/fc_host/hostX/vport_create and
|
||||
/sys/class/fc_host/hostX/vport_delete).
|
||||
|
||||
Then you should replace (or link) by the initiator driver from this
|
||||
package "qla2xxx" subdirectory in kernel_source/drivers/scsi/ of the
|
||||
currently running kernel and using your favorite kernel configuration
|
||||
|
||||
@@ -169,8 +169,15 @@ static const struct attribute *q2t_tgt_attrs[] = {
|
||||
|
||||
static int q2t_enable_tgt(struct scst_tgt *tgt, bool enable);
|
||||
static bool q2t_is_tgt_enabled(struct scst_tgt *tgt);
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))
|
||||
static ssize_t q2t_add_vtarget(const char *target_name, char *params);
|
||||
static ssize_t q2t_del_vtarget(const char *target_name);
|
||||
#else
|
||||
#warning "Patch scst_fc_vport_create was not applied on\
|
||||
your kernel. Adding NPIV targets using SCST sysfs interface will be disabled."
|
||||
#endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))*/
|
||||
|
||||
/*
|
||||
* Global Variables
|
||||
@@ -210,8 +217,12 @@ static struct scst_tgt_template tgt2x_template = {
|
||||
.enable_target = q2t_enable_tgt,
|
||||
.is_target_enabled = q2t_is_tgt_enabled,
|
||||
#ifndef CONFIG_SCST_PROC
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))
|
||||
.add_target = q2t_add_vtarget,
|
||||
.del_target = q2t_del_vtarget,
|
||||
#endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))*/
|
||||
.add_target_parameters = "node_name, parent_host",
|
||||
.tgtt_attrs = q2t_attrs,
|
||||
.tgt_attrs = q2t_tgt_attrs,
|
||||
@@ -5626,6 +5637,8 @@ static int q2t_parse_wwn(const char *ns, u64 *nm)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))
|
||||
static ssize_t q2t_add_vtarget(const char *target_name, char *params)
|
||||
{
|
||||
int res;
|
||||
@@ -5739,6 +5752,8 @@ out:
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
}
|
||||
#endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))*/
|
||||
|
||||
static int q2t_get_initiator_port_transport_id(struct scst_session *scst_sess,
|
||||
uint8_t **transport_id)
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#ifndef __QLA2X_TGT_H
|
||||
#define __QLA2X_TGT_H
|
||||
|
||||
#include <linux/version.h>
|
||||
|
||||
extern request_t *qla2x00_req_pkt(scsi_qla_host_t *ha);
|
||||
|
||||
#ifdef CONFIG_SCSI_QLA2XXX_TARGET
|
||||
@@ -126,9 +128,14 @@ qla2x00_send_enable_lun(scsi_qla_host_t *ha, bool enable)
|
||||
}
|
||||
|
||||
extern void qla2xxx_add_targets(void);
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))
|
||||
extern size_t
|
||||
qla2xxx_add_vtarget(u64 *port_name, u64 *node_name, u64 *parent_host);
|
||||
extern size_t qla2xxx_del_vtarget(u64 *port_name);
|
||||
#endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))*/
|
||||
|
||||
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
|
||||
|
||||
#endif /* __QLA2X_TGT_H */
|
||||
|
||||
@@ -1666,6 +1666,8 @@ qla2xxx_add_targets(void)
|
||||
}
|
||||
EXPORT_SYMBOL(qla2xxx_add_targets);
|
||||
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))
|
||||
size_t qla2xxx_add_vtarget(u64 *port_name, u64 *node_name, u64 *parent_host)
|
||||
{
|
||||
struct Scsi_Host *shost = NULL;
|
||||
@@ -1737,6 +1739,12 @@ size_t qla2xxx_del_vtarget(u64 *port_name)
|
||||
return fc_vport_terminate(vport);
|
||||
}
|
||||
EXPORT_SYMBOL(qla2xxx_del_vtarget);
|
||||
#else
|
||||
|
||||
#warning "Patch scst_fc_vport_create was not applied on\
|
||||
your kernel. Adding NPIV targets using SCST sysfs interface will be disabled."
|
||||
#endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))*/
|
||||
|
||||
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user