net: define receive timestamp filter for NTP
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 19 May 2017 15:52:35 +0000 (17:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 May 2017 17:37:32 +0000 (13:37 -0400)
Add HWTSTAMP_FILTER_NTP_ALL to the hwtstamp_rx_filters enum for
timestamping of NTP packets. There is currently only one driver
(phyter) that could support it directly.

CC: Richard Cochran <richardcochran@gmail.com>
CC: Willem de Bruijn <willemb@google.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/net_tstamp.h
net/core/dev_ioctl.c

index 464dcca5ed68304bac7c80ab5fd62192d81b3970..0749fb13e5171083e3b7beb20228b682f136fa1c 100644 (file)
@@ -125,6 +125,9 @@ enum hwtstamp_rx_filters {
        HWTSTAMP_FILTER_PTP_V2_SYNC,
        /* PTP v2/802.AS1, any layer, Delay_req packet */
        HWTSTAMP_FILTER_PTP_V2_DELAY_REQ,
+
+       /* NTP, UDP, all versions and packet modes */
+       HWTSTAMP_FILTER_NTP_ALL,
 };
 
 #endif /* _NET_TIMESTAMPING_H */
index b94b1d29350603e19c3db8e6fd740d3f89440771..8f036a76b92ef626c185ea203b733a5712b000bb 100644 (file)
@@ -227,6 +227,8 @@ static int net_hwtstamp_validate(struct ifreq *ifr)
        case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
                rx_filter_valid = 1;
                break;
+       case HWTSTAMP_FILTER_NTP_ALL:
+               break;
        }
 
        if (!tx_type_valid || !rx_filter_valid)