Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02e73c1e authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge

parents c5216cc7 27aea212
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
[state: 27-01-2011]
[state: 17-04-2011]


BATMAN-ADV
BATMAN-ADV
----------
----------
@@ -19,6 +19,7 @@ duce the overhead to a minimum. It does not depend on any (other)
network driver, and can be used on wifi as well as ethernet  lan,
network driver, and can be used on wifi as well as ethernet  lan,
vpn,  etc ... (anything with ethernet-style layer 2).
vpn,  etc ... (anything with ethernet-style layer 2).



CONFIGURATION
CONFIGURATION
-------------
-------------


@@ -160,13 +161,13 @@ face. Each entry can/has to have the following values:
-> "TQ mac  value"  -  src mac's link quality towards mac address
-> "TQ mac  value"  -  src mac's link quality towards mac address
                       of a neighbor originator's interface which
                       of a neighbor originator's interface which
                       is being used for routing
                       is being used for routing
-> "HNA mac" - HNA announced by source mac
-> "TT mac" - TT announced by source mac
-> "PRIMARY" - this  is a primary interface
-> "PRIMARY" - this  is a primary interface
-> "SEC mac" - secondary mac address of source
-> "SEC mac" - secondary mac address of source
               (requires preceding PRIMARY)
               (requires preceding PRIMARY)


The TQ value has a range from 4 to 255 with 255 being  the  best.
The TQ value has a range from 4 to 255 with 255 being  the  best.
The HNA entries are showing which hosts are connected to the mesh
The TT entries are showing which hosts are connected to the mesh
via bat0 or being bridged into the mesh network.  The PRIMARY/SEC
via bat0 or being bridged into the mesh network.  The PRIMARY/SEC
values are only applied on primary interfaces
values are only applied on primary interfaces


@@ -199,7 +200,7 @@ abled during run time. Following log_levels are defined:


0 - All  debug  output  disabled
0 - All  debug  output  disabled
1 - Enable messages related to routing / flooding / broadcasting
1 - Enable messages related to routing / flooding / broadcasting
2 - Enable route or hna added / changed / deleted
2 - Enable route or tt entry added / changed / deleted
3 - Enable all messages
3 - Enable all messages


The debug output can be changed at runtime  using  the  file
The debug output can be changed at runtime  using  the  file
@@ -207,7 +208,7 @@ The debug output can be changed at runtime using the file


# echo 2 > /sys/class/net/bat0/mesh/log_level
# echo 2 > /sys/class/net/bat0/mesh/log_level


will enable debug messages for when routes or HNAs change.
will enable debug messages for when routes or TTs change.




BATCTL
BATCTL
+8 −8
Original line number Original line Diff line number Diff line
@@ -24,10 +24,10 @@
#include "send.h"
#include "send.h"
#include "routing.h"
#include "routing.h"


/* calculate the size of the hna information for a given packet */
/* calculate the size of the tt information for a given packet */
static int hna_len(struct batman_packet *batman_packet)
static int tt_len(struct batman_packet *batman_packet)
{
{
	return batman_packet->num_hna * ETH_ALEN;
	return batman_packet->num_tt * ETH_ALEN;
}
}


/* return true if new_packet can be aggregated with forw_packet */
/* return true if new_packet can be aggregated with forw_packet */
@@ -250,7 +250,7 @@ void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
{
{
	struct batman_packet *batman_packet;
	struct batman_packet *batman_packet;
	int buff_pos = 0;
	int buff_pos = 0;
	unsigned char *hna_buff;
	unsigned char *tt_buff;


	batman_packet = (struct batman_packet *)packet_buff;
	batman_packet = (struct batman_packet *)packet_buff;


@@ -259,14 +259,14 @@ void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
		   orig_interval. */
		   orig_interval. */
		batman_packet->seqno = ntohl(batman_packet->seqno);
		batman_packet->seqno = ntohl(batman_packet->seqno);


		hna_buff = packet_buff + buff_pos + BAT_PACKET_LEN;
		tt_buff = packet_buff + buff_pos + BAT_PACKET_LEN;
		receive_bat_packet(ethhdr, batman_packet,
		receive_bat_packet(ethhdr, batman_packet,
				   hna_buff, hna_len(batman_packet),
				   tt_buff, tt_len(batman_packet),
				   if_incoming);
				   if_incoming);


		buff_pos += BAT_PACKET_LEN + hna_len(batman_packet);
		buff_pos += BAT_PACKET_LEN + tt_len(batman_packet);
		batman_packet = (struct batman_packet *)
		batman_packet = (struct batman_packet *)
			(packet_buff + buff_pos);
			(packet_buff + buff_pos);
	} while (aggregated_packet(buff_pos, packet_len,
	} while (aggregated_packet(buff_pos, packet_len,
				   batman_packet->num_hna));
				   batman_packet->num_tt));
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -25,9 +25,9 @@
#include "main.h"
#include "main.h"


/* is there another aggregated packet here? */
/* is there another aggregated packet here? */
static inline int aggregated_packet(int buff_pos, int packet_len, int num_hna)
static inline int aggregated_packet(int buff_pos, int packet_len, int num_tt)
{
{
	int next_buff_pos = buff_pos + BAT_PACKET_LEN + (num_hna * ETH_ALEN);
	int next_buff_pos = buff_pos + BAT_PACKET_LEN + (num_tt * ETH_ALEN);


	return (next_buff_pos <= packet_len) &&
	return (next_buff_pos <= packet_len) &&
		(next_buff_pos <= MAX_AGGREGATION_BYTES);
		(next_buff_pos <= MAX_AGGREGATION_BYTES);
+2 −2
Original line number Original line Diff line number Diff line
@@ -241,13 +241,13 @@ static int softif_neigh_open(struct inode *inode, struct file *file)
static int transtable_global_open(struct inode *inode, struct file *file)
static int transtable_global_open(struct inode *inode, struct file *file)
{
{
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	return single_open(file, hna_global_seq_print_text, net_dev);
	return single_open(file, tt_global_seq_print_text, net_dev);
}
}


static int transtable_local_open(struct inode *inode, struct file *file)
static int transtable_local_open(struct inode *inode, struct file *file)
{
{
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	return single_open(file, hna_local_seq_print_text, net_dev);
	return single_open(file, tt_local_seq_print_text, net_dev);
}
}


static int vis_data_open(struct inode *inode, struct file *file)
static int vis_data_open(struct inode *inode, struct file *file)
+9 −7
Original line number Original line Diff line number Diff line
@@ -488,22 +488,24 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
	    (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0))
	    (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0))
		goto out;
		goto out;


	if (!rtnl_trylock()) {
		ret = -ERESTARTSYS;
		goto out;
	}

	if (status_tmp == IF_NOT_IN_USE) {
	if (status_tmp == IF_NOT_IN_USE) {
		rtnl_lock();
		hardif_disable_interface(hard_iface);
		hardif_disable_interface(hard_iface);
		rtnl_unlock();
		goto unlock;
		goto out;
	}
	}


	/* if the interface already is in use */
	/* if the interface already is in use */
	if (hard_iface->if_status != IF_NOT_IN_USE) {
	if (hard_iface->if_status != IF_NOT_IN_USE)
		rtnl_lock();
		hardif_disable_interface(hard_iface);
		hardif_disable_interface(hard_iface);
		rtnl_unlock();
	}


	ret = hardif_enable_interface(hard_iface, buff);
	ret = hardif_enable_interface(hard_iface, buff);


unlock:
	rtnl_unlock();
out:
out:
	hardif_free_ref(hard_iface);
	hardif_free_ref(hard_iface);
	return ret;
	return ret;
Loading