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.
Showing the changes to include/uapi/linux (2 of 10 files). Show all
Unified · Split
| @@ -595,6 +595,7 @@ struct ethtool_pauseparam { · 594 unmodified lines | ||
| 595 | 595 | * @ETH_SS_PHY_TUNABLES: PHY tunable names |
| 596 | 596 | * @ETH_SS_LINK_MODES: link mode names |
| 597 | 597 | * @ETH_SS_MSG_CLASSES: debug message class names |
| 598 | + * @ETH_SS_WOL_MODES: wake-on-lan modes | |
| 598 | 599 | */ |
| 599 | 600 | enum ethtool_stringset { |
| 600 | 601 | ETH_SS_TEST = 0, |
| @@ -608,6 +609,7 @@ enum ethtool_stringset { · 7 unmodified lines | ||
| 608 | 609 | ETH_SS_PHY_TUNABLES, |
| 609 | 610 | ETH_SS_LINK_MODES, |
| 610 | 611 | ETH_SS_MSG_CLASSES, |
| 612 | + ETH_SS_WOL_MODES, | |
| 611 | 613 | |
| 612 | 614 | /* add new constants above here */ |
| 613 | 615 | ETH_SS_COUNT |
| @@ -1695,6 +1697,8 @@ static inline int ethtool_validate_duplex(__u8 duplex) · 1081 unmodified lines | ||
| 1695 | 1697 | #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ |
| 1696 | 1698 | #define WAKE_FILTER (1 << 7) |
| 1697 | 1699 | |
| 1700 | +#define WOL_MODE_COUNT 8 | |
| 1701 | + | |
| 1698 | 1702 | /* L2-L4 network traffic flow types */ |
| 1699 | 1703 | #define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */ |
| 1700 | 1704 | #define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */ |
| @@ -22,6 +22,7 @@ enum { · 21 unmodified lines | ||
| 22 | 22 | ETHTOOL_MSG_LINKSTATE_GET, |
| 23 | 23 | ETHTOOL_MSG_DEBUG_GET, |
| 24 | 24 | ETHTOOL_MSG_DEBUG_SET, |
| 25 | + ETHTOOL_MSG_WOL_GET, | |
| 25 | 26 | |
| 26 | 27 | /* add new constants above here */ |
| 27 | 28 | __ETHTOOL_MSG_USER_CNT, |
| @@ -39,6 +40,7 @@ enum { · 11 unmodified lines | ||
| 39 | 40 | ETHTOOL_MSG_LINKSTATE_GET_REPLY, |
| 40 | 41 | ETHTOOL_MSG_DEBUG_GET_REPLY, |
| 41 | 42 | ETHTOOL_MSG_DEBUG_NTF, |
| 43 | + ETHTOOL_MSG_WOL_GET_REPLY, | |
| 42 | 44 | |
| 43 | 45 | /* add new constants above here */ |
| 44 | 46 | __ETHTOOL_MSG_KERNEL_CNT, |
| @@ -211,6 +213,19 @@ enum { · 166 unmodified lines | ||
| 211 | 213 | ETHTOOL_A_DEBUG_MAX = __ETHTOOL_A_DEBUG_CNT - 1 |
| 212 | 214 | }; |
| 213 | 215 | |
| 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 | + | |
| 214 | 229 | /* generic netlink info */ |
| 215 | 230 | #define ETHTOOL_GENL_NAME "ethtool" |
| 216 | 231 | #define ETHTOOL_GENL_VERSION 1 |