
Requests a contents of one or more string sets, i.e. indexed arrays of strings; this information is provided by ETHTOOL_GSSET_INFO and ETHTOOL_GSTRINGS commands of ioctl interface. Unlike ioctl interface, all information can be retrieved with one request and mulitple string sets can be requested at once. There are three types of requests: - no NLM_F_DUMP, no device: get "global" stringsets - no NLM_F_DUMP, with device: get string sets related to the device - NLM_F_DUMP, no device: get device related string sets for all devices Client can request either all string sets of given type (global or device related) or only specific sets. With ETHTOOL_A_STRSET_COUNTS flag set, only set sizes (numbers of strings) are returned. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
151 lines
3.7 KiB
C
151 lines
3.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
|
/*
|
|
* include/uapi/linux/ethtool_netlink.h - netlink interface for ethtool
|
|
*
|
|
* See Documentation/networking/ethtool-netlink.txt in kernel source tree for
|
|
* doucumentation of the interface.
|
|
*/
|
|
|
|
#ifndef _UAPI_LINUX_ETHTOOL_NETLINK_H_
|
|
#define _UAPI_LINUX_ETHTOOL_NETLINK_H_
|
|
|
|
#include <linux/ethtool.h>
|
|
|
|
/* message types - userspace to kernel */
|
|
enum {
|
|
ETHTOOL_MSG_USER_NONE,
|
|
ETHTOOL_MSG_STRSET_GET,
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_MSG_USER_CNT,
|
|
ETHTOOL_MSG_USER_MAX = __ETHTOOL_MSG_USER_CNT - 1
|
|
};
|
|
|
|
/* message types - kernel to userspace */
|
|
enum {
|
|
ETHTOOL_MSG_KERNEL_NONE,
|
|
ETHTOOL_MSG_STRSET_GET_REPLY,
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_MSG_KERNEL_CNT,
|
|
ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1
|
|
};
|
|
|
|
/* request header */
|
|
|
|
/* use compact bitsets in reply */
|
|
#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0)
|
|
/* provide optional reply for SET or ACT requests */
|
|
#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1)
|
|
|
|
#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
|
|
ETHTOOL_FLAG_OMIT_REPLY)
|
|
|
|
enum {
|
|
ETHTOOL_A_HEADER_UNSPEC,
|
|
ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */
|
|
ETHTOOL_A_HEADER_DEV_NAME, /* string */
|
|
ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_HEADER_CNT,
|
|
ETHTOOL_A_HEADER_MAX = __ETHTOOL_A_HEADER_CNT - 1
|
|
};
|
|
|
|
/* bit sets */
|
|
|
|
enum {
|
|
ETHTOOL_A_BITSET_BIT_UNSPEC,
|
|
ETHTOOL_A_BITSET_BIT_INDEX, /* u32 */
|
|
ETHTOOL_A_BITSET_BIT_NAME, /* string */
|
|
ETHTOOL_A_BITSET_BIT_VALUE, /* flag */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_BITSET_BIT_CNT,
|
|
ETHTOOL_A_BITSET_BIT_MAX = __ETHTOOL_A_BITSET_BIT_CNT - 1
|
|
};
|
|
|
|
enum {
|
|
ETHTOOL_A_BITSET_BITS_UNSPEC,
|
|
ETHTOOL_A_BITSET_BITS_BIT, /* nest - _A_BITSET_BIT_* */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_BITSET_BITS_CNT,
|
|
ETHTOOL_A_BITSET_BITS_MAX = __ETHTOOL_A_BITSET_BITS_CNT - 1
|
|
};
|
|
|
|
enum {
|
|
ETHTOOL_A_BITSET_UNSPEC,
|
|
ETHTOOL_A_BITSET_NOMASK, /* flag */
|
|
ETHTOOL_A_BITSET_SIZE, /* u32 */
|
|
ETHTOOL_A_BITSET_BITS, /* nest - _A_BITSET_BITS_* */
|
|
ETHTOOL_A_BITSET_VALUE, /* binary */
|
|
ETHTOOL_A_BITSET_MASK, /* binary */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_BITSET_CNT,
|
|
ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 1
|
|
};
|
|
|
|
/* string sets */
|
|
|
|
enum {
|
|
ETHTOOL_A_STRING_UNSPEC,
|
|
ETHTOOL_A_STRING_INDEX, /* u32 */
|
|
ETHTOOL_A_STRING_VALUE, /* string */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_STRING_CNT,
|
|
ETHTOOL_A_STRING_MAX = __ETHTOOL_A_STRING_CNT - 1
|
|
};
|
|
|
|
enum {
|
|
ETHTOOL_A_STRINGS_UNSPEC,
|
|
ETHTOOL_A_STRINGS_STRING, /* nest - _A_STRINGS_* */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_STRINGS_CNT,
|
|
ETHTOOL_A_STRINGS_MAX = __ETHTOOL_A_STRINGS_CNT - 1
|
|
};
|
|
|
|
enum {
|
|
ETHTOOL_A_STRINGSET_UNSPEC,
|
|
ETHTOOL_A_STRINGSET_ID, /* u32 */
|
|
ETHTOOL_A_STRINGSET_COUNT, /* u32 */
|
|
ETHTOOL_A_STRINGSET_STRINGS, /* nest - _A_STRINGS_* */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_STRINGSET_CNT,
|
|
ETHTOOL_A_STRINGSET_MAX = __ETHTOOL_A_STRINGSET_CNT - 1
|
|
};
|
|
|
|
enum {
|
|
ETHTOOL_A_STRINGSETS_UNSPEC,
|
|
ETHTOOL_A_STRINGSETS_STRINGSET, /* nest - _A_STRINGSET_* */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_STRINGSETS_CNT,
|
|
ETHTOOL_A_STRINGSETS_MAX = __ETHTOOL_A_STRINGSETS_CNT - 1
|
|
};
|
|
|
|
/* STRSET */
|
|
|
|
enum {
|
|
ETHTOOL_A_STRSET_UNSPEC,
|
|
ETHTOOL_A_STRSET_HEADER, /* nest - _A_HEADER_* */
|
|
ETHTOOL_A_STRSET_STRINGSETS, /* nest - _A_STRINGSETS_* */
|
|
ETHTOOL_A_STRSET_COUNTS_ONLY, /* flag */
|
|
|
|
/* add new constants above here */
|
|
__ETHTOOL_A_STRSET_CNT,
|
|
ETHTOOL_A_STRSET_MAX = __ETHTOOL_A_STRSET_CNT - 1
|
|
};
|
|
|
|
/* generic netlink info */
|
|
#define ETHTOOL_GENL_NAME "ethtool"
|
|
#define ETHTOOL_GENL_VERSION 1
|
|
|
|
#define ETHTOOL_MCGRP_MONITOR_NAME "monitor"
|
|
|
|
#endif /* _UAPI_LINUX_ETHTOOL_NETLINK_H_ */
|