From 01c4224b51feba2ba64d070ab9f4aa32c9d0bb29 Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Mon, 28 Nov 2011 21:31:55 +0800 Subject: batman-adv: convert batman iv algorithm to use dynamic infrastructure Signed-off-by: Marek Lindner --- net/batman-adv/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'net/batman-adv/main.c') diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 7c87a341f29f..bcc2bddd893a 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; -- cgit v1.2.3