ethtool: add ethnl_parse_bitset() helper
Unlike other SET type commands, modifying netdev features is required to provide a reply telling userspace what was actually changed, compared to what was requested. For that purpose, the "modified" flag provided by ethnl_update_bitset() is not sufficient, we need full information which bits were requested to change. Therefore provide ethnl_parse_bitset() returning effective value and mask bitmaps equivalent to the contents of a bitset nested attribute. v2: use non-atomic __set_bit() (suggested by David Miller) Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
0524399d46
commit
88db6d1e4f
@@ -26,5 +26,9 @@ int ethnl_update_bitset(unsigned long *bitmap, unsigned int nbits,
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif /* _NET_ETHTOOL_BITSET_H */
|
||||
|
Reference in New Issue
Block a user