summaryrefslogtreecommitdiff
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-03-28 13:56:37 +0100
committerDavid S. Miller <davem@davemloft.net>2019-03-28 12:55:30 -0700
commitaf3836df9a59e7339d60c9c46729a7d9094d0582 (patch)
tree739ad2a6a871e9ca4fc7bf814b5659f5d82343d8 /include/net/devlink.h
parent5dc37bb9b03586e8fdeb47d25e8d2a0399984936 (diff)
net: devlink: introduce devlink_compat_phys_port_name_get()
Introduce devlink_compat_phys_port_name_get() helper that gets the physical port name for specified netdevice according to devlink port attributes. Call this helper from dev_get_phys_port_name() in case ndo_get_phys_port_name is not defined. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 81b5ed04a341..85e577d6ec3b 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -739,6 +739,8 @@ devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
void devlink_compat_running_version(struct net_device *dev,
char *buf, size_t len);
int devlink_compat_flash_update(struct net_device *dev, const char *file_name);
+int devlink_compat_phys_port_name_get(struct net_device *dev,
+ char *name, size_t len);
#else
@@ -753,6 +755,13 @@ devlink_compat_flash_update(struct net_device *dev, const char *file_name)
return -EOPNOTSUPP;
}
+static inline int
+devlink_compat_phys_port_name_get(struct net_device *dev,
+ char *name, size_t len)
+{
+ return -EOPNOTSUPP;
+}
+
#endif
#endif /* _NET_DEVLINK_H_ */