Skip to content

Commit

Permalink
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
David S. Miller committed Feb 17, 2012
2 parents 71cc7c3 + ea3d2fd commit 3ccdca7
Show file tree
Hide file tree
Showing 18 changed files with 426 additions and 235 deletions.
7 changes: 7 additions & 0 deletions Documentation/ABI/testing/sysfs-class-net-mesh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ Description:
Defines the penalty which will be applied to an
originator message's tq-field on every hop.

What: /sys/class/net/<mesh_iface>/mesh/routing_algo
Date: Dec 2011
Contact: Marek Lindner <lindner_marek@yahoo.de>
Description:
Defines the routing procotol this mesh instance
uses to find the optimal paths through the mesh.

What: /sys/class/net/<mesh_iface>/mesh/vis_mode
Date: May 2010
Contact: Marek Lindner <lindner_marek@yahoo.de>
Expand Down
20 changes: 6 additions & 14 deletions net/batman-adv/bat_ogm.h → net/batman-adv/bat_algo.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
* Copyright (C) 2011 B.A.T.M.A.N. contributors:
*
* Marek Lindner, Simon Wunderlich
* Marek Lindner
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
Expand All @@ -19,17 +19,9 @@
*
*/

#ifndef _NET_BATMAN_ADV_OGM_H_
#define _NET_BATMAN_ADV_OGM_H_
#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
#define _NET_BATMAN_ADV_BAT_ALGO_H_

#include "main.h"
int bat_iv_init(void);

void bat_ogm_init(struct hard_iface *hard_iface);
void bat_ogm_init_primary(struct hard_iface *hard_iface);
void bat_ogm_update_mac(struct hard_iface *hard_iface);
void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes);
void bat_ogm_emit(struct forw_packet *forw_packet);
void bat_ogm_receive(const struct ethhdr *ethhdr, unsigned char *packet_buff,
int packet_len, struct hard_iface *if_incoming);

#endif /* _NET_BATMAN_ADV_OGM_H_ */
#endif /* _NET_BATMAN_ADV_BAT_ALGO_H_ */
22 changes: 22 additions & 0 deletions net/batman-adv/bat_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ static void debug_log_cleanup(struct bat_priv *bat_priv)
}
#endif

static int bat_algorithms_open(struct inode *inode, struct file *file)
{
return single_open(file, bat_algo_seq_print_text, NULL);
}

static int originators_open(struct inode *inode, struct file *file)
{
struct net_device *net_dev = (struct net_device *)inode->i_private;
Expand Down Expand Up @@ -274,6 +279,7 @@ struct bat_debuginfo bat_debuginfo_##_name = { \
} \
};

static BAT_DEBUGINFO(routing_algos, S_IRUGO, bat_algorithms_open);
static BAT_DEBUGINFO(originators, S_IRUGO, originators_open);
static BAT_DEBUGINFO(gateways, S_IRUGO, gateways_open);
static BAT_DEBUGINFO(softif_neigh, S_IRUGO, softif_neigh_open);
Expand All @@ -293,9 +299,25 @@ static struct bat_debuginfo *mesh_debuginfos[] = {

void debugfs_init(void)
{
struct bat_debuginfo *bat_debug;
struct dentry *file;

bat_debugfs = debugfs_create_dir(DEBUGFS_BAT_SUBDIR, NULL);
if (bat_debugfs == ERR_PTR(-ENODEV))
bat_debugfs = NULL;

if (!bat_debugfs)
goto out;

bat_debug = &bat_debuginfo_routing_algos;
file = debugfs_create_file(bat_debug->attr.name,
S_IFREG | bat_debug->attr.mode,
bat_debugfs, NULL, &bat_debug->fops);
if (!file)
pr_err("Can't add debugfs file: %s\n", bat_debug->attr.name);

out:
return;
}

void debugfs_destroy(void)
Expand Down
Loading

0 comments on commit 3ccdca7

Please sign in to comment.