summaryrefslogtreecommitdiff
path: root/net/dsa/port.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-11-20 17:29:39 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-11-20 17:29:39 +0300
commitb3c39b1a96a67a7e246d562f44d04ce6f9ef878f (patch)
tree6874debfde448db313bd7c53c3aca59687038c1f /net/dsa/port.c
parent63a3bf5e8d9e79ce456c8f73d4395a5a51d841b1 (diff)
parent77c51ba552a1c4f73228766e43ae37c4101b3758 (diff)
downloadlinux-b3c39b1a96a67a7e246d562f44d04ce6f9ef878f.tar.xz
Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes and check if libraries used that comes from other trees continue to work with tools/perf, such as tools/lib/bpf. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'net/dsa/port.c')
-rw-r--r--net/dsa/port.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 208168276995..750fe68d9b2a 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -110,6 +110,22 @@ static bool dsa_port_can_configure_learning(struct dsa_port *dp)
return !err;
}
+bool dsa_port_supports_hwtstamp(struct dsa_port *dp, struct ifreq *ifr)
+{
+ struct dsa_switch *ds = dp->ds;
+ int err;
+
+ if (!ds->ops->port_hwtstamp_get || !ds->ops->port_hwtstamp_set)
+ return false;
+
+ /* "See through" shim implementations of the "get" method.
+ * This will clobber the ifreq structure, but we will either return an
+ * error, or the master will overwrite it with proper values.
+ */
+ err = ds->ops->port_hwtstamp_get(ds, dp->index, ifr);
+ return err != -EOPNOTSUPP;
+}
+
int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age)
{
struct dsa_switch *ds = dp->ds;