Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228181
b: refs/heads/master
c: 1341a00
h: refs/heads/master
i:
  228179: af0d662
v: v3
  • Loading branch information
Linus Lüssing authored and Greg Kroah-Hartman committed Nov 29, 2010
1 parent 877e040 commit c427778
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1623948f879069b33d07986aa95e3b9969322ff4
refs/heads/master: 1341a00ad356dfb21978ce4e5e979024558042d2
2 changes: 2 additions & 0 deletions trunk/drivers/staging/batman-adv/bat_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ BAT_ATTR_BOOL(bonding, S_IRUGO | S_IWUSR, NULL);
BAT_ATTR_BOOL(fragmentation, S_IRUGO | S_IWUSR, update_min_mtu);
static BAT_ATTR(vis_mode, S_IRUGO | S_IWUSR, show_vis_mode, store_vis_mode);
BAT_ATTR_UINT(orig_interval, S_IRUGO | S_IWUSR, 2 * JITTER, INT_MAX, NULL);
BAT_ATTR_UINT(hop_penalty, S_IRUGO | S_IWUSR, 0, TQ_MAX_VALUE, NULL);
#ifdef CONFIG_BATMAN_ADV_DEBUG
BAT_ATTR_UINT(log_level, S_IRUGO | S_IWUSR, 0, 3, NULL);
#endif
Expand All @@ -264,6 +265,7 @@ static struct bat_attribute *mesh_attrs[] = {
&bat_attr_fragmentation,
&bat_attr_vis_mode,
&bat_attr_orig_interval,
&bat_attr_hop_penalty,
#ifdef CONFIG_BATMAN_ADV_DEBUG
&bat_attr_log_level,
#endif
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/staging/batman-adv/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1
#define TQ_TOTAL_BIDRECT_LIMIT 1

#define TQ_HOP_PENALTY 10

#define NUM_WORDS (TQ_LOCAL_WINDOW_SIZE / WORD_BIT_SIZE)

#define PACKBUFF_SIZE 2000
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/batman-adv/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
static void send_outstanding_bcast_packet(struct work_struct *work);

/* apply hop penalty for a normal link */
static uint8_t hop_penalty(const uint8_t tq)
static uint8_t hop_penalty(const uint8_t tq, struct bat_priv *bat_priv)
{
return (tq * (TQ_MAX_VALUE - TQ_HOP_PENALTY)) / (TQ_MAX_VALUE);
int hop_penalty = atomic_read(&bat_priv->hop_penalty);
return (tq * (TQ_MAX_VALUE - hop_penalty)) / (TQ_MAX_VALUE);
}

/* when do we schedule our own packet to be sent */
Expand Down Expand Up @@ -330,7 +331,7 @@ void schedule_forward_packet(struct orig_node *orig_node,
}

/* apply hop penalty */
batman_packet->tq = hop_penalty(batman_packet->tq);
batman_packet->tq = hop_penalty(batman_packet->tq, bat_priv);

bat_dbg(DBG_BATMAN, bat_priv,
"Forwarding packet: tq_orig: %i, tq_avg: %i, "
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/batman-adv/soft-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ struct net_device *softif_create(char *name)
atomic_set(&bat_priv->bonding, 0);
atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE);
atomic_set(&bat_priv->orig_interval, 1000);
atomic_set(&bat_priv->hop_penalty, 10);
atomic_set(&bat_priv->log_level, 0);
atomic_set(&bat_priv->fragmentation, 1);
atomic_set(&bat_priv->bcast_queue_left, BCAST_QUEUE_LEN);
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/staging/batman-adv/sysfs-class-net-mesh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Description:
Defines the interval in milliseconds in which batman
sends its protocol messages.

What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
Date: Oct 2010
Contact: Linus Lüssing <linus.luessing@web.de>
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/vis_mode
Date: May 2010
Contact: Marek Lindner <lindner_marek@yahoo.de>
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/batman-adv/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ struct bat_priv {
atomic_t fragmentation; /* boolean */
atomic_t vis_mode; /* VIS_TYPE_* */
atomic_t orig_interval; /* uint */
atomic_t hop_penalty; /* uint */
atomic_t log_level; /* uint */
atomic_t bcast_seqno;
atomic_t bcast_queue_left;
Expand Down

0 comments on commit c427778

Please sign in to comment.