Blame view

net/ethtool/bitset.h 1.47 KB
10b518d4e   Michal Kubecek   ethtool: netlink ...
1
2
3
4
  /* SPDX-License-Identifier: GPL-2.0-only */
  
  #ifndef _NET_ETHTOOL_BITSET_H
  #define _NET_ETHTOOL_BITSET_H
e34f1753e   Michal Kubecek   ethtool: limit bi...
5
  #define ETHNL_MAX_BITSET_SIZE S16_MAX
10b518d4e   Michal Kubecek   ethtool: netlink ...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  typedef const char (*const ethnl_string_array_t)[ETH_GSTRING_LEN];
  
  int ethnl_bitset_is_compact(const struct nlattr *bitset, bool *compact);
  int ethnl_bitset_size(const unsigned long *val, const unsigned long *mask,
  		      unsigned int nbits, ethnl_string_array_t names,
  		      bool compact);
  int ethnl_bitset32_size(const u32 *val, const u32 *mask, unsigned int nbits,
  			ethnl_string_array_t names, bool compact);
  int ethnl_put_bitset(struct sk_buff *skb, int attrtype,
  		     const unsigned long *val, const unsigned long *mask,
  		     unsigned int nbits, ethnl_string_array_t names,
  		     bool compact);
  int ethnl_put_bitset32(struct sk_buff *skb, int attrtype, const u32 *val,
  		       const u32 *mask, unsigned int nbits,
  		       ethnl_string_array_t names, bool compact);
  int ethnl_update_bitset(unsigned long *bitmap, unsigned int nbits,
  			const struct nlattr *attr, ethnl_string_array_t names,
  			struct netlink_ext_ack *extack, bool *mod);
  int ethnl_update_bitset32(u32 *bitmap, unsigned int nbits,
  			  const struct nlattr *attr, ethnl_string_array_t names,
  			  struct netlink_ext_ack *extack, bool *mod);
88db6d1e4   Michal Kubecek   ethtool: add ethn...
27
28
29
30
  int ethnl_parse_bitset(unsigned long *val, unsigned long *mask,
  		       unsigned int nbits, const struct nlattr *attr,
  		       ethnl_string_array_t names,
  		       struct netlink_ext_ack *extack);
10b518d4e   Michal Kubecek   ethtool: netlink ...
31
32
  
  #endif /* _NET_ETHTOOL_BITSET_H */