summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx/ptp.c
diff options
context:
space:
mode:
authorBrandon Streiff2018-02-14 01:07:50 +0100
committerDavid S. Miller2018-02-14 20:33:37 +0100
commitc6fe0ad2c3499cca7c7b3be83958e6f7e961f567 (patch)
treec5a3dabef1ae524a28c919c913151cea97ae2825 /drivers/net/dsa/mv88e6xxx/ptp.c
parentnet: dsa: forward timestamping callbacks to switch drivers (diff)
downloadkernel-qcow2-linux-c6fe0ad2c3499cca7c7b3be83958e6f7e961f567.tar.gz
kernel-qcow2-linux-c6fe0ad2c3499cca7c7b3be83958e6f7e961f567.tar.xz
kernel-qcow2-linux-c6fe0ad2c3499cca7c7b3be83958e6f7e961f567.zip
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.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx/ptp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c
index 92885e715e85..bd85e2c390e1 100644
--- a/drivers/net/dsa/mv88e6xxx/ptp.c
+++ b/drivers/net/dsa/mv88e6xxx/ptp.c
@@ -27,8 +27,6 @@
#define TAI_EVENT_WORK_INTERVAL msecs_to_jiffies(100)
#define cc_to_chip(cc) container_of(cc, struct mv88e6xxx_chip, tstamp_cc)
-#define ptp_to_chip(ptp) container_of(ptp, struct mv88e6xxx_chip, \
- ptp_clock_info)
#define dw_overflow_to_chip(dw) container_of(dw, struct mv88e6xxx_chip, \
overflow_work)
#define dw_tai_event_to_chip(dw) container_of(dw, struct mv88e6xxx_chip, \
@@ -359,6 +357,7 @@ int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip)
chip->ptp_clock_info.settime64 = mv88e6xxx_ptp_settime;
chip->ptp_clock_info.enable = mv88e6xxx_ptp_enable;
chip->ptp_clock_info.verify = mv88e6xxx_ptp_verify;
+ chip->ptp_clock_info.do_aux_work = mv88e6xxx_hwtstamp_work;
chip->ptp_clock = ptp_clock_register(&chip->ptp_clock_info, chip->dev);
if (IS_ERR(chip->ptp_clock))