History

ethtool: provide WoL settings with WOL_GET request

Implement WOL_GET request to get wake-on-lan settings for a device, traditionally available via ETHTOOL_GWOL ioctl request. As part of the implementation, provide symbolic names for wake-on-line modes as ETH_SS_WOL_MODES string set.

Michal Kubecek committed 6 years ago

Commit 51ea22b1 parent 0bda7af10 files · +176 −2Browse files

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

Unified · Split

2 files
  1. include/uapi/linux/ethtool.h +4 −0
  2. include/uapi/linux/ethtool_netlink.h +15 −0
include/uapi/linux/ethtool.h+4−0
@@ -595,6 +595,7 @@ struct ethtool_pauseparam { · 594 unmodified lines
595595 * @ETH_SS_PHY_TUNABLES: PHY tunable names
596596 * @ETH_SS_LINK_MODES: link mode names
597597 * @ETH_SS_MSG_CLASSES: debug message class names
598+ * @ETH_SS_WOL_MODES: wake-on-lan modes
598599 */
599600 enum ethtool_stringset {
600601 ETH_SS_TEST = 0,
@@ -608,6 +609,7 @@ enum ethtool_stringset { · 7 unmodified lines
608609 ETH_SS_PHY_TUNABLES,
609610 ETH_SS_LINK_MODES,
610611 ETH_SS_MSG_CLASSES,
612+ ETH_SS_WOL_MODES,
611613
612614 /* add new constants above here */
613615 ETH_SS_COUNT
@@ -1695,6 +1697,8 @@ static inline int ethtool_validate_duplex(__u8 duplex) · 1081 unmodified lines
16951697 #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
16961698 #define WAKE_FILTER (1 << 7)
16971699
1700+#define WOL_MODE_COUNT 8
1701+
16981702 /* L2-L4 network traffic flow types */
16991703 #define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
17001704 #define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
include/uapi/linux/ethtool_netlink.h+15−0
@@ -22,6 +22,7 @@ enum { · 21 unmodified lines
2222 ETHTOOL_MSG_LINKSTATE_GET,
2323 ETHTOOL_MSG_DEBUG_GET,
2424 ETHTOOL_MSG_DEBUG_SET,
25+ ETHTOOL_MSG_WOL_GET,
2526
2627 /* add new constants above here */
2728 __ETHTOOL_MSG_USER_CNT,
@@ -39,6 +40,7 @@ enum { · 11 unmodified lines
3940 ETHTOOL_MSG_LINKSTATE_GET_REPLY,
4041 ETHTOOL_MSG_DEBUG_GET_REPLY,
4142 ETHTOOL_MSG_DEBUG_NTF,
43+ ETHTOOL_MSG_WOL_GET_REPLY,
4244
4345 /* add new constants above here */
4446 __ETHTOOL_MSG_KERNEL_CNT,
@@ -211,6 +213,19 @@ enum { · 166 unmodified lines
211213 ETHTOOL_A_DEBUG_MAX = __ETHTOOL_A_DEBUG_CNT - 1
212214 };
213215
216+/* WOL */
217+
218+enum {
219+ ETHTOOL_A_WOL_UNSPEC,
220+ ETHTOOL_A_WOL_HEADER, /* nest - _A_HEADER_* */
221+ ETHTOOL_A_WOL_MODES, /* bitset */
222+ ETHTOOL_A_WOL_SOPASS, /* binary */
223+
224+ /* add new constants above here */
225+ __ETHTOOL_A_WOL_CNT,
226+ ETHTOOL_A_WOL_MAX = __ETHTOOL_A_WOL_CNT - 1
227+};
228+
214229 /* generic netlink info */
215230 #define ETHTOOL_GENL_NAME "ethtool"
216231 #define ETHTOOL_GENL_VERSION 1