aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/hard-interface.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-08-05Staging: Merge staging-next into Linus's treeGreg Kroah-Hartman1-31/+40
Conflicts: drivers/staging/Kconfig drivers/staging/batman-adv/bat_sysfs.c drivers/staging/batman-adv/device.c drivers/staging/batman-adv/hard-interface.c drivers/staging/cx25821/cx25821-audups11.c Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22Staging: batman-adv: Don't increment stats of foreign deviceSven Eckelmann1-7/+0
The receive hook for batman-adv ethernet frames tried to get the last device which processed the skb before us. It only used that information to update the rx_bytes and rx_packets stat of that foreign device which already has updated it using its own receive functions. Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08Staging: batman-adv: Move printk to simplified macrosSven Eckelmann1-27/+22
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-1/+3
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-07net: fix 64 bit counters on 32 bit archesEric Dumazet1-1/+2
There is a small possibility that a reader gets incorrect values on 32 bit arches. SNMP applications could catch incorrect counters when a 32bit high part is changed by another stats consumer/provider. One way to solve this is to add a rtnl_link_stats64 param to all ndo_get_stats64() methods, and also add such a parameter to dev_get_stats(). Rule is that we are not allowed to use dev->stats64 as a temporary storage for 64bit stats, but a caller provided area (usually on stack) Old drivers (only providing get_stats() method) need no changes. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-06-22Staging: batman-adv: bonding and interface alternatingSimon Wunderlich1-1/+1
This patch adds interface alternating to the new bonding feature. By default, we now try to avoid forwarding packets on the receiving interface, instead choosing alternative interfaces. This feature works only on nodes which have multiple interfaces connected to the mesh. This approach should reduce problems of the half-duplex nature of WiFi Hardware and thus increase performance. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Acked-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: Add bonding functionalitySimon Wunderlich1-1/+1
This patch introduces bonding functionality to batman-advanced, targeted for the 0.3 release. As we are able to route the payload traffic as we want, we may use multiple interfaces on multihomed hosts to transfer data to achieve higher bandwidth. This can be considered as "light Multi Path Routing" for single hop connections. To detect which interfaces of a peer node belong to the same host, a new flag PRIMARIES_FIRST_HOP is introduced. This flag is set on the first hop of OGMs of the primary (first) interface, which is broadcasted on all interfaces. When receiving such an OGM, we can learn which interfaces belong to the same host (by assigning them to the primary originator). Bonding works by sending packets in a round-robin fashion to the available interfaces of a neighbor host, if multiple interfaces are available. The neighbor interfaces should be almost equally good to reach. To avoid interferences (i.e. sending on the same channel), only neighbor interfaces with different mac addresses and different outgoing interfaces are considered as candidates. Bonding is deactivated by default, and can be activated by echo 1 > /sys/class/net/bat0/mesh/bonding for each individual node. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.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-18Staging: batman-adv: Adding netfilter-bridge hooksLinus Lüssing1-1/+13
batman-adv is receiving and sending the packets of its own ether type on a very early/low level. Therefore we need to add explicit hooks to give netfilter/ebtables a chance to filter them. Reported-by: Antonio Quartulli <ordex@ritirata.org> 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-15bridge: use rx_handler_data pointer to store net_bridge_port pointerJiri Pirko1-1/+1
Register net_bridge_port pointer as rx_handler data pointer. As br_port is removed from struct net_device, another netdev priv_flag is added to indicate the device serves as a bridge port. Also rcuized pointers are now correctly dereferenced in br_fdb.c and in netfilter parts. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-14staging: batman: remove all rcu head initializationsPaul E. McKenney1-1/+0
Remove all rcu head inits. We don't care about the RCU head state before passing it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can keep track of objects on stack. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Andrew Lunn <andrew@lunn.ch> Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Cc: Marek Lindner <lindner_marek@yahoo.de> Cc: 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-6/+14
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-253/+262
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: 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: fix module initializationMarek Lindner1-0/+7
Make sure that batman-adv does not process packets before its initialization is complete. Some sanity checks added to the receiver function. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> 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: avoid crash on memory allocation errorMarek Lindner1-7/+9
skb_share_check() returns NULL if it can't allocate more memory but it still frees the skbuff. 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-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-7/+7
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: receive packets directly using skbsSimon Wunderlich1-45/+109
This patch removes the (ugly and racy) packet receiving thread and the kernel socket usage. Instead, packets are received directly by registering the ethernet type and handling skbs instead of self-allocated buffers. Some consequences and comments: * we don't copy the payload data when forwarding/sending/receiving data anymore. This should boost performance. * packets from/to different interfaces can be (theoretically) processed simultaneously. Only the big originator hash lock might be in the way. * no more polling or sleeping/wakeup/scheduling issues when receiving packets * this might introduce new race conditions. * aggregation and vis code still use packet buffers and are not (yet) converted. * all spinlocks were converted to irqsave/restore versions to solve some lifelock issues when preempted. This might be overkill, some of these locks might be reverted later. * skb copies are only done if neccesary to avoid overhead performance differences: * we made some "benchmarks" with intel laptops. * bandwidth on Gigabit Ethernet increased from ~500 MBit/s to ~920 MBit/s * ping latency decresed from ~2ms to ~0.2 ms I did some tests on my 9 node qemu environment and could confirm that usual sending/receiving, forwarding, vis, batctl ping etc works. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Acked-by: Sven Eckelmann <sven.eckelmann@gmx.de> Acked-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Linus Lüssing <linus.luessing@web.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-3/+3
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: Remove NULL pointer checkSven Eckelmann1-2/+1
It is safe to call kfree(NULL) which makes this extra check unneeded. It was found using checkpatch.pl from linux-2.6 Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Acked-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-19/+17
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/+451
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>