From 1a3b890e8f06f3ad26b1ecaf652617858c64dad2 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 29 Jan 2011 11:23:25 +0000 Subject: [PATCH] Build fixes for kernel 2.6.38. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3239 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst_const.h | 4 ++++ scst/src/Makefile | 4 ++++ scst/src/scst_lib.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h index eeaaf3023..50148e9c7 100644 --- a/scst/include/scst_const.h +++ b/scst/include/scst_const.h @@ -278,9 +278,13 @@ enum scst_cdb_flags { #define INIT_ELEMENT_STATUS 0x07 #define INIT_ELEMENT_STATUS_RANGE 0x37 #define PREVENT_ALLOW_MEDIUM 0x1E +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) #define READ_ATTRIBUTE 0x8C +#endif #define REQUEST_VOLUME_ADDRESS 0xB5 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) #define WRITE_ATTRIBUTE 0x8D +#endif #define WRITE_VERIFY_16 0x8E #define VERIFY_6 0x13 #ifndef VERIFY_12 diff --git a/scst/src/Makefile b/scst/src/Makefile index 071b69735..fe3c30a52 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -121,6 +121,10 @@ INSTALL_DIR_H := $(DESTDIR)/usr/local/include/scst enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) +ifneq ($(shell grep -w sg_copy $(srctree)/include/linux/scatterlist.h),) +EXTRA_CFLAGS += -DHAVE_SG_COPY +endif + EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \ -Wno-unused-parameter -Wno-missing-field-initializers) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 57b6437de..5a6ecdbb5 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4517,7 +4517,7 @@ out: return; } -#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)) && defined(SCSI_EXEC_REQ_FIFO_DEFINED)) +#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)) && defined(SCSI_EXEC_REQ_FIFO_DEFINED)) && !defined(HAVE_SG_COPY) /* * Can switch to the next dst_sg element, so, to copy to strictly only