0001
0002
0003 #ifndef _NET_ETHTOOL_BITSET_H
0004 #define _NET_ETHTOOL_BITSET_H
0005
0006 #define ETHNL_MAX_BITSET_SIZE S16_MAX
0007
0008 typedef const char (*const ethnl_string_array_t)[ETH_GSTRING_LEN];
0009
0010 int ethnl_bitset_is_compact(const struct nlattr *bitset, bool *compact);
0011 int ethnl_bitset_size(const unsigned long *val, const unsigned long *mask,
0012 unsigned int nbits, ethnl_string_array_t names,
0013 bool compact);
0014 int ethnl_bitset32_size(const u32 *val, const u32 *mask, unsigned int nbits,
0015 ethnl_string_array_t names, bool compact);
0016 int ethnl_put_bitset(struct sk_buff *skb, int attrtype,
0017 const unsigned long *val, const unsigned long *mask,
0018 unsigned int nbits, ethnl_string_array_t names,
0019 bool compact);
0020 int ethnl_put_bitset32(struct sk_buff *skb, int attrtype, const u32 *val,
0021 const u32 *mask, unsigned int nbits,
0022 ethnl_string_array_t names, bool compact);
0023 int ethnl_update_bitset(unsigned long *bitmap, unsigned int nbits,
0024 const struct nlattr *attr, ethnl_string_array_t names,
0025 struct netlink_ext_ack *extack, bool *mod);
0026 int ethnl_update_bitset32(u32 *bitmap, unsigned int nbits,
0027 const struct nlattr *attr, ethnl_string_array_t names,
0028 struct netlink_ext_ack *extack, bool *mod);
0029 int ethnl_parse_bitset(unsigned long *val, unsigned long *mask,
0030 unsigned int nbits, const struct nlattr *attr,
0031 ethnl_string_array_t names,
0032 struct netlink_ext_ack *extack);
0033
0034 #endif