Lines Matching refs:tb
330 struct nlattr *tb[ARRAY_SIZE(bitset_policy)]; in ethnl_bitset_is_compact() local
333 ret = nla_parse_nested(tb, ARRAY_SIZE(bitset_policy) - 1, bitset, in ethnl_bitset_is_compact()
338 if (tb[ETHTOOL_A_BITSET_BITS]) { in ethnl_bitset_is_compact()
339 if (tb[ETHTOOL_A_BITSET_VALUE] || tb[ETHTOOL_A_BITSET_MASK]) in ethnl_bitset_is_compact()
344 if (!tb[ETHTOOL_A_BITSET_SIZE] || !tb[ETHTOOL_A_BITSET_VALUE]) in ethnl_bitset_is_compact()
382 struct nlattr *tb[ARRAY_SIZE(bit_policy)]; in ethnl_parse_bit() local
385 ret = nla_parse_nested(tb, ARRAY_SIZE(bit_policy) - 1, bit_attr, in ethnl_parse_bit()
390 if (tb[ETHTOOL_A_BITSET_BIT_INDEX]) { in ethnl_parse_bit()
393 idx = nla_get_u32(tb[ETHTOOL_A_BITSET_BIT_INDEX]); in ethnl_parse_bit()
396 tb[ETHTOOL_A_BITSET_BIT_INDEX], in ethnl_parse_bit()
401 if (tb[ETHTOOL_A_BITSET_BIT_NAME] && name && in ethnl_parse_bit()
402 strncmp(nla_data(tb[ETHTOOL_A_BITSET_BIT_NAME]), name, in ethnl_parse_bit()
403 nla_len(tb[ETHTOOL_A_BITSET_BIT_NAME]))) { in ethnl_parse_bit()
408 } else if (tb[ETHTOOL_A_BITSET_BIT_NAME]) { in ethnl_parse_bit()
410 nla_data(tb[ETHTOOL_A_BITSET_BIT_NAME])); in ethnl_parse_bit()
413 tb[ETHTOOL_A_BITSET_BIT_NAME], in ethnl_parse_bit()
424 *val = no_mask || tb[ETHTOOL_A_BITSET_BIT_VALUE]; in ethnl_parse_bit()
430 const struct nlattr *attr, struct nlattr **tb, in ethnl_update_bitset32_verbose() argument
439 if (tb[ETHTOOL_A_BITSET_VALUE]) { in ethnl_update_bitset32_verbose()
440 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_VALUE], in ethnl_update_bitset32_verbose()
444 if (tb[ETHTOOL_A_BITSET_MASK]) { in ethnl_update_bitset32_verbose()
445 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_MASK], in ethnl_update_bitset32_verbose()
450 no_mask = tb[ETHTOOL_A_BITSET_NOMASK]; in ethnl_update_bitset32_verbose()
454 nla_for_each_nested(bit_attr, tb[ETHTOOL_A_BITSET_BITS], rem) { in ethnl_update_bitset32_verbose()
482 struct nlattr **tb, in ethnl_compact_sanity_checks() argument
485 bool no_mask = tb[ETHTOOL_A_BITSET_NOMASK]; in ethnl_compact_sanity_checks()
489 if (no_mask && tb[ETHTOOL_A_BITSET_MASK]) { in ethnl_compact_sanity_checks()
490 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_MASK], in ethnl_compact_sanity_checks()
494 if (!tb[ETHTOOL_A_BITSET_SIZE]) { in ethnl_compact_sanity_checks()
499 if (!tb[ETHTOOL_A_BITSET_VALUE]) { in ethnl_compact_sanity_checks()
504 if (!no_mask && !tb[ETHTOOL_A_BITSET_MASK]) { in ethnl_compact_sanity_checks()
510 attr_nbits = nla_get_u32(tb[ETHTOOL_A_BITSET_SIZE]); in ethnl_compact_sanity_checks()
512 if (nla_len(tb[ETHTOOL_A_BITSET_VALUE]) != attr_nwords * sizeof(u32)) { in ethnl_compact_sanity_checks()
513 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_VALUE], in ethnl_compact_sanity_checks()
517 if (tb[ETHTOOL_A_BITSET_MASK] && in ethnl_compact_sanity_checks()
518 nla_len(tb[ETHTOOL_A_BITSET_MASK]) != attr_nwords * sizeof(u32)) { in ethnl_compact_sanity_checks()
519 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_MASK], in ethnl_compact_sanity_checks()
526 test_attr = no_mask ? tb[ETHTOOL_A_BITSET_VALUE] : in ethnl_compact_sanity_checks()
527 tb[ETHTOOL_A_BITSET_MASK]; in ethnl_compact_sanity_checks()
556 struct nlattr *tb[ARRAY_SIZE(bitset_policy)]; in ethnl_update_bitset32() local
563 ret = nla_parse_nested(tb, ARRAY_SIZE(bitset_policy) - 1, attr, in ethnl_update_bitset32()
568 if (tb[ETHTOOL_A_BITSET_BITS]) in ethnl_update_bitset32()
569 return ethnl_update_bitset32_verbose(bitmap, nbits, attr, tb, in ethnl_update_bitset32()
571 ret = ethnl_compact_sanity_checks(nbits, attr, tb, extack); in ethnl_update_bitset32()
575 no_mask = tb[ETHTOOL_A_BITSET_NOMASK]; in ethnl_update_bitset32()
577 nla_get_u32(tb[ETHTOOL_A_BITSET_SIZE]), nbits); in ethnl_update_bitset32()
579 nla_data(tb[ETHTOOL_A_BITSET_VALUE]), in ethnl_update_bitset32()
581 nla_data(tb[ETHTOOL_A_BITSET_MASK]), in ethnl_update_bitset32()
609 struct nlattr *tb[ARRAY_SIZE(bitset_policy)]; in ethnl_parse_bitset() local
617 ret = nla_parse_nested(tb, ARRAY_SIZE(bitset_policy) - 1, attr, in ethnl_parse_bitset()
621 no_mask = tb[ETHTOOL_A_BITSET_NOMASK]; in ethnl_parse_bitset()
623 if (!tb[ETHTOOL_A_BITSET_BITS]) { in ethnl_parse_bitset()
626 ret = ethnl_compact_sanity_checks(nbits, attr, tb, extack); in ethnl_parse_bitset()
630 change_bits = nla_get_u32(tb[ETHTOOL_A_BITSET_SIZE]); in ethnl_parse_bitset()
633 bitmap_from_arr32(val, nla_data(tb[ETHTOOL_A_BITSET_VALUE]), in ethnl_parse_bitset()
641 nla_data(tb[ETHTOOL_A_BITSET_MASK]), in ethnl_parse_bitset()
651 if (tb[ETHTOOL_A_BITSET_VALUE]) { in ethnl_parse_bitset()
652 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_VALUE], in ethnl_parse_bitset()
656 if (tb[ETHTOOL_A_BITSET_MASK]) { in ethnl_parse_bitset()
657 NL_SET_ERR_MSG_ATTR(extack, tb[ETHTOOL_A_BITSET_MASK], in ethnl_parse_bitset()
668 nla_for_each_nested(bit_attr, tb[ETHTOOL_A_BITSET_BITS], rem) { in ethnl_parse_bitset()