summaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/main.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2010-09-05 01:58:27 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-05 00:29:45 -0700
commit15cf5523d2e42f755b3b1d8ea0fa601ffcf8b9e7 (patch)
tree7ec59e81276bc8399e221186f7484da9ea26c932 /drivers/staging/batman-adv/main.c
parentd52e90aeaf93d62cc1a7f9a8a9f3a6f68c475cf5 (diff)
downloadop-kernel-dev-15cf5523d2e42f755b3b1d8ea0fa601ffcf8b9e7.zip
op-kernel-dev-15cf5523d2e42f755b3b1d8ea0fa601ffcf8b9e7.tar.gz
Staging: batman-adv: register the batman-adv packet type per interface
Batman-adv globally registered the batman-adv packet type and installed a hook to batman_skb_recv(). Each interface receiving a packet with that type would end up in this function which then had to loop through all batman-adv internal interface structures to find the its meta data. The more interfaces a system had the longer the loops might take. Each and every packet goes through this function making it a performance critical loop. This patch installs the hook for each activated interface. The called batman_skb_recv() can distinguish these calls, therefore avoiding the loop through the interface structures. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> [sven.eckelmann@gmx.de: Rework on top of current version] Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/main.c')
-rw-r--r--drivers/staging/batman-adv/main.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index c0a3373..eb0bfbe 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -49,11 +49,6 @@ struct net_device *soft_device;
unsigned char broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
atomic_t module_state;
-static struct packet_type batman_adv_packet_type __read_mostly = {
- .type = __constant_htons(ETH_P_BATMAN),
- .func = batman_skb_recv,
-};
-
struct workqueue_struct *bat_event_workqueue;
static int __init batman_init(void)
@@ -103,7 +98,6 @@ static int __init batman_init(void)
goto unreg_sysfs;
register_netdevice_notifier(&hard_if_notifier);
- dev_add_pack(&batman_adv_packet_type);
pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) "
"loaded\n", SOURCE_VERSION, REVISION_VERSION_STR,
@@ -140,8 +134,6 @@ static void __exit batman_exit(void)
soft_device = NULL;
}
- dev_remove_pack(&batman_adv_packet_type);
-
destroy_workqueue(bat_event_workqueue);
bat_event_workqueue = NULL;
}
@@ -185,8 +177,6 @@ void deactivate_module(void)
vis_quit();
- /* TODO: unregister BATMAN pack */
-
originator_free();
hna_local_free();
OpenPOWER on IntegriCloud