[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220508185313.2222956-16-colin.foster@in-advantage.com>
Date: Sun, 8 May 2022 11:53:12 -0700
From: Colin Foster <colin.foster@...advantage.com>
To: linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
netdev@...r.kernel.org
Cc: Terry Bowman <terry.bowman@....com>, Wolfram Sang <wsa@...nel.org>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Steen Hegelund <Steen.Hegelund@...rochip.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
Linus Walleij <linus.walleij@...aro.org>,
Russell King <linux@...linux.org.uk>,
Heiner Kallweit <hkallweit1@...il.com>,
Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Andrew Lunn <andrew@...n.ch>, UNGLinuxDriver@...rochip.com,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Vladimir Oltean <vladimir.oltean@....com>,
Lee Jones <lee.jones@...aro.org>
Subject: [RFC v8 net-next 15/16] net: dsa: felix: add phylink_get_caps capability
Add the ability for felix users to announce their capabilities to DSA
switches by way of phylink_get_caps. This will allow those users the
ability to use phylink_generic_validate, which otherwise wouldn't be
possible.
Signed-off-by: Colin Foster <colin.foster@...advantage.com>
---
drivers/net/dsa/ocelot/felix.c | 22 +++++++++++++++-------
drivers/net/dsa/ocelot/felix.h | 2 ++
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index d09408baaab7..32ed093f47c6 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -982,15 +982,23 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port,
struct phylink_config *config)
{
struct ocelot *ocelot = ds->priv;
+ struct felix *felix;
- /* This driver does not make use of the speed, duplex, pause or the
- * advertisement in its mac_config, so it is safe to mark this driver
- * as non-legacy.
- */
- config->legacy_pre_march2020 = false;
+ felix = ocelot_to_felix(ocelot);
+
+ if (felix->info->phylink_get_caps) {
+ felix->info->phylink_get_caps(ocelot, port, config);
+ } else {
- __set_bit(ocelot->ports[port]->phy_mode,
- config->supported_interfaces);
+ /* This driver does not make use of the speed, duplex, pause or
+ * the advertisement in its mac_config, so it is safe to mark
+ * this driver as non-legacy.
+ */
+ config->legacy_pre_march2020 = false;
+
+ __set_bit(ocelot->ports[port]->phy_mode,
+ config->supported_interfaces);
+ }
}
static void felix_phylink_validate(struct dsa_switch *ds, int port,
diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h
index 3ecac79bbf09..33281370f415 100644
--- a/drivers/net/dsa/ocelot/felix.h
+++ b/drivers/net/dsa/ocelot/felix.h
@@ -57,6 +57,8 @@ struct felix_info {
u32 speed);
struct regmap *(*init_regmap)(struct ocelot *ocelot,
struct resource *res);
+ void (*phylink_get_caps)(struct ocelot *ocelot, int port,
+ struct phylink_config *pl_config);
};
extern const struct dsa_switch_ops felix_switch_ops;
--
2.25.1
Powered by blists - more mailing lists