History

net: ethtool: Add a command to expose current time stamping layer

Time stamping on network packets may happen either in the MAC or in the PHY, but not both. In preparation for making the choice selectable, expose both the current layers via ethtool. In accordance with the kernel implementation as it stands, the current layer will always read as "phy" when a PHY time stamping device is present. Future patches will allow changing the current layer administratively.

Kory Maincent committed 3 years ago

Commit 11d55be1 parent acec05f8 files · +149 −1Browse files

Showing the changes to include/uapi (2 of 8 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/ethtool_netlink.h +14 −0
  2. include/uapi/linux/net_tstamp.h +10 −0
include/uapi/linux/ethtool_netlink.h+14−0
@@ -57,6 +57,7 @@ enum { · 56 unmodified lines
5757 ETHTOOL_MSG_PLCA_GET_STATUS,
5858 ETHTOOL_MSG_MM_GET,
5959 ETHTOOL_MSG_MM_SET,
60+ ETHTOOL_MSG_TS_GET,
6061
6162 /* add new constants above here */
6263 __ETHTOOL_MSG_USER_CNT,
@@ -109,6 +110,7 @@ enum { · 46 unmodified lines
109110 ETHTOOL_MSG_PLCA_NTF,
110111 ETHTOOL_MSG_MM_GET_REPLY,
111112 ETHTOOL_MSG_MM_NTF,
113+ ETHTOOL_MSG_TS_GET_REPLY,
112114
113115 /* add new constants above here */
114116 __ETHTOOL_MSG_KERNEL_CNT,
@@ -975,6 +977,18 @@ enum { · 860 unmodified lines
975977 ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
976978 };
977979
980+/* TS LAYER */
981+
982+enum {
983+ ETHTOOL_A_TS_UNSPEC,
984+ ETHTOOL_A_TS_HEADER, /* nest - _A_HEADER_* */
985+ ETHTOOL_A_TS_LAYER, /* u32 */
986+
987+ /* add new constants above here */
988+ __ETHTOOL_A_TS_CNT,
989+ ETHTOOL_A_TS_MAX = (__ETHTOOL_A_TS_CNT - 1)
990+};
991+
978992 /* generic netlink info */
979993 #define ETHTOOL_GENL_NAME "ethtool"
980994 #define ETHTOOL_GENL_VERSION 1
include/uapi/linux/net_tstamp.h+10−0
@@ -13,6 +13,16 @@ · 12 unmodified lines
1313 #include <linux/types.h>
1414 #include <linux/socket.h> /* for SO_TIMESTAMPING */
1515
16+/* Layer of the TIMESTAMPING provider */
17+enum timestamping_layer {
18+ NO_TIMESTAMPING,
19+ SOFTWARE_TIMESTAMPING,
20+ MAC_TIMESTAMPING,
21+ PHY_TIMESTAMPING,
22+
23+ __TIMESTAMPING_COUNT,
24+};
25+
1626 /* SO_TIMESTAMPING flags */
1727 enum {
1828 SOF_TIMESTAMPING_TX_HARDWARE = (1<<0),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t