]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: Correctly take timestamp for PTPv2
authorJose Abreu <Jose.Abreu@synopsys.com>
Mon, 30 Sep 2019 08:19:09 +0000 (10:19 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Dec 2019 15:57:54 +0000 (15:57 +0000)
commit 14f347334bf232074616e29e29103dd0c7c54dec upstream.

The case for PTPV2_EVENT requires event packets to be captured so add
this setting to the list of enabled captures.

Fixes: 891434b18ec0 ("stmmac: add IEEE PTPv1 and PTPv2 support.")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 93557ec619d7dbbc58b6f8b4e8a9f5c2ee72ea0c..60d78a8c141c3c64f4128c019e3ebd19f6018139 100644 (file)
@@ -539,6 +539,7 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
                        ptp_v2 = PTP_TCR_TSVER2ENA;
                        /* take time stamp for all event messages */
                        snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
+                       ts_event_en = PTP_TCR_TSEVNTENA;
 
                        ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
                        ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;