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