Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290195
b: refs/heads/master
c: d419be1
h: refs/heads/master
i:
  290193: b7af4e7
  290191: d0325cd
v: v3
  • Loading branch information
Marek Lindner committed Feb 16, 2012
1 parent 76103ed commit 46cdb7d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01c4224b51feba2ba64d070ab9f4aa32c9d0bb29
refs/heads/master: d419be1fd1e4417adc833365a3b69d0968c27c3f
24 changes: 24 additions & 0 deletions trunk/net/batman-adv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,30 @@ int bat_algo_seq_print_text(struct seq_file *seq, void *offset)
return 0;
}

static int param_set_ra(const char *val, const struct kernel_param *kp)
{
struct bat_algo_ops *bat_algo_ops;

bat_algo_ops = bat_algo_get((char *)val);
if (!bat_algo_ops) {
pr_err("Routing algorithm '%s' is not supported\n", val);
return -EINVAL;
}

return param_set_copystring(val, kp);
}

static const struct kernel_param_ops param_ops_ra = {
.set = param_set_ra,
.get = param_get_string,
};

static struct kparam_string __param_string_ra = {
.maxlen = sizeof(bat_routing_algo),
.string = bat_routing_algo,
};

module_param_cb(routing_algo, &param_ops_ra, &__param_string_ra, 0644);
module_init(batman_init);
module_exit(batman_exit);

Expand Down

0 comments on commit 46cdb7d

Please sign in to comment.