From 4f79d58a3cad25e491cf8a11089d49580f00263e Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 19 Sep 2007 09:19:29 +0000 Subject: [PATCH] - Patch from Aravind Parchuri with some my modifications: * Allows LSI MPT target driver to compile on kernels >2.6.15 * Changes the way how gettid() syscall gate implemented - Small doc update git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@189 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- mpt/README | 11 +++++++++++ mpt/mpt_scst.c | 6 +++++- mpt/mpt_scst.h | 4 ++++ usr/fileio/debug.c | 7 ++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mpt/README b/mpt/README index 3ed20a6dd..99fd81d2d 100644 --- a/mpt/README +++ b/mpt/README @@ -26,6 +26,17 @@ drivers/message/fusion/Kconfig by diffs from $(SCST_DIR)/mpt/in-tree 3. Correct in drivers/message/fusion/Makefile SCST_INC_DIR variable so it points to correct directory with SCST include files. +Building outside the Linux kernel tree +-------------------------------------- + +Edit Makefile, comment there line + +obj-$(CONFIG_FUSION_SCST) += mpt_scst.o + +and uncomment line + +obj-m += mpt_scst.o + Notes on implementation ----------------------- The driver takes the mptstm target driver implemented by LSI diff --git a/mpt/mpt_scst.c b/mpt/mpt_scst.c index 46b2f47ec..9dde44e3f 100644 --- a/mpt/mpt_scst.c +++ b/mpt/mpt_scst.c @@ -155,7 +155,11 @@ mpt_target_show(struct seq_file *seq, void *v) ioc->prod_name, tgt->target_enable ? "True" : "False"); - if (ioc->bus_type == SCSI) { +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)) + if (ioc->bus_type == SCSI) { +#else + if (ioc->bus_type == SPI) { +#endif int i = 0; seq_printf(seq, "Target ID :%d\n" "Capabilities :0x%x\n" diff --git a/mpt/mpt_scst.h b/mpt/mpt_scst.h index e3f398891..f087e917c 100644 --- a/mpt/mpt_scst.h +++ b/mpt/mpt_scst.h @@ -2,7 +2,11 @@ #define __MPT_SCST_H #if defined(MODULE) && !defined(__GENKSYMS__) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) #include +#else +#include +#endif #include #endif diff --git a/usr/fileio/debug.c b/usr/fileio/debug.c index fc0cfadf7..c7cb6ed99 100644 --- a/usr/fileio/debug.c +++ b/usr/fileio/debug.c @@ -22,10 +22,15 @@ #include #include #include +#include +#include #include "debug.h" -_syscall0(pid_t,gettid); +pid_t gettid (void) +{ + return syscall(__NR_gettid); +} #if defined(DEBUG) || defined(TRACING)