1 dnl Checks for the in-box ib_core
2 AC_DEFUN([RDMA_CONFIG_COMPAT],
4 AC_MSG_CHECKING([if ib_verbs has ib_dma_map_single])
6 #include <linux/version.h>
9 #include <rdma/ib_verbs.h>
11 ib_dma_map_single(NULL, NULL, 0, 0);
15 AC_DEFINE(HAVE_INBOX_IB_DMA_MAP, 1,
16 [ib_dma_map_single defined])
21 AC_MSG_CHECKING([if ib_create_cq wants comp_vector])
22 LB_LINUX_TRY_COMPILE([
23 #include <linux/version.h>
24 #include <linux/pci.h>
25 #include <linux/gfp.h>
26 #include <rdma/ib_verbs.h>
28 ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
32 AC_DEFINE(HAVE_INBOX_IB_COMP_VECTOR, 1,
33 [has completion vector])
38 AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_ADDR_CHANGE])
39 LB_LINUX_TRY_COMPILE([
40 #include <linux/version.h>
41 #include <linux/pci.h>
42 #include <linux/gfp.h>
43 #include <rdma/rdma_cm.h>
45 return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
48 AC_DEFINE(HAVE_INBOX_RDMA_CMEV_ADDRCHANGE, 1,
49 [has completion vector])
54 AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_TIMEWAIT_EXIT])
55 LB_LINUX_TRY_COMPILE([
56 #include <linux/version.h>
57 #include <linux/pci.h>
58 #include <linux/gfp.h>
59 #include <rdma/rdma_cm.h>
61 return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
64 AC_DEFINE(HAVE_INBOX_RDMA_CMEV_TIMEWAIT_EXIT, 1,
65 [has completion vector])
70 AC_MSG_CHECKING([if rdma_cm has rdma_set_reuseaddr])
71 LB_LINUX_TRY_COMPILE([
72 #include <linux/version.h>
73 #include <linux/pci.h>
74 #include <linux/gfp.h>
75 #include <rdma/rdma_cm.h>
77 rdma_set_reuseaddr(NULL, 1);
81 AC_DEFINE(HAVE_INBOX_RDMA_SET_REUSEADDR, 1,
82 [rdma_set_reuse defined])
87 AC_MSG_CHECKING([if struct ib_wc has member named ts])
88 LB_LINUX_TRY_COMPILE([
89 #include <linux/version.h>
90 #include <rdma/ib_verbs.h>
98 AC_DEFINE(HAVE_INBOX_IB_WC_TS, 1,
99 [ib_wc has member named ts])
104 AC_MSG_CHECKING([if struct ib_ah_attr has member named dmac])
105 LB_LINUX_TRY_COMPILE([
106 #include <linux/version.h>
107 #include <rdma/ib_verbs.h>
109 struct ib_ah_attr *ah_attr;
110 memset(ah_attr->dmac, 0, 6);
115 AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_DMAC, 1,
116 [ah_attr has member named dmac])
121 AC_MSG_CHECKING([if struct ib_ah_attr has member named vlan_id])
122 LB_LINUX_TRY_COMPILE([
123 #include <linux/version.h>
124 #include <rdma/ib_verbs.h>
126 struct ib_ah_attr *ah_attr;
127 ah_attr->vlan_id = 0;
132 AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_VLAN_ID, 1,
133 [ah_attr has member named vlan_id])
139 dnl Examine kernel functionality
140 AC_DEFUN([LINUX_CONFIG_COMPAT],
142 AC_MSG_CHECKING([if file_system_type has mount method])
143 LB_LINUX_TRY_COMPILE([
144 #include <linux/fs.h>
146 struct file_system_type fst;
152 AC_DEFINE(HAVE_MOUNT_METHOD, 1,
153 [mount method defined])
158 AC_MSG_CHECKING([if kernel has get_next_ino])
159 LB_LINUX_TRY_COMPILE([
160 #include <linux/fs.h>
164 ino = get_next_ino();
168 AC_DEFINE(HAVE_GET_NEXT_INO, 1,
169 [get_next_ino defined])
174 AC_MSG_CHECKING([if kernel has ktime_get_ns])
175 LB_LINUX_TRY_COMPILE([
176 #include <linux/ktime.h>
178 unsigned long long ns;
184 AC_DEFINE(HAVE_KTIME_GET_NS, 1,
185 [ktime_get_ns defined])
190 AC_MSG_CHECKING([if svc_xprt_class has xcl_ident])
191 LB_LINUX_TRY_COMPILE([
192 #include <linux/sunrpc/xprt.h>
193 #include <linux/sunrpc/svc_xprt.h>
195 struct svc_xprt_class svc_rdma_class = {
196 .xcl_ident = XPRT_TRANSPORT_RDMA,
201 AC_DEFINE(HAVE_XCL_IDENT, 1,
207 AC_MSG_CHECKING([if struct ifla_vf_info has max_tx_rate])
208 LB_LINUX_TRY_COMPILE([
209 #include <linux/if_link.h>
211 struct ifla_vf_info *ivf;
213 ivf->max_tx_rate = 0;
214 ivf->min_tx_rate = 0;
219 AC_DEFINE(HAVE_TX_RATE_LIMIT, 1,
220 [max_tx_rate is defined])
225 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
226 LB_LINUX_TRY_COMPILE([
227 #include <linux/ethtool.h>
229 const struct ethtool_ops en_ethtool_ops = {
230 .get_rxfh_indir_size = NULL,
238 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
239 [get/set_rxfh is defined])
245 AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
246 LB_LINUX_TRY_COMPILE([
247 #include <linux/ethtool.h>
249 const struct ethtool_ops en_ethtool_ops = {
257 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
258 [get/set_tunable is defined])
263 AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
264 LB_LINUX_TRY_COMPILE([
265 #include <linux/ethtool.h>
267 const struct ethtool_ops_ext en_ethtool_ops_ext = {
268 .size = sizeof(struct ethtool_ops_ext),
274 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
275 [struct ethtool_ops_ext is defined])
280 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh])
281 LB_LINUX_TRY_COMPILE([
282 #include <linux/ethtool.h>
284 const struct ethtool_ops_ext en_ethtool_ops_ext = {
285 .get_rxfh_indir_size = NULL,
293 AC_DEFINE(HAVE_GET_SET_RXFH_OPS_EXT, 1,
294 [get/set_rxfh is defined])
299 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
300 LB_LINUX_TRY_COMPILE([
301 #include <linux/ethtool.h>
303 const struct ethtool_ops_ext en_ethtool_ops_ext = {
304 .get_rxfh_indir_size = NULL,
305 .get_rxfh_indir = NULL,
306 .set_rxfh_indir = NULL,
312 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
313 [get/set_rxfh_indir is defined])
318 AC_MSG_CHECKING([if struct net_device has dev_port])
319 LB_LINUX_TRY_COMPILE([
320 #include <linux/netdevice.h>
322 struct net_device *dev = NULL;
329 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
330 [dev_port is defined])
335 AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
336 LB_LINUX_TRY_COMPILE([
337 #include <linux/ptp_clock_kernel.h>
339 struct ptp_clock_info *info;
345 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
351 AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
352 LB_LINUX_TRY_COMPILE([
353 #include <linux/pci.h>
355 int x = pci_enable_msi_exact(NULL, 0);
360 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
361 [pci_enable_msi_exact is defined])
366 AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
367 LB_LINUX_TRY_COMPILE([
368 #include <linux/pci.h>
370 int x = pci_enable_msix_range(NULL, 0, 0, 0);
375 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
376 [pci_enable_msix_range is defined])
381 AC_MSG_CHECKING([if pci.h pci_msix_vec_count])
382 LB_LINUX_TRY_COMPILE([
383 #include <linux/pci.h>
385 int x = pci_msix_vec_count(NULL);
390 AC_DEFINE(HAVE_PCI_MSIX_VEC_COUNT, 1,
391 [pci_msix_vec_count is defined])
396 AC_MSG_CHECKING([if pci_dev has msix_cap])
397 LB_LINUX_TRY_COMPILE([
398 #include <linux/pci.h>
406 AC_DEFINE(HAVE_PCI_MSIX_CAP, 1,
407 [msix_cap is defined])
412 AC_MSG_CHECKING([if mm_struct has pinned_vm])
413 LB_LINUX_TRY_COMPILE([
414 #include <linux/mm_types.h>
422 AC_DEFINE(HAVE_PINNED_VM, 1,
423 [pinned_vm is defined])
428 AC_MSG_CHECKING([if kernel has idr_alloc])
429 LB_LINUX_TRY_COMPILE([
430 #include <linux/idr.h>
433 x = idr_alloc(NULL, NULL, 0, 0, 0);
438 AC_DEFINE(HAVE_IDR_ALLOC, 1,
439 [idr_alloc is defined])
444 AC_MSG_CHECKING([if kernel has percpu variables])
445 LB_LINUX_TRY_COMPILE([
446 #include <linux/percpu.h>
448 static DEFINE_PER_CPU(unsigned int, x);
454 AC_DEFINE(HAVE_PERCPU_VARS, 1,
455 [percpu variables are defined])
460 AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
461 LB_LINUX_TRY_COMPILE([
462 #include <scsi/scsi_transport_iscsi.h>
464 static struct iscsi_transport iscsi_iser_transport = {
465 .attr_is_visible = NULL,
471 AC_DEFINE(HAVE_ISCSI_ATTR_IS_VISIBLE, 1,
472 [attr_is_visible is defined])
477 AC_MSG_CHECKING([if struct iscsi_transport has get_ep_param])
478 LB_LINUX_TRY_COMPILE([
479 #include <scsi/scsi_transport_iscsi.h>
481 static struct iscsi_transport iscsi_iser_transport = {
482 .get_ep_param = NULL,
488 AC_DEFINE(HAVE_ISCSI_GET_EP_PARAM, 1,
489 [get_ep_param is defined])
494 AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
495 LB_LINUX_TRY_COMPILE([
496 #include <scsi/scsi_transport_iscsi.h>
498 static struct iscsi_transport iscsi_iser_transport = {
499 .check_protection = NULL,
505 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
506 [check_protection is defined])
511 AC_MSG_CHECKING([if iscsi_proto.h has struct iscsi_scsi_req])
512 LB_LINUX_TRY_COMPILE([
513 #include <scsi/iscsi_proto.h>
515 struct iscsi_scsi_req req = {
522 AC_DEFINE(HAVE_ISCSI_SCSI_REQ, 1,
523 [struct iscsi_scsi_req is defined])
528 AC_MSG_CHECKING([if struct request_queue has request_fn_active])
529 LB_LINUX_TRY_COMPILE([
530 #include <linux/blkdev.h>
532 struct request_queue rq = {
533 .request_fn_active = 0,
539 AC_DEFINE(HAVE_REQUEST_QUEUE_REQUEST_FN_ACTIVE, 1,
540 [struct request_queue has request_fn_active])
545 AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
546 LB_LINUX_TRY_COMPILE([
547 #include <linux/netdevice.h>
549 select_queue_fallback_t fallback;
556 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
557 [select_queue_fallback_t is defined])
562 AC_MSG_CHECKING([if skbuff.h has skb_set_hash])
563 LB_LINUX_TRY_COMPILE([
564 #include <linux/netdevice.h>
566 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
571 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
572 [skb_set_hash is defined])
577 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
578 LB_LINUX_TRY_COMPILE([
579 #include <linux/sockios.h>
581 int x = SIOCGHWTSTAMP;
586 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
587 [SIOCGHWTSTAMP is defined])
592 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
593 LB_LINUX_TRY_COMPILE([
596 inet_get_local_port_range(NULL, NULL, NULL);
601 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
602 [inet_get_local_port_range has 3 parameters])
607 AC_MSG_CHECKING([if net.h has net_get_random_once])
608 LB_LINUX_TRY_COMPILE([
609 #include <linux/net.h>
611 net_get_random_once(NULL, 0);
616 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
617 [net_get_random_once is defined])
622 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
623 LB_LINUX_TRY_COMPILE([
624 #include <net/inet_sock.h>
626 __inet_ehashfn(0, 0, 0, 0, 0);
631 AC_DEFINE(HAVE_INET_EHASHFN, 1,
632 [__inet_ehashfn is defined])
637 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
638 LB_LINUX_TRY_COMPILE([
639 #include <linux/err.h>
641 int x = PTR_ERR_OR_ZERO(NULL);
646 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
647 [PTR_ERR_OR_ZERO is defined])
652 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
653 LB_LINUX_TRY_COMPILE([
654 #include <scsi/libiscsi.h>
656 struct iscsi_session session;
657 session.discovery_sess = 0;
662 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
663 [discovery_sess is defined])
668 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
669 LB_LINUX_TRY_COMPILE([
670 #include <scsi/iscsi_if.h>
672 int x = ISCSI_PARAM_DISCOVERY_SESS;
677 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
678 [ISCSI_PARAM_DISCOVERY_SESS is defined])
683 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
684 LB_LINUX_TRY_COMPILE([
685 #include <linux/pci.h>
687 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
692 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
693 [pcie_link_width is defined])
698 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
699 LB_LINUX_TRY_COMPILE([
700 #include <linux/pci.h>
702 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
707 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
708 [pci_bus_speed is defined])
713 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
714 LB_LINUX_TRY_COMPILE([
715 #include <linux/netdevice.h>
717 struct netdev_phys_port_id *x = NULL;
722 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
723 [netdev_phys_port_id is defined])
728 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
729 LB_LINUX_TRY_COMPILE([
730 #include <linux/if_link.h>
732 struct ifla_vf_info *x;
738 AC_DEFINE(HAVE_LINKSTATE, 1,
739 [linkstate is defined])
744 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
745 LB_LINUX_TRY_COMPILE([
746 #include <net/busy_poll.h>
748 skb_mark_napi_id(NULL, NULL);
753 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
754 [skb_mark_napi_id is defined])
759 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
760 LB_LINUX_TRY_COMPILE([
761 #include <linux/netdevice.h>
768 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
769 [napi_hash_add is defined])
774 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
775 LB_LINUX_TRY_COMPILE([
776 #include <linux/netdevice.h>
778 netif_keep_dst(NULL);
783 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
784 [netif_keep_dst is defined])
789 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
790 LB_LINUX_TRY_COMPILE([
791 #include <linux/netdevice.h>
793 dev_consume_skb_any(NULL);
798 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
799 [dev_consume_skb_any is defined])
804 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
805 LB_LINUX_TRY_COMPILE([
806 #include <linux/netdevice.h>
808 netdev_txq_bql_complete_prefetchw(NULL);
809 netdev_txq_bql_enqueue_prefetchw(NULL);
814 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
815 [netdev_txq_bql_complete_prefetchw is defined])
820 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
821 LB_LINUX_TRY_COMPILE([
822 #include <linux/skbuff.h>
830 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
831 [xmit_more is defined])
836 AC_MSG_CHECKING([if struct sk_buff has encapsulation])
837 LB_LINUX_TRY_COMPILE([
838 #include <linux/skbuff.h>
841 skb->encapsulation = 0;
846 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
847 [encapsulation is defined])
852 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
853 LB_LINUX_TRY_COMPILE([
854 #include <linux/etherdevice.h>
856 eth_get_headlen(NULL, 0);
861 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
862 [eth_get_headlen is defined])
867 AC_MSG_CHECKING([if struct sk_buff has csum_level])
868 LB_LINUX_TRY_COMPILE([
869 #include <linux/skbuff.h>
877 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
878 [csum_level is defined])
883 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
884 LB_LINUX_TRY_COMPILE([
885 #include <linux/skbuff.h>
887 skb_inner_transport_header(NULL);
892 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
893 [skb_inner_transport_header is defined])
898 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
899 LB_LINUX_TRY_COMPILE([
900 #include <linux/skbuff.h>
902 skb_inner_network_header(NULL);
907 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
908 [skb_inner_network_header is defined])
913 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
914 LB_LINUX_TRY_COMPILE([
915 #include <linux/if_vlan.h>
917 vlan_dev_get_egress_qos_mask(NULL, 0);
922 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
923 [vlan_dev_get_egress_qos_mask is defined])
928 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
929 LB_LINUX_TRY_COMPILE([
930 #include <linux/netdevice.h>
932 netdev_get_prio_tc_map(NULL, 0);
937 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
938 [netdev_get_prio_tc_map is defined])
943 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
944 LB_LINUX_TRY_COMPILE([
945 #include <linux/if_vlan.h>
947 __vlan_find_dev_deep_rcu(NULL, 0, 0);
952 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
953 [__vlan_find_dev_deep_rcu is defined])
958 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
959 LB_LINUX_TRY_COMPILE([
960 #include <linux/netdevice.h>
962 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
968 struct net_device_opts ndops;
970 ndops.ndo_select_queue = select_queue;
975 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
976 [ndo_select_queue has accel_priv])
981 AC_MSG_CHECKING([if include/net/bonding.h exists])
982 LB_LINUX_TRY_COMPILE([
983 #include <net/bonding.h>
988 AC_DEFINE(HAVE_BONDING_H, 1,
989 [include/net/bonding.h exists])
994 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
995 LB_LINUX_TRY_COMPILE([
996 #include "../drivers/net/bonding/bonding.h"
998 struct bonding *bond = NULL;
999 struct list_head *iter = NULL;
1000 struct slave *slave = NULL;
1002 bond_for_each_slave(bond, slave, iter) ;
1007 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
1008 [bond_for_each_slave has 3 parameters])
1014 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
1015 LB_LINUX_TRY_COMPILE([
1016 #include <linux/u64_stats_sync.h>
1018 struct u64_stats_sync sync;
1019 u64_stats_init(&sync);
1024 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
1025 [u64_stats_sync is defined])
1030 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
1031 LB_LINUX_TRY_COMPILE([
1032 #include <linux/u64_stats_sync.h>
1034 struct u64_stats_sync sync;
1035 u64_stats_fetch_begin_irq(&sync);
1040 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
1041 [u64_stats_fetch_begin_irq is defined])
1045 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
1046 LB_LINUX_TRY_COMPILE([
1047 #include <linux/etherdevice.h>
1049 char dest[6], src[6];
1050 ether_addr_copy(&dest, &src);
1055 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
1056 [ether_addr_copy is defined])
1061 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
1062 LB_LINUX_TRY_COMPILE([
1063 #include <linux/netdevice.h>
1065 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
1071 struct net_device_ops netdev_ops;
1073 netdev_ops.ndo_set_vf_rate = set_vf_rate;
1077 AC_DEFINE(HAVE_SET_VF_RATE, 1,
1078 [ndo_set_vf_rate is defined])
1083 AC_MSG_CHECKING([if netdev_extended has hw_features])
1084 LB_LINUX_TRY_COMPILE([
1085 #include <linux/netdevice.h>
1087 struct net_device *dev = NULL;
1089 netdev_extended(dev)->hw_features = 0;
1094 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
1100 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
1101 LB_LINUX_TRY_COMPILE([
1102 #include <linux/netdevice.h>
1104 struct net_device *dev = NULL;
1106 netdev_extended(dev)->_tx_ext = NULL;
1111 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1117 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1118 LB_LINUX_TRY_COMPILE([
1119 #include <linux/netdevice.h>
1121 int busy_poll(struct napi_struct *napi)
1126 struct net_device *dev = NULL;
1128 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1133 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1139 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1140 LB_LINUX_TRY_COMPILE([
1141 #include <linux/netdevice.h>
1143 struct net_device *dev = NULL;
1145 set_netdev_hw_features(dev, 0);
1150 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1156 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1157 LB_LINUX_TRY_COMPILE([
1158 #include <linux/netdevice.h>
1160 struct net_device *dev = NULL;
1162 netif_set_xps_queue(dev, NULL, 0);
1167 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1174 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1175 LB_LINUX_TRY_COMPILE([
1176 #include <linux/netdevice.h>
1178 int set_features(struct net_device *dev, netdev_features_t features)
1183 struct net_device_ops netdev_ops;
1185 netdev_ops.ndo_set_features = set_features;
1189 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1190 [ndo_set_features is defined])
1195 AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
1196 LB_LINUX_TRY_COMPILE([
1197 #include <linux/netdevice.h>
1199 struct net_device_ops x = {
1200 .ndo_setup_tc = NULL,
1206 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
1207 [ndo_setup_tc is defined])
1212 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1213 LB_LINUX_TRY_COMPILE([
1214 #include <linux/netdevice.h>
1216 int rx_flow_steer(struct net_device *dev,
1217 const struct sk_buff *skb,
1224 struct net_device_ops netdev_ops;
1226 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1230 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1231 [ndo_rx_flow_steer is defined])
1236 AC_MSG_CHECKING([if struct net_device has priv_flags])
1237 LB_LINUX_TRY_COMPILE([
1238 #include <linux/netdevice.h>
1240 struct net_device *netdev;
1241 netdev->priv_flags = 0;
1246 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1247 [priv_flags is defined])
1252 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1253 LB_LINUX_TRY_COMPILE([
1254 #include <linux/netdevice.h>
1256 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1257 struct rtnl_link_stats64 *storage)
1259 struct rtnl_link_stats64 stats_64;
1263 struct net_device_ops netdev_ops;
1265 netdev_ops.ndo_get_stats64 = get_stats_64;
1270 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1271 [ndo_get_stats64 is defined])
1275 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1276 LB_LINUX_TRY_COMPILE([
1277 #include <linux/netdevice.h>
1279 struct net_device_ops netdev_ops = {
1280 .ndo_bridge_setlink = NULL,
1281 .ndo_bridge_getlink = NULL,
1287 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1288 [ndo_bridge_set/getlink is defined])
1293 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1294 LB_LINUX_TRY_COMPILE([
1295 #include <linux/netdevice.h>
1298 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1302 struct net_device_ops netdev_ops;
1304 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1305 netdev_ops.ndo_vlan_rx_add_vid (NULL, 1, 1) ;
1310 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1311 [ndo_vlan_rx_add_vid has 3 parameters])
1316 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1317 LB_LINUX_TRY_COMPILE([
1318 #include <linux/netdevice.h>
1320 int get_phys_port_id(struct net_device *dev,
1321 struct netdev_phys_port_id *ppid)
1326 struct net_device_ops netdev_ops;
1328 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1333 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1339 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1340 LB_LINUX_TRY_COMPILE([
1341 #include <linux/netdevice.h>
1343 struct net_device_ops_ext netdev_ops_ext = {
1344 .size = sizeof(struct net_device_ops_ext),
1350 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1351 [struct net_device_ops_ext is defined])
1356 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1357 LB_LINUX_TRY_COMPILE([
1358 #include <linux/netdevice.h>
1360 int get_phys_port_id(struct net_device *dev,
1361 struct netdev_phys_port_id *ppid)
1366 struct net_device_ops_ext netdev_ops_ext;
1368 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1373 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1374 [ndo_get_phys_port_id is defined])
1379 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1380 LB_LINUX_TRY_COMPILE([
1381 #include <linux/netdevice.h>
1383 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1388 struct net_device_ops netdev_ops;
1390 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1395 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1396 [ndo_set_vf_spoofchk is defined in net_device_ops])
1401 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1402 LB_LINUX_TRY_COMPILE([
1403 #include <linux/netdevice.h>
1405 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1410 struct net_device_ops_ext netdev_ops_ext;
1412 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1417 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1418 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1423 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1424 LB_LINUX_TRY_COMPILE([
1425 #include <linux/netdevice.h>
1427 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1432 struct net_device_ops netdev_ops;
1434 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1439 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1440 [ndo_set_vf_link_state is defined in net_device_ops])
1445 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1446 LB_LINUX_TRY_COMPILE([
1447 #include <linux/netdevice.h>
1449 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1454 struct net_device_ops_ext netdev_ops_ext;
1456 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1461 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1462 [ndo_set_vf_link_state is defined])
1468 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1469 LB_LINUX_TRY_COMPILE([
1470 #include <linux/netdevice.h>
1472 struct net_device dev;
1474 ret = netif_set_real_num_tx_queues(&dev, 2);
1478 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1479 [netif_set_real_num_tx_queues returns int])
1484 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1485 LB_LINUX_TRY_COMPILE([
1486 #include <linux/netdevice.h>
1494 AC_DEFINE(HAVE_XPS_MAP, 1,
1495 [struct xps_map is defined])
1500 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1501 LB_LINUX_TRY_COMPILE([
1502 #include <linux/ethtool.h>
1504 const struct ethtool_ops en_ethtool_ops = {
1511 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1512 [set_phys_id is defined])
1517 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1518 LB_LINUX_TRY_COMPILE([
1519 #include <linux/ethtool.h>
1521 const struct ethtool_ops en_ethtool_ops = {
1522 .get_channels = NULL,
1523 .set_channels = NULL,
1529 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1530 [get/set_channels is defined])
1535 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1536 LB_LINUX_TRY_COMPILE([
1537 #include <linux/ethtool.h>
1539 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1540 .get_channels = NULL,
1541 .set_channels = NULL,
1547 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1548 [get/set_channels is defined in ethtool_ops_ext])
1553 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1554 LB_LINUX_TRY_COMPILE([
1555 #include <linux/ethtool.h>
1557 const struct ethtool_ops en_ethtool_ops = {
1558 .get_ts_info = NULL,
1564 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1565 [get_ts_info is defined])
1570 AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1571 LB_LINUX_TRY_COMPILE([
1572 #include <linux/ethtool.h>
1574 const struct ethtool_ops en_ethtool_ops = {
1581 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1582 [set_dump is defined])
1587 AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1588 LB_LINUX_TRY_COMPILE([
1589 #include <linux/ethtool.h>
1591 const struct ethtool_ops en_ethtool_ops = {
1592 .get_module_info = NULL,
1598 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1599 [get_module_info is defined])
1604 AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1605 LB_LINUX_TRY_COMPILE([
1606 #include <linux/ethtool.h>
1608 const struct ethtool_ops en_ethtool_ops = {
1609 .get_module_eeprom = NULL,
1615 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1616 [get_module_eeprom is defined])
1621 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1622 LB_LINUX_TRY_COMPILE([
1623 #include <linux/ethtool.h>
1625 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1626 .get_ts_info = NULL,
1632 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1633 [get_ts_info is defined in ethtool_ops_ext])
1638 AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1639 LB_LINUX_TRY_COMPILE([
1640 #include <linux/ethtool.h>
1642 unsigned char mac[ETH_ALEN];
1643 struct ethtool_flow_ext h_ext;
1645 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1650 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1651 [ethtool_flow_ext has h_dest])
1656 AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1657 LB_LINUX_TRY_COMPILE([
1658 #include <linux/netdevice.h>
1660 struct dev_addr_list addr;
1664 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1665 [dev_addr_list is defined])
1670 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1671 LB_LINUX_TRY_COMPILE([
1672 #include <linux/pci.h>
1674 struct pci_dev pdev;
1675 pci_vfs_assigned(&pdev);
1679 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1680 [pci_vfs_assigned is defined])
1684 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1685 LB_LINUX_TRY_COMPILE([
1686 #include <linux/if_vlan.h>
1688 struct sk_buff *skb;
1689 __vlan_put_tag(skb, 0, 0);
1694 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1695 [__vlan_put_tag has 3 parameters])
1700 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1701 LB_LINUX_TRY_COMPILE([
1702 #include <linux/if_vlan.h>
1704 struct sk_buff *skb;
1705 __vlan_hwaccel_put_tag(skb, 0, 0);
1710 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1711 [__vlan_hwaccel_put_tag has 3 parameters])
1716 AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1717 LB_LINUX_TRY_COMPILE([
1718 #include <net/if_inet6.h>
1720 struct inet6_ifaddr ifp ;
1726 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1727 [if_next is defined])
1732 AC_MSG_CHECKING([if struct net_device has hw_features])
1733 LB_LINUX_TRY_COMPILE([
1734 #include <linux/netdevice.h>
1736 struct net_device dev;
1737 dev.hw_features = 0;
1742 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1743 [hw_features is defined])
1748 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1749 LB_LINUX_TRY_COMPILE([
1750 #include <linux/netdevice.h>
1752 struct net_device dev;
1753 dev.hw_enc_features = 0;
1758 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1759 [hw_enc_features is defined])
1764 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1765 LB_LINUX_TRY_COMPILE([
1766 #include <linux/netdevice.h>
1768 struct net_device dev;
1769 dev.rx_cpu_rmap = NULL;
1774 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1775 [rx_cpu_rmap is defined])
1780 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1781 LB_LINUX_TRY_COMPILE([
1782 #include <linux/if_vlan.h>
1784 struct sk_buff *skb;
1785 vlan_hwaccel_receive_skb(skb,0,0);
1789 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1790 [vlan_hwaccel_receive_skb is defined])
1795 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1796 LB_LINUX_TRY_COMPILE([
1797 #include <linux/irq.h>
1798 #include <linux/irqdesc.h>
1800 struct irq_desc desc;
1801 struct irq_data *data = irq_desc_get_irq_data(&desc);
1806 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1807 [irq_desc_get_irq_data is defined])
1813 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1814 LB_LINUX_TRY_COMPILE([
1815 #include <linux/pci.h>
1817 struct pci_dev *pdev;
1819 pdev->pcie_mpss = 0;
1823 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1824 [pcie_mpss is defined])
1829 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1830 LB_LINUX_TRY_COMPILE([
1831 #include <uapi/linux/if_ether.h>
1836 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1837 [uapi/linux/if_ether.h exist])
1842 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1843 LB_LINUX_TRY_COMPILE([
1844 #include <linux/if_link.h>
1846 struct ifla_vf_info *ivf;
1852 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
1853 [spoofchk is defined])
1858 AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
1859 LB_LINUX_TRY_COMPILE([
1860 #include <net/dst.h>
1862 struct neighbour *neigh = dst_get_neighbour(NULL);
1867 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
1873 AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
1874 LB_LINUX_TRY_COMPILE([
1875 #include <linux/netlink.h>
1877 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
1882 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
1888 AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
1889 LB_LINUX_TRY_COMPILE([
1890 #include <linux/netlink.h>
1892 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
1897 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
1903 AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
1904 LB_LINUX_TRY_COMPILE([
1905 #include <net/dcbnl.h>
1907 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
1908 .ieee_getmaxrate = NULL,
1909 .ieee_setmaxrate = NULL,
1915 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
1916 [ieee_getmaxrate/ieee_setmaxrate is defined])
1922 ac_c_werror_flag=yes
1923 save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
1924 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
1926 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
1927 LB_LINUX_TRY_COMPILE([
1928 #include "../drivers/net/bonding/bonding.h"
1930 struct bonding *bond = NULL;
1931 struct slave *slave = NULL;
1934 bond_for_each_slave(bond, slave, iter) ;
1939 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
1940 [bond_for_each_slave has int for 3rd parameter])
1944 EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
1948 AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
1949 LB_LINUX_TRY_COMPILE([
1950 #include <linux/netdevice.h>
1952 netdev_master_upper_dev_get_rcu(NULL);
1957 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
1958 [netdev_master_upper_dev_get_rcu is defined])
1963 AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
1964 LB_LINUX_TRY_COMPILE([
1965 #include <linux/if_vlan.h>
1967 __vlan_find_dev_deep(NULL, 0, 0);
1972 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
1973 [__vlan_find_dev_deep has 3 paramters])
1978 AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
1979 LB_LINUX_TRY_COMPILE([
1980 #include <linux/skbuff.h>
1982 __skb_alloc_page(0, NULL);
1987 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
1988 [sk_buff has __skb_alloc_page])
1993 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1994 LB_LINUX_TRY_COMPILE([
1995 #include <linux/if_vlan.h>
1997 __vlan_hwaccel_put_tag(NULL, 0, 0);
2002 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
2003 [__vlan_hwaccel_put_tag has 3 paramters])
2008 AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
2009 LB_LINUX_TRY_COMPILE([
2010 #include <linux/mm_types.h>
2012 struct page_frag frag = {0};
2017 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
2018 [linux/mm_types.h has struct page_frag])
2023 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
2024 LB_LINUX_TRY_COMPILE([
2025 #include <linux/if_vlan.h>
2027 __vlan_find_dev_deep(NULL, 0);
2032 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
2033 [__vlan_find_dev_deep is defined])
2038 AC_MSG_CHECKING([if idr .h has idr_Alloc])
2039 LB_LINUX_TRY_COMPILE([
2040 #include <linux/idr.h>
2042 idr_alloc(NULL, NULL, 0, 0, 0);
2046 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
2047 [idr_Alloc is defined]) ],[
2051 AC_MSG_CHECKING([if completion.h has reinit_completion])
2052 LB_LINUX_TRY_COMPILE([
2053 #include <linux/completion.h>
2055 struct completion c;
2057 reinit_completion(&c);
2061 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
2062 [reinit_completion is defined])
2067 AC_MSG_CHECKING([if dma-mapping.h has dma_set_mask_and_coherent])
2068 LB_LINUX_TRY_COMPILE([
2069 #include <linux/dma-mapping.h>
2071 dma_set_mask_and_coherent(NULL, 0);
2076 AC_DEFINE(HAVE_DMA_SET_MASK_AND_COHERENT, 1,
2077 [dma_set_mask_and_coherent is defined])
2083 # COMPAT_CONFIG_HEADERS
2085 # add -include config.h
2087 AC_DEFUN([COMPAT_CONFIG_HEADERS],[
2088 AC_CONFIG_HEADERS([config.h])
2089 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
2090 AC_SUBST(EXTRA_KCFLAGS)
2093 AC_DEFUN([OFA_PROG_LINUX],
2098 LB_LINUX_CONFIG([MODULES],[],[
2099 AC_MSG_ERROR([module support is required to build mlnx kernel modules.])
2101 LB_LINUX_CONFIG([MODVERSIONS])
2102 LB_LINUX_CONFIG([KALLSYMS],[],[
2103 AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
2107 COMPAT_CONFIG_HEADERS