aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/dsa/mv88e6xxx/ptp.h
diff options
context:
space:
mode:
authorBrandon Streiff <brandon.streiff@ni.com>2018-02-14 01:07:50 +0100
committerDavid S. Miller <davem@davemloft.net>2018-02-14 14:33:37 -0500
commitc6fe0ad2c3499cca7c7b3be83958e6f7e961f567 (patch)
treec5a3dabef1ae524a28c919c913151cea97ae2825 /drivers/net/dsa/mv88e6xxx/ptp.h
parent90af1059c52c0031f3bfd8279c9ede153ca83275 (diff)
net: dsa: mv88e6xxx: add rx/tx timestamping support
This patch implements RX/TX timestamping support. The Marvell PTP hardware supports RX timestamping individual message types, but for simplicity we only support the EVENT receive filter since few if any clients bother with the more specific filter types. checkpatch and reverse Christmas tree changes by Andrew Lunn. Re-factor duplicated code paths and avoid IfOk anti-pattern, use the common ptp worker thread from the class layer and time stamp UDP/IPv4 frames as well as Layer-2 frame by Richard Cochran. Signed-off-by: Brandon Streiff <brandon.streiff@ni.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/ptp.h')
-rw-r--r--drivers/net/dsa/mv88e6xxx/ptp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/ptp.h b/drivers/net/dsa/mv88e6xxx/ptp.h
index 21c93d278b09..992818ade746 100644
--- a/drivers/net/dsa/mv88e6xxx/ptp.h
+++ b/drivers/net/dsa/mv88e6xxx/ptp.h
@@ -80,11 +80,20 @@
#ifdef CONFIG_NET_DSA_MV88E6XXX_PTP
+long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp);
int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip);
void mv88e6xxx_ptp_free(struct mv88e6xxx_chip *chip);
+#define ptp_to_chip(ptp) container_of(ptp, struct mv88e6xxx_chip, \
+ ptp_clock_info)
+
#else /* !CONFIG_NET_DSA_MV88E6XXX_PTP */
+static long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp)
+{
+ return -1;
+}
+
static inline int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip)
{
return 0;