ib_srpt: Detect SRP_DATA_DESC_IMM constant support at compile time

This patch makes it possible to build the ib_srpt driver against a kernel
before v4.21 + latest MOFED.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8653 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-11-08 20:40:51 +00:00
parent 2f37a91d77
commit 30c6cdfbe7
4 changed files with 20 additions and 2 deletions
+6
View File
@@ -269,6 +269,12 @@ conftest/register_mad_agent/result-$(KVER).txt: \
echo "$(call run_conftest,register_mad_agent, \
-DREGISTER_MAD_AGENT_HAS_FLAGS_ARG)" >"$@"
conftest/srp_data_desc_imm/result-$(KVER).txt: \
conftest/srp_data_desc_imm/srp_data_desc_imm.c \
conftest/srp_data_desc_imm/Makefile
echo "$(call run_conftest_bool,srp_data_desc_imm, \
HAVE_SRP_DATA_DESC_IMM)" >"$@"
conftest/srp_login_req_rdma/result-$(KVER).txt: \
conftest/srp_login_req_rdma/srp_login_req_rdma.c \
conftest/srp_login_req_rdma/Makefile
+3
View File
@@ -0,0 +1,3 @@
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
obj-m += srp_data_desc_imm.o
@@ -0,0 +1,9 @@
#include <linux/module.h>
#include <scsi/srp.h>
static int modinit(void)
{
return SRP_DATA_DESC_IMM;
}
module_init(modinit);
+2 -2
View File
@@ -66,7 +66,7 @@
struct srpt_nexus;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0)
#if !HAVE_SRP_DATA_DESC_IMM
enum {
SRP_DATA_DESC_IMM = 3,
SRP_IMMED_REQUESTED = 0x80,
@@ -164,7 +164,7 @@ enum {
SRP_CMD_ORDERED_Q = 0x2,
SRP_CMD_ACA = 0x4,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0)
#if !HAVE_SRP_DATA_DESC_IMM
SRP_LOGIN_RSP_MULTICHAN_NO_CHAN = 0x0,
SRP_LOGIN_RSP_MULTICHAN_TERMINATED = 0x1,
SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2,