summaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-12-06 18:03:33 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-07 14:14:54 -0500
commit2a93c1a3651fb41b580676c849887b68af6da02b (patch)
tree15a29c4aa5f0688f75b335e611b1dfd18ee3bb95 /net/dsa/slave.c
parenta8168b6cee6e9334dfebb4b9108e8d73794f6088 (diff)
net: dsa: Allow compiling out legacy support
Introduce a configuration option: CONFIG_NET_DSA_LEGACY allowing to compile out support for the old platform device and Device Tree binding registration. Support for these configurations is scheduled to be removed in 4.17. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 895db05d8c82..5d6475a6cc5d 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -941,6 +941,26 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
941 .set_rxnfc = dsa_slave_set_rxnfc, 941 .set_rxnfc = dsa_slave_set_rxnfc,
942}; 942};
943 943
944/* legacy way, bypassing the bridge *****************************************/
945int dsa_legacy_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
946 struct net_device *dev,
947 const unsigned char *addr, u16 vid,
948 u16 flags)
949{
950 struct dsa_port *dp = dsa_slave_to_port(dev);
951
952 return dsa_port_fdb_add(dp, addr, vid);
953}
954
955int dsa_legacy_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
956 struct net_device *dev,
957 const unsigned char *addr, u16 vid)
958{
959 struct dsa_port *dp = dsa_slave_to_port(dev);
960
961 return dsa_port_fdb_del(dp, addr, vid);
962}
963
944static const struct net_device_ops dsa_slave_netdev_ops = { 964static const struct net_device_ops dsa_slave_netdev_ops = {
945 .ndo_open = dsa_slave_open, 965 .ndo_open = dsa_slave_open,
946 .ndo_stop = dsa_slave_close, 966 .ndo_stop = dsa_slave_close,