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 netdevice.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 netdevice.h has alloc_netdev with 4 params])
578 LB_LINUX_TRY_COMPILE([
579 #include <linux/netdevice.h>
581 struct net_device *dev;
583 dev = alloc_netdev(0, NULL, 0, NULL);
588 AC_DEFINE(HAVE_ALLOC_NETDEV_4P, 1,
589 [alloc_netdev has 4 parameters])
594 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
595 LB_LINUX_TRY_COMPILE([
596 #include <linux/sockios.h>
598 int x = SIOCGHWTSTAMP;
603 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
604 [SIOCGHWTSTAMP is defined])
609 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
610 LB_LINUX_TRY_COMPILE([
613 inet_get_local_port_range(NULL, NULL, NULL);
618 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
619 [inet_get_local_port_range has 3 parameters])
624 AC_MSG_CHECKING([if net.h has net_get_random_once])
625 LB_LINUX_TRY_COMPILE([
626 #include <linux/net.h>
628 net_get_random_once(NULL, 0);
633 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
634 [net_get_random_once is defined])
639 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
640 LB_LINUX_TRY_COMPILE([
641 #include <net/inet_sock.h>
643 __inet_ehashfn(0, 0, 0, 0, 0);
648 AC_DEFINE(HAVE_INET_EHASHFN, 1,
649 [__inet_ehashfn is defined])
654 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
655 LB_LINUX_TRY_COMPILE([
656 #include <linux/err.h>
658 int x = PTR_ERR_OR_ZERO(NULL);
663 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
664 [PTR_ERR_OR_ZERO is defined])
669 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
670 LB_LINUX_TRY_COMPILE([
671 #include <scsi/libiscsi.h>
673 struct iscsi_session session;
674 session.discovery_sess = 0;
679 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
680 [discovery_sess is defined])
685 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
686 LB_LINUX_TRY_COMPILE([
687 #include <scsi/iscsi_if.h>
689 int x = ISCSI_PARAM_DISCOVERY_SESS;
694 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
695 [ISCSI_PARAM_DISCOVERY_SESS is defined])
700 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
701 LB_LINUX_TRY_COMPILE([
702 #include <linux/pci.h>
704 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
709 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
710 [pcie_link_width is defined])
715 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
716 LB_LINUX_TRY_COMPILE([
717 #include <linux/pci.h>
719 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
724 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
725 [pci_bus_speed is defined])
730 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
731 LB_LINUX_TRY_COMPILE([
732 #include <linux/netdevice.h>
734 struct netdev_phys_port_id *x = NULL;
739 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
740 [netdev_phys_port_id is defined])
745 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
746 LB_LINUX_TRY_COMPILE([
747 #include <linux/if_link.h>
749 struct ifla_vf_info *x;
755 AC_DEFINE(HAVE_LINKSTATE, 1,
756 [linkstate is defined])
761 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
762 LB_LINUX_TRY_COMPILE([
763 #include <net/busy_poll.h>
765 skb_mark_napi_id(NULL, NULL);
770 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
771 [skb_mark_napi_id is defined])
776 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
777 LB_LINUX_TRY_COMPILE([
778 #include <linux/netdevice.h>
785 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
786 [napi_hash_add is defined])
791 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
792 LB_LINUX_TRY_COMPILE([
793 #include <linux/netdevice.h>
795 netif_keep_dst(NULL);
800 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
801 [netif_keep_dst is defined])
806 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
807 LB_LINUX_TRY_COMPILE([
808 #include <linux/netdevice.h>
810 dev_consume_skb_any(NULL);
815 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
816 [dev_consume_skb_any is defined])
821 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
822 LB_LINUX_TRY_COMPILE([
823 #include <linux/netdevice.h>
825 netdev_txq_bql_complete_prefetchw(NULL);
826 netdev_txq_bql_enqueue_prefetchw(NULL);
831 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
832 [netdev_txq_bql_complete_prefetchw is defined])
837 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
838 LB_LINUX_TRY_COMPILE([
839 #include <linux/skbuff.h>
847 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
848 [xmit_more is defined])
853 AC_MSG_CHECKING([if struct sk_buff has encapsulation])
854 LB_LINUX_TRY_COMPILE([
855 #include <linux/skbuff.h>
858 skb->encapsulation = 0;
863 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
864 [encapsulation is defined])
869 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
870 LB_LINUX_TRY_COMPILE([
871 #include <linux/etherdevice.h>
873 eth_get_headlen(NULL, 0);
878 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
879 [eth_get_headlen is defined])
884 AC_MSG_CHECKING([if struct sk_buff has csum_level])
885 LB_LINUX_TRY_COMPILE([
886 #include <linux/skbuff.h>
894 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
895 [csum_level is defined])
900 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
901 LB_LINUX_TRY_COMPILE([
902 #include <linux/skbuff.h>
904 skb_inner_transport_header(NULL);
909 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
910 [skb_inner_transport_header is defined])
915 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
916 LB_LINUX_TRY_COMPILE([
917 #include <linux/skbuff.h>
919 skb_inner_network_header(NULL);
924 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
925 [skb_inner_network_header is defined])
930 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
931 LB_LINUX_TRY_COMPILE([
932 #include <linux/if_vlan.h>
934 vlan_dev_get_egress_qos_mask(NULL, 0);
939 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
940 [vlan_dev_get_egress_qos_mask is defined])
945 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
946 LB_LINUX_TRY_COMPILE([
947 #include <linux/netdevice.h>
949 netdev_get_prio_tc_map(NULL, 0);
954 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
955 [netdev_get_prio_tc_map is defined])
960 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
961 LB_LINUX_TRY_COMPILE([
962 #include <linux/if_vlan.h>
964 __vlan_find_dev_deep_rcu(NULL, 0, 0);
969 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
970 [__vlan_find_dev_deep_rcu is defined])
975 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
976 LB_LINUX_TRY_COMPILE([
977 #include <linux/netdevice.h>
979 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
985 struct net_device_opts ndops;
987 ndops.ndo_select_queue = select_queue;
992 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
993 [ndo_select_queue has accel_priv])
998 AC_MSG_CHECKING([if include/net/bonding.h exists])
999 LB_LINUX_TRY_COMPILE([
1000 #include <net/bonding.h>
1005 AC_DEFINE(HAVE_BONDING_H, 1,
1006 [include/net/bonding.h exists])
1011 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
1012 LB_LINUX_TRY_COMPILE([
1013 #include "../drivers/net/bonding/bonding.h"
1015 struct bonding *bond = NULL;
1016 struct list_head *iter = NULL;
1017 struct slave *slave = NULL;
1019 bond_for_each_slave(bond, slave, iter) ;
1024 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
1025 [bond_for_each_slave has 3 parameters])
1031 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
1032 LB_LINUX_TRY_COMPILE([
1033 #include <linux/u64_stats_sync.h>
1035 struct u64_stats_sync sync;
1036 u64_stats_init(&sync);
1041 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
1042 [u64_stats_sync is defined])
1047 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
1048 LB_LINUX_TRY_COMPILE([
1049 #include <linux/u64_stats_sync.h>
1051 struct u64_stats_sync sync;
1052 u64_stats_fetch_begin_irq(&sync);
1057 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
1058 [u64_stats_fetch_begin_irq is defined])
1062 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
1063 LB_LINUX_TRY_COMPILE([
1064 #include <linux/etherdevice.h>
1066 char dest[6], src[6];
1067 ether_addr_copy(&dest, &src);
1072 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
1073 [ether_addr_copy is defined])
1078 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
1079 LB_LINUX_TRY_COMPILE([
1080 #include <linux/netdevice.h>
1082 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
1088 struct net_device_ops netdev_ops;
1090 netdev_ops.ndo_set_vf_rate = set_vf_rate;
1094 AC_DEFINE(HAVE_SET_VF_RATE, 1,
1095 [ndo_set_vf_rate is defined])
1100 AC_MSG_CHECKING([if netdev_extended has hw_features])
1101 LB_LINUX_TRY_COMPILE([
1102 #include <linux/netdevice.h>
1104 struct net_device *dev = NULL;
1106 netdev_extended(dev)->hw_features = 0;
1111 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
1117 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
1118 LB_LINUX_TRY_COMPILE([
1119 #include <linux/netdevice.h>
1121 struct net_device *dev = NULL;
1123 netdev_extended(dev)->_tx_ext = NULL;
1128 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1134 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1135 LB_LINUX_TRY_COMPILE([
1136 #include <linux/netdevice.h>
1138 int busy_poll(struct napi_struct *napi)
1143 struct net_device *dev = NULL;
1145 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1150 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1156 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1157 LB_LINUX_TRY_COMPILE([
1158 #include <linux/netdevice.h>
1160 struct net_device *dev = NULL;
1162 set_netdev_hw_features(dev, 0);
1167 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1173 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1174 LB_LINUX_TRY_COMPILE([
1175 #include <linux/netdevice.h>
1177 struct net_device *dev = NULL;
1179 netif_set_xps_queue(dev, NULL, 0);
1184 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1191 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1192 LB_LINUX_TRY_COMPILE([
1193 #include <linux/netdevice.h>
1195 int set_features(struct net_device *dev, netdev_features_t features)
1200 struct net_device_ops netdev_ops;
1202 netdev_ops.ndo_set_features = set_features;
1206 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1207 [ndo_set_features is defined])
1212 AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
1213 LB_LINUX_TRY_COMPILE([
1214 #include <linux/netdevice.h>
1216 struct net_device_ops x = {
1217 .ndo_setup_tc = NULL,
1223 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
1224 [ndo_setup_tc is defined])
1229 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1230 LB_LINUX_TRY_COMPILE([
1231 #include <linux/netdevice.h>
1233 int rx_flow_steer(struct net_device *dev,
1234 const struct sk_buff *skb,
1241 struct net_device_ops netdev_ops;
1243 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1247 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1248 [ndo_rx_flow_steer is defined])
1253 AC_MSG_CHECKING([if struct net_device has priv_flags])
1254 LB_LINUX_TRY_COMPILE([
1255 #include <linux/netdevice.h>
1257 struct net_device *netdev;
1258 netdev->priv_flags = 0;
1263 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1264 [priv_flags is defined])
1269 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1270 LB_LINUX_TRY_COMPILE([
1271 #include <linux/netdevice.h>
1273 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1274 struct rtnl_link_stats64 *storage)
1276 struct rtnl_link_stats64 stats_64;
1280 struct net_device_ops netdev_ops;
1282 netdev_ops.ndo_get_stats64 = get_stats_64;
1287 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1288 [ndo_get_stats64 is defined])
1292 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1293 LB_LINUX_TRY_COMPILE([
1294 #include <linux/netdevice.h>
1296 struct net_device_ops netdev_ops = {
1297 .ndo_bridge_setlink = NULL,
1298 .ndo_bridge_getlink = NULL,
1304 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1305 [ndo_bridge_set/getlink is defined])
1310 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1311 LB_LINUX_TRY_COMPILE([
1312 #include <linux/netdevice.h>
1315 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1319 struct net_device_ops netdev_ops;
1321 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1322 netdev_ops.ndo_vlan_rx_add_vid (NULL, 1, 1) ;
1327 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1328 [ndo_vlan_rx_add_vid has 3 parameters])
1333 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1334 LB_LINUX_TRY_COMPILE([
1335 #include <linux/netdevice.h>
1337 int get_phys_port_id(struct net_device *dev,
1338 struct netdev_phys_port_id *ppid)
1343 struct net_device_ops netdev_ops;
1345 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1350 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1356 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1357 LB_LINUX_TRY_COMPILE([
1358 #include <linux/netdevice.h>
1360 struct net_device_ops_ext netdev_ops_ext = {
1361 .size = sizeof(struct net_device_ops_ext),
1367 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1368 [struct net_device_ops_ext is defined])
1373 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1374 LB_LINUX_TRY_COMPILE([
1375 #include <linux/netdevice.h>
1377 int get_phys_port_id(struct net_device *dev,
1378 struct netdev_phys_port_id *ppid)
1383 struct net_device_ops_ext netdev_ops_ext;
1385 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1390 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1391 [ndo_get_phys_port_id is defined])
1396 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1397 LB_LINUX_TRY_COMPILE([
1398 #include <linux/netdevice.h>
1400 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1405 struct net_device_ops netdev_ops;
1407 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1412 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1413 [ndo_set_vf_spoofchk is defined in net_device_ops])
1418 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1419 LB_LINUX_TRY_COMPILE([
1420 #include <linux/netdevice.h>
1422 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1427 struct net_device_ops_ext netdev_ops_ext;
1429 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1434 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1435 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1440 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1441 LB_LINUX_TRY_COMPILE([
1442 #include <linux/netdevice.h>
1444 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1449 struct net_device_ops netdev_ops;
1451 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1456 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1457 [ndo_set_vf_link_state is defined in net_device_ops])
1462 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1463 LB_LINUX_TRY_COMPILE([
1464 #include <linux/netdevice.h>
1466 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1471 struct net_device_ops_ext netdev_ops_ext;
1473 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1478 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1479 [ndo_set_vf_link_state is defined])
1485 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1486 LB_LINUX_TRY_COMPILE([
1487 #include <linux/netdevice.h>
1489 struct net_device dev;
1491 ret = netif_set_real_num_tx_queues(&dev, 2);
1495 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1496 [netif_set_real_num_tx_queues returns int])
1501 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1502 LB_LINUX_TRY_COMPILE([
1503 #include <linux/netdevice.h>
1511 AC_DEFINE(HAVE_XPS_MAP, 1,
1512 [struct xps_map is defined])
1517 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1518 LB_LINUX_TRY_COMPILE([
1519 #include <linux/ethtool.h>
1521 const struct ethtool_ops en_ethtool_ops = {
1528 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1529 [set_phys_id is defined])
1534 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1535 LB_LINUX_TRY_COMPILE([
1536 #include <linux/ethtool.h>
1538 const struct ethtool_ops en_ethtool_ops = {
1539 .get_channels = NULL,
1540 .set_channels = NULL,
1546 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1547 [get/set_channels is defined])
1552 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1553 LB_LINUX_TRY_COMPILE([
1554 #include <linux/ethtool.h>
1556 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1557 .get_channels = NULL,
1558 .set_channels = NULL,
1564 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1565 [get/set_channels is defined in ethtool_ops_ext])
1570 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1571 LB_LINUX_TRY_COMPILE([
1572 #include <linux/ethtool.h>
1574 const struct ethtool_ops en_ethtool_ops = {
1575 .get_ts_info = NULL,
1581 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1582 [get_ts_info is defined])
1587 AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1588 LB_LINUX_TRY_COMPILE([
1589 #include <linux/ethtool.h>
1591 const struct ethtool_ops en_ethtool_ops = {
1598 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1599 [set_dump is defined])
1604 AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1605 LB_LINUX_TRY_COMPILE([
1606 #include <linux/ethtool.h>
1608 const struct ethtool_ops en_ethtool_ops = {
1609 .get_module_info = NULL,
1615 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1616 [get_module_info is defined])
1621 AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1622 LB_LINUX_TRY_COMPILE([
1623 #include <linux/ethtool.h>
1625 const struct ethtool_ops en_ethtool_ops = {
1626 .get_module_eeprom = NULL,
1632 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1633 [get_module_eeprom is defined])
1638 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1639 LB_LINUX_TRY_COMPILE([
1640 #include <linux/ethtool.h>
1642 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1643 .get_ts_info = NULL,
1649 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1650 [get_ts_info is defined in ethtool_ops_ext])
1655 AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1656 LB_LINUX_TRY_COMPILE([
1657 #include <linux/ethtool.h>
1659 unsigned char mac[ETH_ALEN];
1660 struct ethtool_flow_ext h_ext;
1662 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1667 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1668 [ethtool_flow_ext has h_dest])
1673 AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1674 LB_LINUX_TRY_COMPILE([
1675 #include <linux/netdevice.h>
1677 struct dev_addr_list addr;
1681 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1682 [dev_addr_list is defined])
1687 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1688 LB_LINUX_TRY_COMPILE([
1689 #include <linux/pci.h>
1691 struct pci_dev pdev;
1692 pci_vfs_assigned(&pdev);
1696 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1697 [pci_vfs_assigned is defined])
1702 AC_MSG_CHECKING([if vlan_insert_tag_set_proto is defined])
1703 LB_LINUX_TRY_COMPILE([
1704 #include <linux/if_vlan.h>
1706 struct sk_buff *skb;
1707 vlan_insert_tag_set_proto(skb, 0, 0);
1711 AC_DEFINE(HAVE_VLAN_INSERT_TAG_SET_PROTO, 1,
1712 [vlan_insert_tag_set_proto is defined])
1715 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1716 LB_LINUX_TRY_COMPILE([
1717 #include <linux/if_vlan.h>
1719 struct sk_buff *skb;
1720 __vlan_put_tag(skb, 0, 0);
1724 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1725 [__vlan_put_tag has 3 parameters])
1731 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1732 LB_LINUX_TRY_COMPILE([
1733 #include <linux/if_vlan.h>
1735 struct sk_buff *skb;
1736 __vlan_hwaccel_put_tag(skb, 0, 0);
1741 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1742 [__vlan_hwaccel_put_tag has 3 parameters])
1747 AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1748 LB_LINUX_TRY_COMPILE([
1749 #include <net/if_inet6.h>
1751 struct inet6_ifaddr ifp ;
1757 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1758 [if_next is defined])
1763 AC_MSG_CHECKING([if struct net_device has hw_features])
1764 LB_LINUX_TRY_COMPILE([
1765 #include <linux/netdevice.h>
1767 struct net_device dev;
1768 dev.hw_features = 0;
1773 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1774 [hw_features is defined])
1779 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1780 LB_LINUX_TRY_COMPILE([
1781 #include <linux/netdevice.h>
1783 struct net_device dev;
1784 dev.hw_enc_features = 0;
1789 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1790 [hw_enc_features is defined])
1795 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1796 LB_LINUX_TRY_COMPILE([
1797 #include <linux/netdevice.h>
1799 struct net_device dev;
1800 dev.rx_cpu_rmap = NULL;
1805 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1806 [rx_cpu_rmap is defined])
1811 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1812 LB_LINUX_TRY_COMPILE([
1813 #include <linux/if_vlan.h>
1815 struct sk_buff *skb;
1816 vlan_hwaccel_receive_skb(skb,0,0);
1820 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1821 [vlan_hwaccel_receive_skb is defined])
1826 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1827 LB_LINUX_TRY_COMPILE([
1828 #include <linux/irq.h>
1829 #include <linux/irqdesc.h>
1831 struct irq_desc desc;
1832 struct irq_data *data = irq_desc_get_irq_data(&desc);
1837 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1838 [irq_desc_get_irq_data is defined])
1844 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1845 LB_LINUX_TRY_COMPILE([
1846 #include <linux/pci.h>
1848 struct pci_dev *pdev;
1850 pdev->pcie_mpss = 0;
1854 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1855 [pcie_mpss is defined])
1860 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1861 LB_LINUX_TRY_COMPILE([
1862 #include <uapi/linux/if_ether.h>
1867 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1868 [uapi/linux/if_ether.h exist])
1873 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1874 LB_LINUX_TRY_COMPILE([
1875 #include <linux/if_link.h>
1877 struct ifla_vf_info *ivf;
1883 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
1884 [spoofchk is defined])
1889 AC_MSG_CHECKING([if vxlan.h has vxlan_gso_check])
1890 LB_LINUX_TRY_COMPILE([
1891 #include <net/vxlan.h>
1893 vxlan_gso_check(NULL);
1898 AC_DEFINE(HAVE_VXLAN_GSO_CHECK, 1,
1899 [vxlan_gso_check is defined])
1904 AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
1905 LB_LINUX_TRY_COMPILE([
1906 #include <net/dst.h>
1908 struct neighbour *neigh = dst_get_neighbour(NULL);
1913 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
1919 AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
1920 LB_LINUX_TRY_COMPILE([
1921 #include <linux/netlink.h>
1923 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
1928 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
1934 AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
1935 LB_LINUX_TRY_COMPILE([
1936 #include <linux/netlink.h>
1938 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
1943 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
1949 AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
1950 LB_LINUX_TRY_COMPILE([
1951 #include <net/dcbnl.h>
1953 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
1954 .ieee_getmaxrate = NULL,
1955 .ieee_setmaxrate = NULL,
1961 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
1962 [ieee_getmaxrate/ieee_setmaxrate is defined])
1968 ac_c_werror_flag=yes
1969 save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
1970 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
1972 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
1973 LB_LINUX_TRY_COMPILE([
1974 #include "../drivers/net/bonding/bonding.h"
1976 struct bonding *bond = NULL;
1977 struct slave *slave = NULL;
1980 bond_for_each_slave(bond, slave, iter) ;
1985 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
1986 [bond_for_each_slave has int for 3rd parameter])
1990 EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
1994 AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
1995 LB_LINUX_TRY_COMPILE([
1996 #include <linux/netdevice.h>
1998 netdev_master_upper_dev_get_rcu(NULL);
2003 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
2004 [netdev_master_upper_dev_get_rcu is defined])
2009 AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
2010 LB_LINUX_TRY_COMPILE([
2011 #include <linux/if_vlan.h>
2013 __vlan_find_dev_deep(NULL, 0, 0);
2018 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
2019 [__vlan_find_dev_deep has 3 paramters])
2024 AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
2025 LB_LINUX_TRY_COMPILE([
2026 #include <linux/skbuff.h>
2028 __skb_alloc_page(0, NULL);
2033 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
2034 [sk_buff has __skb_alloc_page])
2039 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
2040 LB_LINUX_TRY_COMPILE([
2041 #include <linux/if_vlan.h>
2043 __vlan_hwaccel_put_tag(NULL, 0, 0);
2048 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
2049 [__vlan_hwaccel_put_tag has 3 paramters])
2054 AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
2055 LB_LINUX_TRY_COMPILE([
2056 #include <linux/mm_types.h>
2058 struct page_frag frag = {0};
2063 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
2064 [linux/mm_types.h has struct page_frag])
2069 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
2070 LB_LINUX_TRY_COMPILE([
2071 #include <linux/if_vlan.h>
2073 __vlan_find_dev_deep(NULL, 0);
2078 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
2079 [__vlan_find_dev_deep is defined])
2084 AC_MSG_CHECKING([if idr .h has idr_Alloc])
2085 LB_LINUX_TRY_COMPILE([
2086 #include <linux/idr.h>
2088 idr_alloc(NULL, NULL, 0, 0, 0);
2092 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
2093 [idr_Alloc is defined]) ],[
2097 AC_MSG_CHECKING([if completion.h has reinit_completion])
2098 LB_LINUX_TRY_COMPILE([
2099 #include <linux/completion.h>
2101 struct completion c;
2103 reinit_completion(&c);
2107 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
2108 [reinit_completion is defined])
2113 AC_MSG_CHECKING([if dma-mapping.h has dma_set_mask_and_coherent])
2114 LB_LINUX_TRY_COMPILE([
2115 #include <linux/dma-mapping.h>
2117 dma_set_mask_and_coherent(NULL, 0);
2122 AC_DEFINE(HAVE_DMA_SET_MASK_AND_COHERENT, 1,
2123 [dma_set_mask_and_coherent is defined])
2128 LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
2129 [kernel/crash_dump.c],
2130 [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
2131 [elfcorehdr_addr is exported by the kernel])],
2135 # COMPAT_CONFIG_HEADERS
2137 # add -include config.h
2139 AC_DEFUN([COMPAT_CONFIG_HEADERS],[
2140 AC_CONFIG_HEADERS([config.h])
2141 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
2142 AC_SUBST(EXTRA_KCFLAGS)
2145 AC_DEFUN([OFA_PROG_LINUX],
2150 LB_LINUX_CONFIG([MODULES],[],[
2151 AC_MSG_ERROR([module support is required to build mlnx kernel modules.])
2153 LB_LINUX_CONFIG([MODVERSIONS])
2154 LB_LINUX_CONFIG([KALLSYMS],[],[
2155 AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
2159 COMPAT_CONFIG_HEADERS