qla2x00t: Port to RHEL 6.1/6.2/6.3 (merge r4303 and r4419 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4442 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2012-07-29 16:46:58 +00:00
parent 5f7668e80a
commit c4c2555dc9
2 changed files with 48 additions and 14 deletions

View File

@@ -14,6 +14,10 @@
#include "qla2x_tgt.h"
#include <linux/ctype.h>
#ifndef RHEL_RELEASE_VERSION
#define RHEL_RELEASE_VERSION(maj, min) 0
#endif
static int qla24xx_vport_disable(struct fc_vport *, bool);
/* SYSFS attributes --------------------------------------------------------- */
@@ -537,7 +541,9 @@ static DEVICE_ATTR(port_database,
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_read_fw_dump(
#else
qla2x00_sysfs_read_fw_dump(struct file *file,
@@ -563,7 +569,9 @@ qla2x00_sysfs_read_fw_dump(struct file *file,
}
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_write_fw_dump(
#else
qla2x00_sysfs_write_fw_dump(struct file *file,
@@ -621,7 +629,9 @@ static struct bin_attribute sysfs_fw_dump_attr = {
};
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_read_nvram(
#else
qla2x00_sysfs_read_nvram(struct file *file,
@@ -649,7 +659,9 @@ qla2x00_sysfs_read_nvram(struct file *file,
}
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_write_nvram(
#else
qla2x00_sysfs_write_nvram(struct file *file,
@@ -709,7 +721,9 @@ static struct bin_attribute sysfs_nvram_attr = {
};
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_read_optrom(
#else
qla2x00_sysfs_read_optrom(struct file *file,
@@ -734,7 +748,9 @@ qla2x00_sysfs_read_optrom(struct file *file,
}
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_write_optrom(
#else
qla2x00_sysfs_write_optrom(struct file *file,
@@ -769,7 +785,9 @@ static struct bin_attribute sysfs_optrom_attr = {
};
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_write_optrom_ctl(
#else
qla2x00_sysfs_write_optrom_ctl(struct file *file,
@@ -926,7 +944,9 @@ static struct bin_attribute sysfs_optrom_ctl_attr = {
};
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_read_vpd(
#else
qla2x00_sysfs_read_vpd(struct file *file,
@@ -954,7 +974,9 @@ qla2x00_sysfs_read_vpd(struct file *file,
}
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_write_vpd(
#else
qla2x00_sysfs_write_vpd(struct file *file,
@@ -987,7 +1009,9 @@ static struct bin_attribute sysfs_vpd_attr = {
};
static ssize_t
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
qla2x00_sysfs_read_sfp(
#else
qla2x00_sysfs_read_sfp(struct file *file,

View File

@@ -20,6 +20,10 @@
#include "qla2x_tgt.h"
#ifndef RHEL_RELEASE_VERSION
#define RHEL_RELEASE_VERSION(maj, min) 0
#endif
/*
* Driver version
*/
@@ -143,7 +147,10 @@ static int qla2xxx_eh_target_reset(struct scsi_cmnd *);
static int qla2xxx_eh_bus_reset(struct scsi_cmnd *);
static int qla2xxx_eh_host_reset(struct scsi_cmnd *);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && !defined(CONFIG_SUSE_KERNEL)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && \
!defined(CONFIG_SUSE_KERNEL) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
static int qla2x00_change_queue_depth(struct scsi_device *, int);
#else
static int qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth,
@@ -1195,7 +1202,10 @@ qla2xxx_slave_destroy(struct scsi_device *sdev)
sdev->hostdata = NULL;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && !defined(CONFIG_SUSE_KERNEL)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && \
!defined(CONFIG_SUSE_KERNEL) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1))
static int
qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth)
@@ -1204,7 +1214,7 @@ qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth)
return sdev->queue_depth;
}
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) */
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && !defined(CONFIG_SUSE_KERNEL) && (!defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1)) */
static void qla2x00_handle_queue_full(struct scsi_device *sdev, int qdepth)
{
@@ -1257,7 +1267,7 @@ qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
return sdev->queue_depth;
}
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && !defined(CONFIG_SUSE_KERNEL) */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) && !defined(CONFIG_SUSE_KERNEL) && (!defined(RHEL_RELEASE_CODE) || RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1)) */
static int
qla2x00_change_queue_type(struct scsi_device *sdev, int tag_type)