summaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/send.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2010-05-07 21:47:18 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-11 13:42:39 -0700
commit47fdf097c348673dced571da8a15939005219da0 (patch)
treef5fbc972cf243db502a225a08ed18bd6eee56834 /drivers/staging/batman-adv/send.c
parent0887635b26e0cb6369c0438e55d9323d3aef3f69 (diff)
downloadop-kernel-dev-47fdf097c348673dced571da8a15939005219da0.zip
op-kernel-dev-47fdf097c348673dced571da8a15939005219da0.tar.gz
Staging: batman-adv: convert multiple /proc files to use sysfs
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>
Diffstat (limited to 'drivers/staging/batman-adv/send.c')
-rw-r--r--drivers/staging/batman-adv/send.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c
index 29b684b..32d1756 100644
--- a/drivers/staging/batman-adv/send.c
+++ b/drivers/staging/batman-adv/send.c
@@ -44,7 +44,7 @@ static unsigned long own_send_time(void)
}
/* when do we schedule a forwarded packet to be sent */
-static unsigned long forward_send_time(void)
+static unsigned long forward_send_time(struct bat_priv *bat_priv)
{
return jiffies + (((random32() % (JITTER/2)) * HZ) / 1000);
}
@@ -239,6 +239,8 @@ static void rebuild_batman_packet(struct batman_if *batman_if)
void schedule_own_packet(struct batman_if *batman_if)
{
+ /* FIXME: each batman_if will be attached to a softif */
+ struct bat_priv *bat_priv = netdev_priv(soft_device);
unsigned long send_time;
struct batman_packet *batman_packet;
int vis_server = atomic_read(&vis_mode);
@@ -277,7 +279,9 @@ void schedule_own_packet(struct batman_if *batman_if)
slide_own_bcast_window(batman_if);
send_time = own_send_time();
add_bat_packet_to_list(batman_if->packet_buff,
- batman_if->packet_len, batman_if, 1, send_time);
+ batman_if->packet_len,
+ batman_if, 1, send_time,
+ bat_priv);
}
void schedule_forward_packet(struct orig_node *orig_node,
@@ -286,6 +290,8 @@ void schedule_forward_packet(struct orig_node *orig_node,
uint8_t directlink, int hna_buff_len,
struct batman_if *if_incoming)
{
+ /* FIXME: each batman_if will be attached to a softif */
+ struct bat_priv *bat_priv = netdev_priv(soft_device);
unsigned char in_tq, in_ttl, tq_avg = 0;
unsigned long send_time;
@@ -329,10 +335,11 @@ void schedule_forward_packet(struct orig_node *orig_node,
else
batman_packet->flags &= ~DIRECTLINK;
- send_time = forward_send_time();
+ send_time = forward_send_time(bat_priv);
add_bat_packet_to_list((unsigned char *)batman_packet,
sizeof(struct batman_packet) + hna_buff_len,
- if_incoming, 0, send_time);
+ if_incoming, 0, send_time,
+ bat_priv);
}
static void forw_packet_free(struct forw_packet *forw_packet)
OpenPOWER on IntegriCloud