AC_MSG_RESULT(no)
])
+ AC_MSG_CHECKING([if has netdev_notifier_info_to_dev])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/netdevice.h>
+ ],[
+ return netdev_notifier_info_to_dev(NULL) ? 1 : 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NETDEV_NOTIFIER_INFO_TO_DEV, 1,
+ [netdev_notifier_info_to_dev is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([if mm has register_netdevice_notifier_rh])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/netdevice.h>
+ ],[
+ return register_netdevice_notifier_rh(NULL);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_REGISTER_NETDEVICE_NOTIFIER_RH, 1,
+ [register_netdevice_notifier_rh is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
])
#
# COMPAT_CONFIG_HEADERS
#define PF_IB AF_IB
#endif /* AF_IB */
-#define netdev_notifier_info_to_dev LINUX_BACKPORT(netdev_notifier_info_to_dev)
-static inline struct net_device *
-netdev_notifier_info_to_dev(void *ptr)
-{
- return (struct net_device *)ptr;
-}
-
#if !defined(CONFIG_COMPAT_IFLA_VF_LINK_STATE_MAX)
enum {
IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
}
#endif
+#ifdef HAVE_REGISTER_NETDEVICE_NOTIFIER_RH
+#define register_netdevice_notifier register_netdevice_notifier_rh
+#define unregister_netdevice_notifier unregister_netdevice_notifier_rh
+#endif
+
+#ifndef HAVE_NETDEV_NOTIFIER_INFO_TO_DEV
+#define netdev_notifier_info_to_dev LINUX_BACKPORT(netdev_notifier_info_to_dev)
+static inline struct net_device *
+netdev_notifier_info_to_dev(void *ptr)
+{
+ return (struct net_device *)ptr;
+}
+#endif
+
#endif /* _COMPAT_LINUX_NETDEVICE_H */