Blame SOURCES/0006-net_tstamp.h-sync-with-net-next.patch

3397d6
From 13e8c7b8c8537488bc7612c11c429cec274db1f9 Mon Sep 17 00:00:00 2001
3397d6
From: Miroslav Lichvar <mlichvar@redhat.com>
3397d6
Date: Tue, 23 May 2017 16:29:29 +0200
3397d6
Subject: [PATCH 6/7] net_tstamp.h: sync with net-next
3397d6
3397d6
This covers kernel changes up to:
3397d6
3397d6
commit b50a5c70ffa4fd6b6da324ab54c84adf48fb17d9
3397d6
Author: Miroslav Lichvar <mlichvar@redhat.com>
3397d6
Date:   Fri May 19 17:52:40 2017 +0200
3397d6
3397d6
    net: allow simultaneous SW and HW transmit timestamping
3397d6
3397d6
    Add SOF_TIMESTAMPING_OPT_TX_SWHW option to allow an outgoing packet to
3397d6
    be looped to the socket's error queue with a software timestamp even
3397d6
    when a hardware transmit timestamp is expected to be provided by the
3397d6
    driver.
3397d6
3397d6
    Applications using this option will receive two separate messages from
3397d6
    the error queue, one with a software timestamp and the other with a
3397d6
    hardware timestamp. As the hardware timestamp is saved to the shared skb
3397d6
    info, which may happen before the first message with software timestamp
3397d6
    is received by the application, the hardware timestamp is copied to the
3397d6
    SCM_TIMESTAMPING control message only when the skb has no software
3397d6
    timestamp or it is an incoming packet.
3397d6
3397d6
    While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as
3397d6
    there are no other users.
3397d6
3397d6
    CC: Richard Cochran <richardcochran@gmail.com>
3397d6
    CC: Willem de Bruijn <willemb@google.com>
3397d6
    Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
3397d6
    Acked-by: Willem de Bruijn <willemb@google.com>
3397d6
    Signed-off-by: David S. Miller <davem@davemloft.net>
3397d6
3397d6
CC: Richard Cochran <richardcochran@gmail.com>
3397d6
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
3397d6
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3397d6
(cherry picked from commit ba800e3b4acd0692fc16013acbab2c3ac1ecfe66)
3397d6
---
3397d6
 net_tstamp-copy.h | 52 +++++++++++++++++++++++++++++++++++++++++-----------
3397d6
 1 file changed, 41 insertions(+), 11 deletions(-)
3397d6
3397d6
diff --git a/net_tstamp-copy.h b/net_tstamp-copy.h
3397d6
index ae5df12..3d421d9 100644
3397d6
--- a/net_tstamp-copy.h
3397d6
+++ b/net_tstamp-copy.h
3397d6
@@ -9,6 +9,7 @@
3397d6
 #ifndef _NET_TIMESTAMPING_H
3397d6
 #define _NET_TIMESTAMPING_H
3397d6
 
3397d6
+#include <linux/types.h>
3397d6
 #include <linux/socket.h>   /* for SO_TIMESTAMPING */
3397d6
 
3397d6
 /* SO_TIMESTAMPING gets an integer bit field comprised of these values */
3397d6
@@ -20,23 +21,42 @@ enum {
3397d6
 	SOF_TIMESTAMPING_SOFTWARE = (1<<4),
3397d6
 	SOF_TIMESTAMPING_SYS_HARDWARE = (1<<5),
3397d6
 	SOF_TIMESTAMPING_RAW_HARDWARE = (1<<6),
3397d6
-	SOF_TIMESTAMPING_MASK =
3397d6
-	(SOF_TIMESTAMPING_RAW_HARDWARE - 1) |
3397d6
-	SOF_TIMESTAMPING_RAW_HARDWARE
3397d6
+	SOF_TIMESTAMPING_OPT_ID = (1<<7),
3397d6
+	SOF_TIMESTAMPING_TX_SCHED = (1<<8),
3397d6
+	SOF_TIMESTAMPING_TX_ACK = (1<<9),
3397d6
+	SOF_TIMESTAMPING_OPT_CMSG = (1<<10),
3397d6
+	SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),
3397d6
+	SOF_TIMESTAMPING_OPT_STATS = (1<<12),
3397d6
+	SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),
3397d6
+	SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),
3397d6
+
3397d6
+	SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TX_SWHW,
3397d6
+	SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
3397d6
+				 SOF_TIMESTAMPING_LAST
3397d6
 };
3397d6
 
3397d6
+/*
3397d6
+ * SO_TIMESTAMPING flags are either for recording a packet timestamp or for
3397d6
+ * reporting the timestamp to user space.
3397d6
+ * Recording flags can be set both via socket options and control messages.
3397d6
+ */
3397d6
+#define SOF_TIMESTAMPING_TX_RECORD_MASK	(SOF_TIMESTAMPING_TX_HARDWARE | \
3397d6
+					 SOF_TIMESTAMPING_TX_SOFTWARE | \
3397d6
+					 SOF_TIMESTAMPING_TX_SCHED | \
3397d6
+					 SOF_TIMESTAMPING_TX_ACK)
3397d6
+
3397d6
 /**
3397d6
- * struct hwtstamp_config - %SIOCSHWTSTAMP parameter
3397d6
+ * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
3397d6
  *
3397d6
- * @flags:	no flags defined right now, must be zero
3397d6
+ * @flags:	no flags defined right now, must be zero for %SIOCSHWTSTAMP
3397d6
  * @tx_type:	one of HWTSTAMP_TX_*
3397d6
- * @rx_type:	one of one of HWTSTAMP_FILTER_*
3397d6
+ * @rx_filter:	one of HWTSTAMP_FILTER_*
3397d6
  *
3397d6
- * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to
3397d6
- * this structure. dev_ifsioc() in the kernel takes care of the
3397d6
- * translation between 32 bit userspace and 64 bit kernel. The
3397d6
- * structure is intentionally chosen so that it has the same layout on
3397d6
- * 32 and 64 bit systems, don't break this!
3397d6
+ * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a
3397d6
+ * ifr_data pointer to this structure.  For %SIOCSHWTSTAMP, if the
3397d6
+ * driver or hardware does not support the requested @rx_filter value,
3397d6
+ * the driver may use a more general filter mode.  In this case
3397d6
+ * @rx_filter will indicate the actual mode on return.
3397d6
  */
3397d6
 struct hwtstamp_config {
3397d6
 	int flags;
3397d6
@@ -108,6 +128,16 @@ enum hwtstamp_rx_filters {
3397d6
 	HWTSTAMP_FILTER_PTP_V2_SYNC,
3397d6
 	/* PTP v2/802.AS1, any layer, Delay_req packet */
3397d6
 	HWTSTAMP_FILTER_PTP_V2_DELAY_REQ,
3397d6
+
3397d6
+	/* NTP, UDP, all versions and packet modes */
3397d6
+	HWTSTAMP_FILTER_NTP_ALL,
3397d6
+};
3397d6
+
3397d6
+/* SCM_TIMESTAMPING_PKTINFO control message */
3397d6
+struct scm_ts_pktinfo {
3397d6
+	__u32 if_index;
3397d6
+	__u32 pkt_length;
3397d6
+	__u32 reserved[2];
3397d6
 };
3397d6
 
3397d6
 #endif /* _NET_TIMESTAMPING_H */
3397d6
-- 
3397d6
1.8.3.1
3397d6