netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Chris Healy <cphealy@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next 7/7] net: dsa: mv88e6xxx: Implement devlink info get callback
Date: Sun, 16 Aug 2020 21:43:16 +0200	[thread overview]
Message-ID: <20200816194316.2291489-8-andrew@lunn.ch> (raw)
In-Reply-To: <20200816194316.2291489-1-andrew@lunn.ch>

Return the driver name and the asic.id with the switch name.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6xxx/chip.c    |  1 +
 drivers/net/dsa/mv88e6xxx/devlink.c | 15 +++++++++++++++
 drivers/net/dsa/mv88e6xxx/devlink.h |  3 +++
 3 files changed, 19 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 33e4518736a2..ee3b1a6b1ea8 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -5385,6 +5385,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
 	.get_ts_info		= mv88e6xxx_get_ts_info,
 	.devlink_param_get	= mv88e6xxx_devlink_param_get,
 	.devlink_param_set	= mv88e6xxx_devlink_param_set,
+	.devlink_info_get	= mv88e6xxx_devlink_info_get,
 };
 
 static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
diff --git a/drivers/net/dsa/mv88e6xxx/devlink.c b/drivers/net/dsa/mv88e6xxx/devlink.c
index c6ebadcfa63f..8cb167d737e2 100644
--- a/drivers/net/dsa/mv88e6xxx/devlink.c
+++ b/drivers/net/dsa/mv88e6xxx/devlink.c
@@ -673,3 +673,18 @@ int mv88e6xxx_setup_devlink_regions(struct dsa_switch *ds)
 	return 0;
 }
 
+int mv88e6xxx_devlink_info_get(struct dsa_switch *ds,
+			       struct devlink_info_req *req,
+			       struct netlink_ext_ack *extack)
+{
+	struct mv88e6xxx_chip *chip = ds->priv;
+	int err;
+
+	err = devlink_info_driver_name_put(req, "mv88e6xxx");
+	if (err)
+		return err;
+
+	return devlink_info_version_fixed_put(req,
+					      DEVLINK_INFO_VERSION_GENERIC_ASIC_ID,
+					      chip->info->name);
+}
diff --git a/drivers/net/dsa/mv88e6xxx/devlink.h b/drivers/net/dsa/mv88e6xxx/devlink.h
index da83c25d944b..3d72db3dcf95 100644
--- a/drivers/net/dsa/mv88e6xxx/devlink.h
+++ b/drivers/net/dsa/mv88e6xxx/devlink.h
@@ -15,4 +15,7 @@ int mv88e6xxx_devlink_param_set(struct dsa_switch *ds, u32 id,
 int mv88e6xxx_setup_devlink_regions(struct dsa_switch *ds);
 void mv88e6xxx_teardown_devlink_regions(struct dsa_switch *ds);
 
+int mv88e6xxx_devlink_info_get(struct dsa_switch *ds,
+			       struct devlink_info_req *req,
+			       struct netlink_ext_ack *extack);
 #endif /* _MV88E6XXX_DEVLINK_H */
-- 
2.28.0


  parent reply	other threads:[~2020-08-16 19:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 19:43 [PATCH net-next 0/7] net: dsa: mv88e6xxx: Add devlink regions support Andrew Lunn
2020-08-16 19:43 ` [PATCH net-next 1/7] net: dsa: Add helper to convert from devlink to ds Andrew Lunn
2020-08-17 17:08   ` Florian Fainelli
2020-08-16 19:43 ` [PATCH net-next 2/7] net: dsa: Add devlink regions support to DSA Andrew Lunn
2020-08-16 21:50   ` Vladimir Oltean
2020-08-16 22:06     ` Andrew Lunn
2020-08-16 22:17       ` Vladimir Oltean
2020-08-16 19:43 ` [PATCH net-next 3/7] net: dsa: mv88e6xxx: Move devlink code into its own file Andrew Lunn
2020-08-16 19:43 ` [PATCH net-next 4/7] net: dsa: mv88e6xxx: Create helper for FIDs in use Andrew Lunn
2020-08-16 19:43 ` [PATCH net-next 5/7] net: dsa: mv88e6xxx: Add devlink regions Andrew Lunn
2020-08-16 22:12   ` Vladimir Oltean
2020-08-16 22:39     ` Andrew Lunn
2020-08-17 17:15       ` Florian Fainelli
2020-08-17 19:02         ` Andrew Lunn
2020-08-16 19:43 ` [PATCH net-next 6/7] net: dsa: wire up devlink info get Andrew Lunn
2020-08-16 21:56   ` Vladimir Oltean
2020-08-16 22:16     ` Andrew Lunn
2020-08-16 19:43 ` Andrew Lunn [this message]
2020-08-17 16:03   ` [PATCH net-next 7/7] net: dsa: mv88e6xxx: Implement devlink info get callback Jakub Kicinski
2020-08-16 20:17 ` [PATCH net-next 0/7] net: dsa: mv88e6xxx: Add devlink regions support Chris Healy
2020-08-17 17:08 ` Florian Fainelli
2020-08-17 19:08   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200816194316.2291489-8-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).