Add common request/reply header definition and helpers to parse request header and fill reply header. Provide ethnl_update_* helpers to update structure members from request attributes (to be used for *_SET requests).
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -29,6 +29,27 @@ enum { · 28 unmodified lines | ||
| 29 | 29 | ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1 |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | +/* request header */ | |
| 33 | + | |
| 34 | +/* use compact bitsets in reply */ | |
| 35 | +#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0) | |
| 36 | +/* provide optional reply for SET or ACT requests */ | |
| 37 | +#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1) | |
| 38 | + | |
| 39 | +#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \ | |
| 40 | + ETHTOOL_FLAG_OMIT_REPLY) | |
| 41 | + | |
| 42 | +enum { | |
| 43 | + ETHTOOL_A_HEADER_UNSPEC, | |
| 44 | + ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */ | |
| 45 | + ETHTOOL_A_HEADER_DEV_NAME, /* string */ | |
| 46 | + ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */ | |
| 47 | + | |
| 48 | + /* add new constants above here */ | |
| 49 | + __ETHTOOL_A_HEADER_CNT, | |
| 50 | + ETHTOOL_A_HEADER_MAX = __ETHTOOL_A_HEADER_CNT - 1 | |
| 51 | +}; | |
| 52 | + | |
| 32 | 53 | /* generic netlink info */ |
| 33 | 54 | #define ETHTOOL_GENL_NAME "ethtool" |
| 34 | 55 | #define ETHTOOL_GENL_VERSION 1 |