diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2020-10-02 15:02:21 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-03 01:40:30 +0300 |
commit | 319e4dd11a207bac2eaa9b96060145cd0d4c12d2 (patch) | |
tree | 82d3e68236a381d6379e7fbbe8ddb4c3c81981c0 /drivers/net/ethernet/mscc/ocelot_vsc7514.c | |
parent | ea9d1f30b128c2bc5f429b3bd822b45ac9bf5114 (diff) | |
download | linux-319e4dd11a207bac2eaa9b96060145cd0d4c12d2.tar.xz |
net: mscc: ocelot: introduce conversion helpers between port and netdev
Since the mscc_ocelot_switch_lib is common between a pure switchdev and
a DSA driver, the procedure of retrieving a net_device for a certain
port index differs, as those are registered by their individual
front-ends.
Up to now that has been dealt with by always passing the port index to
the switch library, but now, we're going to need to work with net_device
pointers from the tc-flower offload, for things like indev, or mirred.
It is not desirable to refactor that, so let's make sure that the flower
offload core has the ability to translate between a net_device and a
port index properly.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot_vsc7514.c')
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot_vsc7514.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 086cddef319f..f3e54589e6d6 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -763,6 +763,8 @@ static u16 ocelot_wm_enc(u16 value) static const struct ocelot_ops ocelot_ops = { .reset = ocelot_reset, .wm_enc = ocelot_wm_enc, + .port_to_netdev = ocelot_port_to_netdev, + .netdev_to_port = ocelot_netdev_to_port, }; static const struct vcap_field vsc7514_vcap_es0_keys[] = { |