xref: /openbmc/linux/net/ethtool/bitset.h (revision b83685bc)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _NET_ETHTOOL_BITSET_H
4 #define _NET_ETHTOOL_BITSET_H
5 
6 typedef const char (*const ethnl_string_array_t)[ETH_GSTRING_LEN];
7 
8 int ethnl_bitset_is_compact(const struct nlattr *bitset, bool *compact);
9 int ethnl_bitset_size(const unsigned long *val, const unsigned long *mask,
10 		      unsigned int nbits, ethnl_string_array_t names,
11 		      bool compact);
12 int ethnl_bitset32_size(const u32 *val, const u32 *mask, unsigned int nbits,
13 			ethnl_string_array_t names, bool compact);
14 int ethnl_put_bitset(struct sk_buff *skb, int attrtype,
15 		     const unsigned long *val, const unsigned long *mask,
16 		     unsigned int nbits, ethnl_string_array_t names,
17 		     bool compact);
18 int ethnl_put_bitset32(struct sk_buff *skb, int attrtype, const u32 *val,
19 		       const u32 *mask, unsigned int nbits,
20 		       ethnl_string_array_t names, bool compact);
21 int ethnl_update_bitset(unsigned long *bitmap, unsigned int nbits,
22 			const struct nlattr *attr, ethnl_string_array_t names,
23 			struct netlink_ext_ack *extack, bool *mod);
24 int ethnl_update_bitset32(u32 *bitmap, unsigned int nbits,
25 			  const struct nlattr *attr, ethnl_string_array_t names,
26 			  struct netlink_ext_ack *extack, bool *mod);
27 
28 #endif /* _NET_ETHTOOL_BITSET_H */
29