constructs in the SCST source code into one of the following:
* These three lines are removed entirely if the symbol definition is present in
the Linux 2.6.18 source tree.
* The definition has been made unconditional if the symbol definition is not yet
present in the 2.6.31 source tree.
* Converted the definition into #if LINUX_VERSION_CODE < KERNEL_VERSION(...) /
#define SYMBOL / #endif if a definition for the symbol has been added between
kernel versions 2.6.18 and 2.6.31.
The patch below has been tested by veryfing whether the SCST tree still
compiles on RHEL 5.4 and by verifying the output of the following command:
for ((i=24;i<=31;i++)); do scripts/run-regression-tests 2.6.$i; done
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
also MI_REPORT_TARGET_PGS removed as not used.
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1315
d57e44dd-8a1f-0410-8b47-
8ef2f437770f
#ifndef __SCST_CONST_H
#define __SCST_CONST_H
#ifndef __SCST_CONST_H
#define __SCST_CONST_H
+#ifndef GENERATING_UPSTREAM_PATCH
+/*
+ * Include <linux/version.h> only when not converting this header file into
+ * a patch for upstream review because only then the symbol LINUX_VERSION_CODE
+ * is needed.
+ */
+#include <linux/version.h>
+#endif
#include <scsi/scsi.h>
#define SCST_CONST_VERSION "$Revision$"
#include <scsi/scsi.h>
#define SCST_CONST_VERSION "$Revision$"
/*************************************************************
* SCSI opcodes not listed anywhere else
*************************************************************/
/*************************************************************
* SCSI opcodes not listed anywhere else
*************************************************************/
-#ifndef REPORT_DEVICE_IDENTIFIER
#define REPORT_DEVICE_IDENTIFIER 0xA3
#define REPORT_DEVICE_IDENTIFIER 0xA3
-#endif
-#ifndef INIT_ELEMENT_STATUS
#define INIT_ELEMENT_STATUS 0x07
#define INIT_ELEMENT_STATUS 0x07
-#endif
-#ifndef INIT_ELEMENT_STATUS_RANGE
#define INIT_ELEMENT_STATUS_RANGE 0x37
#define INIT_ELEMENT_STATUS_RANGE 0x37
-#endif
-#ifndef PREVENT_ALLOW_MEDIUM
#define PREVENT_ALLOW_MEDIUM 0x1E
#define PREVENT_ALLOW_MEDIUM 0x1E
-#endif
-#ifndef READ_ATTRIBUTE
#define READ_ATTRIBUTE 0x8C
#define READ_ATTRIBUTE 0x8C
-#endif
-#ifndef REQUEST_VOLUME_ADDRESS
#define REQUEST_VOLUME_ADDRESS 0xB5
#define REQUEST_VOLUME_ADDRESS 0xB5
-#endif
-#ifndef WRITE_ATTRIBUTE
#define WRITE_ATTRIBUTE 0x8D
#define WRITE_ATTRIBUTE 0x8D
-#endif
-#ifndef WRITE_VERIFY_16
#define WRITE_VERIFY_16 0x8E
#define WRITE_VERIFY_16 0x8E
-#endif
-#ifndef VERIFY_6
-#endif
-#ifndef VERIFY_12
+#ifndef GENERATING_UPSTREAM_PATCH
+/*
+ * The constants below have been defined in the kernel header <scsi/scsi.h>
+ * and hence are not needed when this header file is included in kernel code.
+ * The definitions below are only used when this header file is included during
+ * compilation of SCST's user space components.
+ */
#ifndef READ_16
#define READ_16 0x88
#endif
#ifndef READ_16
#define READ_16 0x88
#endif
/* values for service action in */
#define SAI_READ_CAPACITY_16 0x10
#endif
/* values for service action in */
#define SAI_READ_CAPACITY_16 0x10
#endif
-#ifndef MI_REPORT_TARGET_PGS
-/* values for maintenance in */
-#define MI_REPORT_TARGET_PGS 0x0a
+#ifndef GENERATING_UPSTREAM_PATCH
#ifndef REPORT_LUNS
#define REPORT_LUNS 0xa0
#endif
#ifndef REPORT_LUNS
#define REPORT_LUNS 0xa0
#endif
/*************************************************************
** SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
/*************************************************************
** SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
/*************************************************************
** Control byte field in CDB
*************************************************************/
/*************************************************************
** Control byte field in CDB
*************************************************************/
-#ifndef CONTROL_BYTE_LINK_BIT
#define CONTROL_BYTE_LINK_BIT 0x01
#define CONTROL_BYTE_LINK_BIT 0x01
-#endif
-#ifndef CONTROL_BYTE_NACA_BIT
#define CONTROL_BYTE_NACA_BIT 0x04
#define CONTROL_BYTE_NACA_BIT 0x04
/*************************************************************
** Byte 1 in INQUIRY CDB
/*************************************************************
** Byte 1 in INQUIRY CDB