aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-01-31 10:50:47 -0800
committerDavid S. Miller <davem@davemloft.net>2019-02-01 15:30:31 -0800
commitddb6e99e2db14d4b3c22a0dbddc6a09234856bb7 (patch)
tree1195e6f3629b6a30cd3ee4716e8de2a08a5a4c73 /include/net
parentnfp: devlink: report the running and flashed versions (diff)
downloadlinux-dev-ddb6e99e2db14d4b3c22a0dbddc6a09234856bb7.tar.xz
linux-dev-ddb6e99e2db14d4b3c22a0dbddc6a09234856bb7.zip
ethtool: add compat for devlink info
If driver did not fill the fw_version field, try to call into the new devlink get_info op and collect the versions that way. We assume ethtool was always reporting running versions. v4: - use IS_REACHABLE() to avoid problems with DEVLINK=m (kbuildbot). v3 (Jiri): - do a dump and then parse it instead of special handling; - concatenate all versions (well, all that fit :)). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/devlink.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 6b417f141fd6..1c8523920f66 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -972,4 +972,14 @@ devlink_info_version_running_put(struct devlink_info_req *req,
}
#endif
+#if IS_REACHABLE(CONFIG_NET_DEVLINK)
+void devlink_compat_running_version(struct net_device *dev,
+ char *buf, size_t len);
+#else
+static inline void
+devlink_compat_running_version(struct net_device *dev, char *buf, size_t len)
+{
+}
+#endif
+
#endif /* _NET_DEVLINK_H_ */