Lines Matching refs:opt
388 const struct bond_option *opt; in bond_opt_get_by_name() local
392 opt = bond_opt_get(option); in bond_opt_get_by_name()
393 if (opt && !strcmp(opt->name, name)) in bond_opt_get_by_name()
394 return opt; in bond_opt_get_by_name()
403 const struct bond_option *opt; in bond_opt_get_val() local
406 opt = bond_opt_get(option); in bond_opt_get_val()
407 if (WARN_ON(!opt)) in bond_opt_get_val()
409 for (i = 0; opt->values && opt->values[i].string; i++) in bond_opt_get_val()
410 if (opt->values[i].value == val) in bond_opt_get_val()
411 return &opt->values[i]; in bond_opt_get_val()
417 static const struct bond_opt_value *bond_opt_get_flags(const struct bond_option *opt, in bond_opt_get_flags() argument
422 for (i = 0; opt->values && opt->values[i].string; i++) in bond_opt_get_flags()
423 if (opt->values[i].flags & flagmask) in bond_opt_get_flags()
424 return &opt->values[i]; in bond_opt_get_flags()
432 static bool bond_opt_check_range(const struct bond_option *opt, u64 val) in bond_opt_check_range() argument
436 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); in bond_opt_check_range()
437 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); in bond_opt_check_range()
454 const struct bond_opt_value *bond_opt_parse(const struct bond_option *opt, in bond_opt_parse() argument
464 if (opt->flags & BOND_OPTFLAG_RAWVAL) in bond_opt_parse()
467 tbl = opt->values; in bond_opt_parse()
513 if (checkval && bond_opt_check_range(opt, val->value)) in bond_opt_parse()
521 const struct bond_option *opt) in bond_opt_check_deps() argument
525 if (test_bit(params->mode, &opt->unsuppmodes)) in bond_opt_check_deps()
527 if ((opt->flags & BOND_OPTFLAG_NOSLAVES) && bond_has_slaves(bond)) in bond_opt_check_deps()
529 if ((opt->flags & BOND_OPTFLAG_IFDOWN) && (bond->dev->flags & IFF_UP)) in bond_opt_check_deps()
536 const struct bond_option *opt) in bond_opt_dep_print() argument
543 if (test_bit(params->mode, &opt->unsuppmodes)) in bond_opt_dep_print()
545 opt->name, modeval->string, modeval->value); in bond_opt_dep_print()
549 const struct bond_option *opt, in bond_opt_error_interpret() argument
564 opt->name, val->string); in bond_opt_error_interpret()
567 opt->name, val->value); in bond_opt_error_interpret()
570 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); in bond_opt_error_interpret()
571 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); in bond_opt_error_interpret()
575 opt->name, minval ? minval->value : 0, maxval->value); in bond_opt_error_interpret()
578 bond_opt_dep_print(bond, opt); in bond_opt_error_interpret()
582 opt->name); in bond_opt_error_interpret()
586 opt->name); in bond_opt_error_interpret()
607 const struct bond_option *opt; in __bond_opt_set() local
612 opt = bond_opt_get(option); in __bond_opt_set()
613 if (WARN_ON(!val) || WARN_ON(!opt)) in __bond_opt_set()
615 ret = bond_opt_check_deps(bond, opt); in __bond_opt_set()
618 retval = bond_opt_parse(opt, val); in __bond_opt_set()
623 ret = opt->set(bond, retval); in __bond_opt_set()
626 bond_opt_error_interpret(bond, opt, ret, val); in __bond_opt_set()