ib_srpt: RHEL 7.1 build fix (merge r6331 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@6449 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-07-30 17:32:03 +00:00
parent 5dfa94f90b
commit 4623441a2a
4 changed files with 21 additions and 3 deletions

View File

@@ -77,8 +77,9 @@ endif
OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/$(MODULE_SYMVERS)
endif
AUTOCONF_FLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >/dev/null 2>&1 && echo -DHAVE_IB_EVENT_GID_CHANGE)
PRE_CFLAGS=$(OFED_CFLAGS) $(AUTOCONF_FLAGS) -DOFED_FLAVOR=$(OFED_FLAVOR)
GID_CHANGE_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >/dev/null 2>&1 && echo -DHAVE_IB_EVENT_GID_CHANGE)
REGISTER_MAD_AGENT_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/register_mad_agent PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DREGISTER_MAD_AGENT_HAS_FLAGS_ARG)
PRE_CFLAGS=$(OFED_CFLAGS) $(GID_CHANGE_FLAG) $(REGISTER_MAD_AGENT_FLAG) -DOFED_FLAVOR=$(OFED_FLAVOR)
all: src/$(MODULE_SYMVERS)
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \

View File

@@ -0,0 +1,3 @@
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
obj-m += register_mad_agent.o

View File

@@ -0,0 +1,13 @@
#include <linux/module.h>
#include <rdma/ib_mad.h>
static int modinit(void)
{
struct ib_mad_agent *a;
a = ib_register_mad_agent(NULL, 0, 0, NULL, 0, NULL, NULL, NULL, 0);
return a!= 0;
}
module_init(modinit);

View File

@@ -690,7 +690,8 @@ static int srpt_refresh_port(struct srpt_port *sport)
srpt_mad_send_handler,
srpt_mad_recv_handler,
sport
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) || \
defined(REGISTER_MAD_AGENT_HAS_FLAGS_ARG)
, 0
#endif
);