Lines Matching refs:opt
442 const struct bond_option *opt; in bond_opt_get_by_name() local
446 opt = bond_opt_get(option); in bond_opt_get_by_name()
447 if (opt && !strcmp(opt->name, name)) in bond_opt_get_by_name()
448 return opt; in bond_opt_get_by_name()
457 const struct bond_option *opt; in bond_opt_get_val() local
460 opt = bond_opt_get(option); in bond_opt_get_val()
461 if (WARN_ON(!opt)) in bond_opt_get_val()
463 for (i = 0; opt->values && opt->values[i].string; i++) in bond_opt_get_val()
464 if (opt->values[i].value == val) in bond_opt_get_val()
465 return &opt->values[i]; in bond_opt_get_val()
471 static const struct bond_opt_value *bond_opt_get_flags(const struct bond_option *opt, in bond_opt_get_flags() argument
476 for (i = 0; opt->values && opt->values[i].string; i++) in bond_opt_get_flags()
477 if (opt->values[i].flags & flagmask) in bond_opt_get_flags()
478 return &opt->values[i]; in bond_opt_get_flags()
486 static bool bond_opt_check_range(const struct bond_option *opt, u64 val) in bond_opt_check_range() argument
490 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); in bond_opt_check_range()
491 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); in bond_opt_check_range()
508 const struct bond_opt_value *bond_opt_parse(const struct bond_option *opt, in bond_opt_parse() argument
518 if (opt->flags & BOND_OPTFLAG_RAWVAL) in bond_opt_parse()
521 tbl = opt->values; in bond_opt_parse()
567 if (checkval && bond_opt_check_range(opt, val->value)) in bond_opt_parse()
575 const struct bond_option *opt) in bond_opt_check_deps() argument
579 if (test_bit(params->mode, &opt->unsuppmodes)) in bond_opt_check_deps()
581 if ((opt->flags & BOND_OPTFLAG_NOSLAVES) && bond_has_slaves(bond)) in bond_opt_check_deps()
583 if ((opt->flags & BOND_OPTFLAG_IFDOWN) && (bond->dev->flags & IFF_UP)) in bond_opt_check_deps()
590 const struct bond_option *opt) in bond_opt_dep_print() argument
597 if (test_bit(params->mode, &opt->unsuppmodes)) in bond_opt_dep_print()
599 opt->name, modeval->string, modeval->value); in bond_opt_dep_print()
603 const struct bond_option *opt, in bond_opt_error_interpret() argument
618 opt->name, val->string); in bond_opt_error_interpret()
621 opt->name, val->value); in bond_opt_error_interpret()
624 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); in bond_opt_error_interpret()
625 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); in bond_opt_error_interpret()
629 opt->name, minval ? minval->value : 0, maxval->value); in bond_opt_error_interpret()
632 bond_opt_dep_print(bond, opt); in bond_opt_error_interpret()
636 opt->name); in bond_opt_error_interpret()
640 opt->name); in bond_opt_error_interpret()
661 const struct bond_option *opt; in __bond_opt_set() local
666 opt = bond_opt_get(option); in __bond_opt_set()
667 if (WARN_ON(!val) || WARN_ON(!opt)) in __bond_opt_set()
669 ret = bond_opt_check_deps(bond, opt); in __bond_opt_set()
672 retval = bond_opt_parse(opt, val); in __bond_opt_set()
677 ret = opt->set(bond, retval); in __bond_opt_set()
680 bond_opt_error_interpret(bond, opt, ret, val); in __bond_opt_set()