ib_srpt: Make the test for IB_EVENT_GID_CHANGE support more robust

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5577 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2014-06-10 14:16:14 +00:00
parent 003b0f46ac
commit 007e3dfbbf
4 changed files with 14 additions and 7 deletions

View File

@@ -78,10 +78,12 @@ OFED_SRPT_PATH:=/lib/modules/$(KVER)/updates/kernel/drivers/infiniband/ulp/srpt/
# Whether or not the OFED ib_srpt.ko kernel module has been installed.
OFED_SRPT_INSTALLED:=$(shell if [ -e $(OFED_SRPT_PATH) ]; then echo true; else echo false; fi)
AUTOCONF_FLAGS=$(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >&/dev/null && echo -DHAVE_IB_EVENT_GID_CHANGE)
all: src/$(MODULE_SYMVERS)
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
PRE_CFLAGS="$(OFED_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules
PRE_CFLAGS="$(OFED_CFLAGS) $(AUTOCONF_FLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules
install: all src/ib_srpt.ko
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \

View File

@@ -0,0 +1 @@
obj-m += gid_change.o

View File

@@ -0,0 +1,9 @@
#include <linux/module.h>
#include <rdma/ib_verbs.h>
static int modinit(void)
{
return IB_EVENT_GID_CHANGE;
}
module_init(modinit);

View File

@@ -142,12 +142,7 @@ enum {
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) && \
!(defined(CONFIG_SUSE_KERNEL) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 76)) && \
!(defined(RHEL_MAJOR) && \
(RHEL_MAJOR -0 > 6 || \
RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 >= 5 || \
RHEL_MAJOR -0 == 5 && RHEL_MINOR -0 >= 9))
!defined(HAVE_IB_EVENT_GID_CHANGE)
/* See also patch "IB/core: Add GID change event" (commit 761d90ed4). */
enum { IB_EVENT_GID_CHANGE = 18 };
#endif