diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-07 04:20:47 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 03:53:59 -0400 |
commit | 00a50076a3afa4014cdd57e87e31a00ce4c4b67e (patch) | |
tree | 29a2f36db820eb25b3d4abd56c71d8c2e6cde889 /net/batman-adv | |
parent | d7d32ec0f199cc00a43434cdd920338763fab2e0 (diff) |
batman-adv: add iface_disable() callback to routing API
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 7 | ||||
-rw-r--r-- | net/batman-adv/hard-interface.c | 3 | ||||
-rw-r--r-- | net/batman-adv/main.c | 1 | ||||
-rw-r--r-- | net/batman-adv/types.h | 2 |
4 files changed, 11 insertions, 2 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 95bfc5962e1..4cc66db699e 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -52,6 +52,12 @@ static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) | |||
52 | batman_ogm_packet->ttvn = 0; | 52 | batman_ogm_packet->ttvn = 0; |
53 | } | 53 | } |
54 | 54 | ||
55 | static void bat_iv_ogm_iface_disable(struct hard_iface *hard_iface) | ||
56 | { | ||
57 | kfree(hard_iface->packet_buff); | ||
58 | hard_iface->packet_buff = NULL; | ||
59 | } | ||
60 | |||
55 | static void bat_iv_ogm_init_primary(struct hard_iface *hard_iface) | 61 | static void bat_iv_ogm_init_primary(struct hard_iface *hard_iface) |
56 | { | 62 | { |
57 | struct batman_ogm_packet *batman_ogm_packet; | 63 | struct batman_ogm_packet *batman_ogm_packet; |
@@ -1175,6 +1181,7 @@ static void bat_iv_ogm_receive(struct hard_iface *if_incoming, | |||
1175 | static struct bat_algo_ops batman_iv __read_mostly = { | 1181 | static struct bat_algo_ops batman_iv __read_mostly = { |
1176 | .name = "BATMAN IV", | 1182 | .name = "BATMAN IV", |
1177 | .bat_iface_enable = bat_iv_ogm_iface_enable, | 1183 | .bat_iface_enable = bat_iv_ogm_iface_enable, |
1184 | .bat_iface_disable = bat_iv_ogm_iface_disable, | ||
1178 | .bat_ogm_init_primary = bat_iv_ogm_init_primary, | 1185 | .bat_ogm_init_primary = bat_iv_ogm_init_primary, |
1179 | .bat_ogm_update_mac = bat_iv_ogm_update_mac, | 1186 | .bat_ogm_update_mac = bat_iv_ogm_update_mac, |
1180 | .bat_ogm_schedule = bat_iv_ogm_schedule, | 1187 | .bat_ogm_schedule = bat_iv_ogm_schedule, |
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 4d9b85ddd93..fd9715ec6db 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -397,8 +397,7 @@ void hardif_disable_interface(struct hard_iface *hard_iface) | |||
397 | hardif_free_ref(new_if); | 397 | hardif_free_ref(new_if); |
398 | } | 398 | } |
399 | 399 | ||
400 | kfree(hard_iface->packet_buff); | 400 | bat_priv->bat_algo_ops->bat_iface_disable(hard_iface); |
401 | hard_iface->packet_buff = NULL; | ||
402 | hard_iface->if_status = IF_NOT_IN_USE; | 401 | hard_iface->if_status = IF_NOT_IN_USE; |
403 | 402 | ||
404 | /* delete all references to this hard_iface */ | 403 | /* delete all references to this hard_iface */ |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index ca8f3954710..a47a6ced1cb 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -209,6 +209,7 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops) | |||
209 | 209 | ||
210 | /* all algorithms must implement all ops (for now) */ | 210 | /* all algorithms must implement all ops (for now) */ |
211 | if (!bat_algo_ops->bat_iface_enable || | 211 | if (!bat_algo_ops->bat_iface_enable || |
212 | !bat_algo_ops->bat_iface_disable || | ||
212 | !bat_algo_ops->bat_ogm_init_primary || | 213 | !bat_algo_ops->bat_ogm_init_primary || |
213 | !bat_algo_ops->bat_ogm_update_mac || | 214 | !bat_algo_ops->bat_ogm_update_mac || |
214 | !bat_algo_ops->bat_ogm_schedule || | 215 | !bat_algo_ops->bat_ogm_schedule || |
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 4b9224829a6..b034cf23bc9 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h | |||
@@ -379,6 +379,8 @@ struct bat_algo_ops { | |||
379 | char *name; | 379 | char *name; |
380 | /* init routing info when hard-interface is enabled */ | 380 | /* init routing info when hard-interface is enabled */ |
381 | void (*bat_iface_enable)(struct hard_iface *hard_iface); | 381 | void (*bat_iface_enable)(struct hard_iface *hard_iface); |
382 | /* de-init routing info when hard-interface is disabled */ | ||
383 | void (*bat_iface_disable)(struct hard_iface *hard_iface); | ||
382 | /* init primary OGM when primary interface is selected */ | 384 | /* init primary OGM when primary interface is selected */ |
383 | void (*bat_ogm_init_primary)(struct hard_iface *hard_iface); | 385 | void (*bat_ogm_init_primary)(struct hard_iface *hard_iface); |
384 | /* init mac addresses of the OGM belonging to this hard-interface */ | 386 | /* init mac addresses of the OGM belonging to this hard-interface */ |