Move Some helpers for building ethtool netlink messages into public locations so drivers can make use of them.
Signed-off-by: Andrew Lunn <and...@lunn.ch> --- include/linux/ethtool_netlink.h | 11 +++++++++++ net/ethtool/netlink.h | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/linux/ethtool_netlink.h b/include/linux/ethtool_netlink.h index 288e90f4dbb9..7d98592cd8a1 100644 --- a/include/linux/ethtool_netlink.h +++ b/include/linux/ethtool_netlink.h @@ -6,6 +6,7 @@ #include <uapi/linux/ethtool_netlink.h> #include <linux/ethtool.h> #include <linux/netdevice.h> +#include <net/netlink.h> #define __ETHTOOL_LINK_MODE_MASK_NWORDS \ DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32) @@ -20,4 +21,14 @@ struct ethtool_rxflow_notification_info { u32 flow_type; }; +static inline struct nlattr *ethnl_nest_start(struct sk_buff *skb, + int attrtype) +{ + return nla_nest_start(skb, attrtype | NLA_F_NESTED); +} + +int ethnl_fill_dev(struct sk_buff *msg, struct net_device *dev, u16 attrtype); +void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd); +int ethnl_multicast(struct sk_buff *skb, struct net_device *dev); + #endif /* _LINUX_ETHTOOL_NETLINK_H_ */ diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index 4e7b40a8401d..d54fe7b6dac2 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h @@ -20,13 +20,10 @@ extern const char *const link_mode_names[]; extern const char *const reset_flag_names[]; struct net_device *ethnl_dev_get(struct genl_info *info, struct nlattr *nest); -int ethnl_fill_dev(struct sk_buff *msg, struct net_device *dev, u16 attrtype); struct sk_buff *ethnl_reply_init(size_t payload, struct net_device *dev, u8 cmd, u16 dev_attrtype, struct genl_info *info, void **ehdrp); -void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd); -int ethnl_multicast(struct sk_buff *skb, struct net_device *dev); #if BITS_PER_LONG == 64 && defined(__BIG_ENDIAN) void ethnl_bitmap_to_u32(unsigned long *bitmap, unsigned int nwords); -- 2.20.1