Add flexible wake filter support to ethtool-6
Subsystems (2)
PATCH 3/3 Add flexible wake filter support to ethtool-6
Add support for Wake-on-Lan flexible filters to ethtool.To set a filter:
$ ethtool -F ethx <filter num> <filter spec> where <filter spec> is a string of hex digits (or xx for ignore) describing bytes from the beginning of the expected packet. For example: $ ethtool -F eth0 0 00a055667788xxxx449976xx32
To show a filter:
$ ethtool -f ethx <filter num>
Signed-off-by Mitch Williams <[email protected]>
ethtool-copy.h +14 -0
@@ -55,6 +55,16 @@ struct ethtool_wolinfo {__u8 sopass[SOPASS_MAX ];/* SecureOn(tm) password */ }; +#define WOL_FILTER_MAX_LEN 256 +#define WOL_FILTER_IGNORE_OCTET 0x100 +/* wake-on-lan flexible filters */ +struct ethtool_wol_filter { +u32 cmd; +u32 index; +u32 len; +u16 mask_val[0 ]; +}; +/* for passing single values */ struct ethtool_value {__u32 cmd;
@@ -414,6 +424,9 @@ struct ethtool_ops {#define ETHTOOL_SUFO 0x00000022/* Set UFO enable (ethtool_value) */ #define ETHTOOL_GGSO 0x00000023/* Get GSO enable (ethtool_value) */ #define ETHTOOL_SGSO 0x00000024/* Set GSO enable (ethtool_value) */ +#define ETHTOOL_GNUMWOLFILT 0x00000029 +#define ETHTOOL_GWOLFILTER 0x0000002a/* Get WOL flex filter */ +#define ETHTOOL_SWOLFILTER 0x0000002b/* Set WOL flex filter */ /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET
@@ -500,5 +513,6 @@ struct ethtool_ops {#define WAKE_ARP (1 << 4)#define WAKE_MAGIC (1 << 5)#define WAKE_MAGICSECURE (1 << 6)/* only meaningful if WAKE_MAGIC */ +#define WAKE_FILTER (1 << 7)#endif /* _LINUX_ETHTOOL_H */
ethtool.c +164 -0
242 lines not on this page · raw message