Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107374423
D30461.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D30461.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h
--- a/sys/compat/linuxkpi/common/include/linux/netdevice.h
+++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h
@@ -40,10 +40,6 @@
#include <net/if_var.h>
#include <net/if_dl.h>
-#include <linux/list.h>
-#include <linux/completion.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
#include <linux/net.h>
#include <linux/notifier.h>
@@ -57,21 +53,6 @@
#define net_device ifnet
-static inline struct ifnet *
-dev_get_by_index(struct vnet *vnet, int if_index)
-{
- struct epoch_tracker et;
- struct ifnet *retval;
-
- NET_EPOCH_ENTER(et);
- CURVNET_SET(vnet);
- retval = ifnet_byindex_ref(if_index);
- CURVNET_RESTORE();
- NET_EPOCH_EXIT(et);
-
- return (retval);
-}
-
#define dev_hold(d) if_ref(d)
#define dev_put(d) if_rele(d)
#define dev_net(d) ((d)->if_vnet)
@@ -79,56 +60,11 @@
#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)
#define netif_carrier_ok(dev) ((dev)->if_link_state == LINK_STATE_UP)
-static inline void *
-netdev_priv(const struct net_device *dev)
-{
- return (dev->if_softc);
-}
-
#define rtnl_lock()
#define rtnl_unlock()
-static inline int
-dev_mc_delete(struct net_device *dev, void *addr, int alen, int all)
-{
- struct sockaddr_dl sdl;
-
- if (alen > sizeof(sdl.sdl_data))
- return (-EINVAL);
- memset(&sdl, 0, sizeof(sdl));
- sdl.sdl_len = sizeof(sdl);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_alen = alen;
- memcpy(&sdl.sdl_data, addr, alen);
-
- return -if_delmulti(dev, (struct sockaddr *)&sdl);
-}
-
-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;
-
- if (alen > sizeof(sdl.sdl_data))
- return (-EINVAL);
- memset(&sdl, 0, sizeof(sdl));
- sdl.sdl_len = sizeof(sdl);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_alen = alen;
- memcpy(&sdl.sdl_data, addr, alen);
-
- return -if_addmulti(dev, (struct sockaddr *)&sdl, NULL);
-}
-
/* According to linux::ipoib_main.c. */
struct netdev_notifier_info {
struct net_device *dev;
diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h
--- a/sys/dev/mlx4/mlx4_en/en.h
+++ b/sys/dev/mlx4/mlx4_en/en.h
@@ -654,6 +654,12 @@
u64 reg_id;
};
+static inline void *
+netdev_priv(const struct net_device *dev)
+{
+ return (dev->if_softc);
+}
+
static inline struct mlx4_cqe *mlx4_en_get_cqe(u8 *buf, int idx, int cqe_sz)
{
return (struct mlx4_cqe *)(buf + idx * cqe_sz);
diff --git a/sys/ofed/drivers/infiniband/core/ib_addr.c b/sys/ofed/drivers/infiniband/core/ib_addr.c
--- a/sys/ofed/drivers/infiniband/core/ib_addr.c
+++ b/sys/ofed/drivers/infiniband/core/ib_addr.c
@@ -46,7 +46,6 @@
#include <net/route/nhop.h>
#include <net/netevent.h>
#include <rdma/ib_addr.h>
-#include <rdma/ib_addr_freebsd.h>
#include <rdma/ib.h>
#include <netinet/in_fib.h>
diff --git a/sys/ofed/drivers/infiniband/core/ib_cma.c b/sys/ofed/drivers/infiniband/core/ib_cma.c
--- a/sys/ofed/drivers/infiniband/core/ib_cma.c
+++ b/sys/ofed/drivers/infiniband/core/ib_cma.c
@@ -65,7 +65,6 @@
#include <rdma/rdma_sdp.h>
#include <rdma/ib.h>
#include <rdma/ib_addr.h>
-#include <rdma/ib_addr_freebsd.h>
#include <rdma/ib_cache.h>
#include <rdma/ib_cm.h>
#include <rdma/ib_sa.h>
diff --git a/sys/ofed/include/rdma/ib_addr.h b/sys/ofed/include/rdma/ib_addr.h
--- a/sys/ofed/include/rdma/ib_addr.h
+++ b/sys/ofed/include/rdma/ib_addr.h
@@ -49,7 +49,7 @@
#include <net/ip.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_pack.h>
-#include <net/ipv6.h>
+#include <rdma/ib_addr_freebsd.h>
struct rdma_addr_client {
atomic_t refcount;
diff --git a/sys/ofed/include/rdma/ib_addr_freebsd.h b/sys/ofed/include/rdma/ib_addr_freebsd.h
--- a/sys/ofed/include/rdma/ib_addr_freebsd.h
+++ b/sys/ofed/include/rdma/ib_addr_freebsd.h
@@ -92,4 +92,19 @@
}
#endif
+static inline struct ifnet *
+dev_get_by_index(struct vnet *vnet, int if_index)
+{
+ struct epoch_tracker et;
+ struct ifnet *retval;
+
+ NET_EPOCH_ENTER(et);
+ CURVNET_SET(vnet);
+ retval = ifnet_byindex_ref(if_index);
+ CURVNET_RESTORE();
+ NET_EPOCH_EXIT(et);
+
+ return (retval);
+}
+
#endif /* _RDMA_IB_ADDR_FREEBSD_H */
diff --git a/sys/ofed/include/rdma/ib_sa.h b/sys/ofed/include/rdma/ib_sa.h
--- a/sys/ofed/include/rdma/ib_sa.h
+++ b/sys/ofed/include/rdma/ib_sa.h
@@ -43,6 +43,7 @@
#include <linux/compiler.h>
#include <linux/netdevice.h>
+#include <rdma/ib_addr_freebsd.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_mad.h>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 14, 5:58 AM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15791603
Default Alt Text
D30461.diff (4 KB)
Attached To
Mode
D30461: LinuxKPI/OFED/mlx4: cleanup netdevice.h some more
Attached
Detach File
Event Timeline
Log In to Comment