diff options
author | MD Danish Anwar <danishanwar@ti.com> | 2024-05-28 13:37:33 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-05-30 15:37:26 +0200 |
commit | 972383aecf43c3664750496d5395e669c35ba06e (patch) | |
tree | d7a5a53d80e3df77be02bcfafe9dc22063b943fa /drivers/net/ethernet/ti/icssg/icssg_prueth.c | |
parent | net: ti: icssg-prueth: Add helper functions to configure FDB (diff) | |
download | linux-972383aecf43c3664750496d5395e669c35ba06e.tar.xz linux-972383aecf43c3664750496d5395e669c35ba06e.zip |
net: ti: icssg-switch: Add switchdev based driver for ethernet switch support
ICSSG can operating in switch mode with 2 ext port and 1 host port with
VLAN/FDB/MDB and STP offloading. Add switchdev based driver to
support the same.
Driver itself will be integrated with icssg_prueth in future commits
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/ti/icssg/icssg_prueth.c')
-rw-r--r-- | drivers/net/ethernet/ti/icssg/icssg_prueth.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index 1ea3fbd5e954..1db67a8107cc 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -30,6 +30,7 @@ #include "icssg_prueth.h" #include "icssg_mii_rt.h" +#include "icssg_switchdev.h" #include "../k3-cppi-desc-pool.h" #define PRUETH_MODULE_DESCRIPTION "PRUSS ICSSG Ethernet driver" @@ -833,6 +834,17 @@ free_ndev: return ret; } +bool prueth_dev_check(const struct net_device *ndev) +{ + if (ndev->netdev_ops == &emac_netdev_ops && netif_running(ndev)) { + struct prueth_emac *emac = netdev_priv(ndev); + + return emac->prueth->is_switch_mode; + } + + return false; +} + static int prueth_probe(struct platform_device *pdev) { struct device_node *eth_node, *eth_ports_node; |