--- /dev/null
+dnl Checks for OFED
+AC_DEFUN([LN_CONFIG_OFED_SPEC],
+[AC_MSG_CHECKING([check ofed specifics])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ ib_dma_map_single(NULL, NULL, 0, 0);
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_IB_DMA_MAP, 1,
+ [ib_dma_map_single defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_IB_COMP_VECTOR, 1,
+ [has completion vector])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ return RDMA_TRANSPORT_IWARP ==
+ rdma_node_get_transport(RDMA_NODE_RNIC);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_TRANSPORT_IWARP, 1,
+ [has transport iWARP])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/rdma_cm.h>
+ ],[
+ return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_RDMA_CMEV_ADDRCHANGE, 1,
+ [has completion vector])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/rdma_cm.h>
+ ],[
+ return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT, 1,
+ [has completion vector])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])