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.
Showing the changes to include/uapi (2 of 8 files). Show all
Unified · Split
| @@ -57,6 +57,7 @@ enum { · 56 unmodified lines | ||
| 57 | 57 | ETHTOOL_MSG_PLCA_GET_STATUS, |
| 58 | 58 | ETHTOOL_MSG_MM_GET, |
| 59 | 59 | ETHTOOL_MSG_MM_SET, |
| 60 | + ETHTOOL_MSG_TS_GET, | |
| 60 | 61 | |
| 61 | 62 | /* add new constants above here */ |
| 62 | 63 | __ETHTOOL_MSG_USER_CNT, |
| @@ -109,6 +110,7 @@ enum { · 46 unmodified lines | ||
| 109 | 110 | ETHTOOL_MSG_PLCA_NTF, |
| 110 | 111 | ETHTOOL_MSG_MM_GET_REPLY, |
| 111 | 112 | ETHTOOL_MSG_MM_NTF, |
| 113 | + ETHTOOL_MSG_TS_GET_REPLY, | |
| 112 | 114 | |
| 113 | 115 | /* add new constants above here */ |
| 114 | 116 | __ETHTOOL_MSG_KERNEL_CNT, |
| @@ -975,6 +977,18 @@ enum { · 860 unmodified lines | ||
| 975 | 977 | ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1) |
| 976 | 978 | }; |
| 977 | 979 | |
| 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 | + | |
| 978 | 992 | /* generic netlink info */ |
| 979 | 993 | #define ETHTOOL_GENL_NAME "ethtool" |
| 980 | 994 | #define ETHTOOL_GENL_VERSION 1 |
| @@ -13,6 +13,16 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <linux/types.h> |
| 14 | 14 | #include <linux/socket.h> /* for SO_TIMESTAMPING */ |
| 15 | 15 | |
| 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 | + | |
| 16 | 26 | /* SO_TIMESTAMPING flags */ |
| 17 | 27 | enum { |
| 18 | 28 | SOF_TIMESTAMPING_TX_HARDWARE = (1<<0), |