net: break include loop netdevice.h, dsa.h, devlink.h
There is an include loop between netdevice.h, dsa.h, devlink.h because of NETDEV_ALIGN, making it impossible to use devlink structures in dsa.h. Break this loop by taking dsa.h out of netdevice.h, add a forward declaration of dsa_switch_tree and netdev_set_default_ethtool_ops() function, which is what netdevice.h requires. No longer having dsa.h in netdevice.h means the includes in dsa.h no longer get included. This breaks a few other files which depend on these includes. Add these directly in the affected file. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
0e42c72195
commit
c6e970a04b
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <linux/ethtool.h>
|
||||
#include <net/net_namespace.h>
|
||||
#include <net/dsa.h>
|
||||
#ifdef CONFIG_DCB
|
||||
#include <net/dcbnl.h>
|
||||
#endif
|
||||
@@ -57,6 +56,8 @@
|
||||
struct netpoll_info;
|
||||
struct device;
|
||||
struct phy_device;
|
||||
struct dsa_switch_tree;
|
||||
|
||||
/* 802.11 specific */
|
||||
struct wireless_dev;
|
||||
/* 802.15.4 specific */
|
||||
@@ -2004,15 +2005,6 @@ void dev_net_set(struct net_device *dev, struct net *net)
|
||||
write_pnet(&dev->nd_net, net);
|
||||
}
|
||||
|
||||
static inline bool netdev_uses_dsa(struct net_device *dev)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_NET_DSA)
|
||||
if (dev->dsa_ptr != NULL)
|
||||
return dsa_uses_tagged_protocol(dev->dsa_ptr);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* netdev_priv - access network device private data
|
||||
* @dev: network device
|
||||
|
Reference in New Issue
Block a user