diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-11-20 17:29:39 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-11-20 17:29:39 +0300 |
commit | b3c39b1a96a67a7e246d562f44d04ce6f9ef878f (patch) | |
tree | 6874debfde448db313bd7c53c3aca59687038c1f /net/dsa/port.c | |
parent | 63a3bf5e8d9e79ce456c8f73d4395a5a51d841b1 (diff) | |
parent | 77c51ba552a1c4f73228766e43ae37c4101b3758 (diff) | |
download | linux-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.c | 16 |
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; |