• Home
  • Raw
  • Download

Lines Matching refs:opt

436 	const struct bond_option *opt;  in bond_opt_get_by_name()  local
440 opt = bond_opt_get(option); in bond_opt_get_by_name()
441 if (opt && !strcmp(opt->name, name)) in bond_opt_get_by_name()
442 return opt; in bond_opt_get_by_name()
451 const struct bond_option *opt; in bond_opt_get_val() local
454 opt = bond_opt_get(option); in bond_opt_get_val()
455 if (WARN_ON(!opt)) in bond_opt_get_val()
457 for (i = 0; opt->values && opt->values[i].string; i++) in bond_opt_get_val()
458 if (opt->values[i].value == val) in bond_opt_get_val()
459 return &opt->values[i]; in bond_opt_get_val()
465 static const struct bond_opt_value *bond_opt_get_flags(const struct bond_option *opt, in bond_opt_get_flags() argument
470 for (i = 0; opt->values && opt->values[i].string; i++) in bond_opt_get_flags()
471 if (opt->values[i].flags & flagmask) in bond_opt_get_flags()
472 return &opt->values[i]; in bond_opt_get_flags()
480 static bool bond_opt_check_range(const struct bond_option *opt, u64 val) in bond_opt_check_range() argument
484 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); in bond_opt_check_range()
485 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); in bond_opt_check_range()
502 const struct bond_opt_value *bond_opt_parse(const struct bond_option *opt, in bond_opt_parse() argument
512 if (opt->flags & BOND_OPTFLAG_RAWVAL) in bond_opt_parse()
515 tbl = opt->values; in bond_opt_parse()
561 if (checkval && bond_opt_check_range(opt, val->value)) in bond_opt_parse()
569 const struct bond_option *opt) in bond_opt_check_deps() argument
573 if (test_bit(params->mode, &opt->unsuppmodes)) in bond_opt_check_deps()
575 if ((opt->flags & BOND_OPTFLAG_NOSLAVES) && bond_has_slaves(bond)) in bond_opt_check_deps()
577 if ((opt->flags & BOND_OPTFLAG_IFDOWN) && (bond->dev->flags & IFF_UP)) in bond_opt_check_deps()
584 const struct bond_option *opt) in bond_opt_dep_print() argument
591 if (test_bit(params->mode, &opt->unsuppmodes)) in bond_opt_dep_print()
593 opt->name, modeval->string, modeval->value); in bond_opt_dep_print()
597 const struct bond_option *opt, in bond_opt_error_interpret() argument
612 opt->name, val->string); in bond_opt_error_interpret()
615 opt->name, val->value); in bond_opt_error_interpret()
618 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); in bond_opt_error_interpret()
619 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); in bond_opt_error_interpret()
623 opt->name, minval ? minval->value : 0, maxval->value); in bond_opt_error_interpret()
626 bond_opt_dep_print(bond, opt); in bond_opt_error_interpret()
630 opt->name); in bond_opt_error_interpret()
634 opt->name); in bond_opt_error_interpret()
655 const struct bond_option *opt; in __bond_opt_set() local
660 opt = bond_opt_get(option); in __bond_opt_set()
661 if (WARN_ON(!val) || WARN_ON(!opt)) in __bond_opt_set()
663 ret = bond_opt_check_deps(bond, opt); in __bond_opt_set()
666 retval = bond_opt_parse(opt, val); in __bond_opt_set()
671 ret = opt->set(bond, retval); in __bond_opt_set()
674 bond_opt_error_interpret(bond, opt, ret, val); in __bond_opt_set()