aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx/hwtstamp.c
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2021-04-27 12:21:58 +0800
committerDavid S. Miller <davem@davemloft.net>2021-04-27 14:10:15 -0700
commitcf536ea3c7eefb26082836eb7f930b293dd38345 (patch)
tree6490772a48679661cafbb8084661d456a8a1219b /drivers/net/dsa/mv88e6xxx/hwtstamp.c
parentnet: dsa: check tx timestamp request in core driver (diff)
downloadlinux-dev-cf536ea3c7eefb26082836eb7f930b293dd38345.tar.xz
linux-dev-cf536ea3c7eefb26082836eb7f930b293dd38345.zip
net: dsa: no longer identify PTP packet in core driver
Move ptp_classify_raw out of dsa core driver for handling tx timestamp request. Let device drivers do this if they want. Not all drivers want to limit tx timestamping for only PTP packet. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Tested-by: Kurt Kanzenbach <kurt@linutronix.de> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/hwtstamp.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx/hwtstamp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/hwtstamp.c b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
index 05ca1d3c6498..79514a54d903 100644
--- a/drivers/net/dsa/mv88e6xxx/hwtstamp.c
+++ b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
@@ -469,11 +469,16 @@ long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp)
}
bool mv88e6xxx_port_txtstamp(struct dsa_switch *ds, int port,
- struct sk_buff *clone, unsigned int type)
+ struct sk_buff *clone)
{
struct mv88e6xxx_chip *chip = ds->priv;
struct mv88e6xxx_port_hwtstamp *ps = &chip->port_hwtstamp[port];
struct ptp_header *hdr;
+ unsigned int type;
+
+ type = ptp_classify_raw(clone);
+ if (type == PTP_CLASS_NONE)
+ return false;
hdr = mv88e6xxx_should_tstamp(chip, port, clone, type);
if (!hdr)