History

ethtool: provide link state with LINKSTATE_GET request

Implement LINKSTATE_GET netlink request to get link state information. At the moment, only link up flag as provided by ETHTOOL_GLINK ioctl command is returned. LINKSTATE_GET request can be used with NLM_F_DUMP (without device identification) to request the information for all devices in current network namespace providing the data.

Michal Kubecek committed 6 years ago

Commit 3d2b8471 parent 1b1b1849 files · +146 −6Browse files

Showing the changes to include/uapi/linux (1 of 9 files). Show all

Unified · Split

include/uapi/linux/ethtool_netlink.h+14−0
@@ -19,6 +19,7 @@ enum { · 18 unmodified lines
1919 ETHTOOL_MSG_LINKINFO_SET,
2020 ETHTOOL_MSG_LINKMODES_GET,
2121 ETHTOOL_MSG_LINKMODES_SET,
22+ ETHTOOL_MSG_LINKSTATE_GET,
2223
2324 /* add new constants above here */
2425 __ETHTOOL_MSG_USER_CNT,
@@ -33,6 +34,7 @@ enum { · 8 unmodified lines
3334 ETHTOOL_MSG_LINKINFO_NTF,
3435 ETHTOOL_MSG_LINKMODES_GET_REPLY,
3536 ETHTOOL_MSG_LINKMODES_NTF,
37+ ETHTOOL_MSG_LINKSTATE_GET_REPLY,
3638
3739 /* add new constants above here */
3840 __ETHTOOL_MSG_KERNEL_CNT,
@@ -181,6 +183,18 @@ enum { · 142 unmodified lines
181183 ETHTOOL_A_LINKMODES_MAX = __ETHTOOL_A_LINKMODES_CNT - 1
182184 };
183185
186+/* LINKSTATE */
187+
188+enum {
189+ ETHTOOL_A_LINKSTATE_UNSPEC,
190+ ETHTOOL_A_LINKSTATE_HEADER, /* nest - _A_HEADER_* */
191+ ETHTOOL_A_LINKSTATE_LINK, /* u8 */
192+
193+ /* add new constants above here */
194+ __ETHTOOL_A_LINKSTATE_CNT,
195+ ETHTOOL_A_LINKSTATE_MAX = __ETHTOOL_A_LINKSTATE_CNT - 1
196+};
197+
184198 /* generic netlink info */
185199 #define ETHTOOL_GENL_NAME "ethtool"
186200 #define ETHTOOL_GENL_VERSION 1