aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/translation-table.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-07-08Staging: batman-adv: Move printk to simplified macrosSven Eckelmann1-4/+2
Each general printk which is not informative by itself for a specific batX device were moved to pr_(info|warning|err) as it provides an easy interface which for example resolves the problem to add the prefix "batman-adv: " before each line. All information which is specific to a batX device will be printed using a bat_(info|err|warning) macro to prefix it also with "batman-adv: batX:" in each line. Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08Staging: batman-adv: add routing debug log accessible via debugfsMarek Lindner1-6/+15
All routing debug messages are saved in a ring buffer that can be read via the debugfs file "log". Note that CONFIG_BATMAN_ADV_DEBUG must be activated to have the debug logs compiled in. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08Staging: batman-adv: Lower resolution for timeoutsSimon Wunderlich1-2/+1
It is enough for our timeouts to keep them in seconds instead of miliseconds. With a too high resolution, we might even risk an integer overflow, so this patch should make things more safe. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08Staging: batman-adv: Avoid rounding issues for local hna timeoutLinus Lüssing1-1/+1
With the current default values, this patch is not critical, as LOCAL_HNA_TIMEOUT is a multiple of 1000 anyway. However, if someone would like to change this #define, the person could have some unexpected rounding issues. Therefore doing the multiplication before the division now. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22Staging: batman-adv: Mark locally used symbols as staticSven Eckelmann1-3/+6
Functions and variables which are used only inside one object file can be declared as static. This helped to find unused functions/variables * mainIfAddr_default * main_if_was_up and functions with declarations but missing definitions * hash_debug * orig_find * send_own_packet_work Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22Staging: batman-adv: Convert MAC_FMT to %pMJoe Perches1-20/+4
Remove the last uses of MAC_FMT Signed-off-by: Joe Perches <joe@perches.com> [sven.eckelmann@gmx.de: Adapted for current batman-adv version] Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22Staging: batman-adv: remove superfluous hint to "translation table"Marek Lindner1-2/+1
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>
2010-06-22Staging: batman-adv: Move tables from sysfs to debugfsSven Eckelmann1-74/+75
Files which represent more than a single attribute aren't allowed in sysfs. As we have some files which aren't essential and are lists or tables aggregated from data from different places inside batman-adv, we must place them in a filesystem without such a restriction. Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: batman-adv: Reduce max characters on a line to 80Sven Eckelmann1-12/+22
Documentation/CodingStyle sets a strongly prefered limit of 80 characters per line in "Chapter 2: Breaking long lines and strings". Strings must be broken into smaller parts and long statements must be rewritten. Reported-by: Mikal Sande <mikal.sande@gmail.com> Reported-by: Mark Rankilor <reodge@gmail.com> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: batman-adv: move /proc interface handling to /sysMarek Lindner1-10/+4
Instead of having a single /proc file "interfaces" in which you have to echo the wanted interface batman-adv will create a subfolder in each suitable /sys/class/net folder. This subfolder contains files for the interface specific settings. For example, mesh_iface to add/remove an interface from a virtual mesh network (at the moment only bat0 is supported). Example: echo bat0 > /sys/class/net/eth0/batman-adv/mesh_iface to deactivate: echo none > /sys/class/net/eth0/batman-adv/mesh_iface Interfaces which are not compatible with batman-adv won't contain the batman-adv folder, therefore can't be activated. Not supported are: loopback, non-ethernet, non-ARP and virtual mesh network interfaces Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: batman-adv: convert more files from /proc to /sysMarek Lindner1-0/+26
converted files: vis_mode, vis_data Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: batman-adv: convert multiple /proc files to use sysfsMarek Lindner1-9/+33
This is the first patch in a series of patches which aim to convert all batman-adv /proc files to sysfs. To keep the changes in a digestable size it has been split up into smaller chunks. During the transition period batman-adv will use /proc as well as sysfs. As a first step the following files have been converted: aggregate_ogm, originators, transtable_global, transtable_local Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: batman-adv: fix whitespace style issuesLuis de Bethencourt1-7/+7
This patch fixes the 31 unnecessary whitespaces before a quoted newline that the batman-adv files had. Signed-off-by: Luis de Bethencourt <luisbg@ubuntu.com> [sven.eckelmann@gmx.de: Redone to apply against current version] Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: batman-adv: Update copyright yearsSimon Wunderlich1-1/+1
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: batman-adv: Remove compat.hSimon Wunderlich1-1/+0
Since we are now part of mainline, we don't need compat.h to allow building of the module with old versions of the kernel. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: batman-adv: Use printk(%pM) for MAC addressesAndrew Lunn1-24/+10
printk() since kernel version 2.6.29 has supported printing MAC addresses directly, as an extension to the %p processing. This patch makes use of this for printk() and bat_dbg(). This will remove the overhead of using addr_to_string() which is normally never actually output. Fixed a typo found by Gus Wirth. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: batman-adv: Allow the MAC address to be setAndrew Lunn1-0/+15
Some embedded devices have very limited sources of entropy for the random number generator. It has been observed that the random MAC address on the interface bat0 is not always random. When testing with a collection of identical hardware, sometimes the bat0 device the same MAC address on multiple devices, causing mayhem. This patch allows the MAC address to be set by the user. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: batman-adv: check all kmalloc()sSimon Wunderlich1-8/+10
there are some kmallocs left which are not checked whether they succeeds or not, which might lead to corrupted data structures if the system memory is full. This patch should clean up the remaining unchecked kmalloc()s. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: batman-adv: initialize static hash iteratorsSimon Wunderlich1-12/+12
instead of dynamically registering hash iterators, calling functions are changed to register the iterator objects statically. The two advantages are: * no memory leaks when aborting from hash_iterate() * no calls to kmalloc/kfree, therefore a little faster/safer Tested with 9 QEMU instances, no obvious regression found. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: batman-adv: replace internal logging mechanism.Andrew Lunn1-10/+12
batman-adv used its own logging infrastructure. Replace this with standard kernel logging, printk(), with compile time and runtime options to enable/disable different debug levels. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11staging: batman-adv meshing protocolAndrew Lunn1-0/+454
B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is a routing protocol for multi-hop ad-hoc mesh networks. The networks may be wired or wireless. See http://www.open-mesh.org/ for more information and user space tools. This is the first submission for inclusion in staging. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>