diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-11-28 21:31:55 +0800 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-17 02:50:20 +0800 |
commit | 01c4224b51feba2ba64d070ab9f4aa32c9d0bb29 (patch) | |
tree | 80ca19da3b90b2b69f01492c06310be4c8678efc /net/batman-adv/main.c | |
parent | 1c280471b013e26c833fc86acc231c73442cfa21 (diff) |
batman-adv: convert batman iv algorithm to use dynamic infrastructure
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/main.c')
-rw-r--r-- | net/batman-adv/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 7c87a341f29..bcc2bddd893 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@ -206,6 +206,18 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops) goto out; } + /* all algorithms must implement all ops (for now) */ + if (!bat_algo_ops->bat_ogm_init || + !bat_algo_ops->bat_ogm_init_primary || + !bat_algo_ops->bat_ogm_update_mac || + !bat_algo_ops->bat_ogm_schedule || + !bat_algo_ops->bat_ogm_emit || + !bat_algo_ops->bat_ogm_receive) { + pr_info("Routing algo '%s' does not implement required ops\n", + bat_algo_ops->name); + goto out; + } + INIT_HLIST_NODE(&bat_algo_ops->list); hlist_add_head(&bat_algo_ops->list, &bat_algo_list); ret = 0; |