diff options
author | Brandon Streiff <brandon.streiff@ni.com> | 2018-02-14 01:07:50 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 14:33:37 -0500 |
commit | c6fe0ad2c3499cca7c7b3be83958e6f7e961f567 (patch) | |
tree | c5a3dabef1ae524a28c919c913151cea97ae2825 /drivers/net/dsa/mv88e6xxx/ptp.c | |
parent | 90af1059c52c0031f3bfd8279c9ede153ca83275 (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.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/ptp.c | 3 |
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)) |