svn commit: r294827 - head/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Tue Jan 26 14:29:52 UTC 2016


Author: hselasky
Date: Tue Jan 26 14:29:50 2016
New Revision: 294827
URL: https://svnweb.freebsd.org/changeset/base/294827

Log:
  Add more network related macros and functions to the LinuxKPI.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/netdevice.h

Modified: head/sys/compat/linuxkpi/common/include/linux/netdevice.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/netdevice.h	Tue Jan 26 14:27:00 2016	(r294826)
+++ head/sys/compat/linuxkpi/common/include/linux/netdevice.h	Tue Jan 26 14:29:50 2016	(r294827)
@@ -58,6 +58,9 @@ extern struct net init_net;
 #define	dev_get_by_index(n, idx)	ifnet_byindex_ref((idx))
 #define	dev_hold(d)	if_ref((d))
 #define	dev_put(d)	if_rele((d))
+#define	dev_net(d)	(&init_net)
+
+#define	net_eq(a,b)	((a) == (b))
 
 #define	netif_running(dev)	!!((dev)->if_drv_flags & IFF_DRV_RUNNING)
 #define	netif_oper_up(dev)	!!((dev)->if_flags & IFF_UP)
@@ -69,6 +72,12 @@ netdev_priv(const struct net_device *dev
 	return (dev->if_softc);
 }
 
+static inline struct net_device *
+netdev_notifier_info_to_dev(void *ifp)
+{
+	return (ifp);
+}
+
 int	register_netdevice_notifier(struct notifier_block *);
 int	register_inetaddr_notifier(struct notifier_block *);
 int	unregister_netdevice_notifier(struct notifier_block *);
@@ -94,6 +103,12 @@ dev_mc_delete(struct net_device *dev, vo
 }
 
 static inline int
+dev_mc_del(struct net_device *dev, void *addr)
+{
+	return (dev_mc_delete(dev, addr, 6, 0));
+}
+
+static inline int
 dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly)
 {
 	struct sockaddr_dl sdl;


More information about the svn-src-all mailing list