diff options
author | Simon Wunderlich <siwu@hrz.tu-chemnitz.de> | 2010-09-05 01:58:23 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-05 00:29:44 -0700 |
commit | 7d02674f71e6369bb125354b23fd0abaa2edfcab (patch) | |
tree | 4aabb0dbe82f7272974750cf74d449b56201eeaf /drivers/staging/batman-adv/send.c | |
parent | 8bb22a38d6083d751075829e84421b139dabb460 (diff) | |
download | op-kernel-dev-7d02674f71e6369bb125354b23fd0abaa2edfcab.zip op-kernel-dev-7d02674f71e6369bb125354b23fd0abaa2edfcab.tar.gz |
Staging: batman-adv: move queue counters into bat_priv
to support multiple mesh devices later, we need to move global variables
like the queues into corresponding private structs bat_priv of the soft
devices.
Note that this patch still has a lot of FIXMEs and depends on the global
soft_device variable. This should be resolved later, e.g. by referencing
the parent soft device in batman_if.
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>
Diffstat (limited to 'drivers/staging/batman-adv/send.c')
-rw-r--r-- | drivers/staging/batman-adv/send.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c index da3c82e4..e874cae 100644 --- a/drivers/staging/batman-adv/send.c +++ b/drivers/staging/batman-adv/send.c @@ -404,7 +404,7 @@ int add_bcast_packet_to_list(struct sk_buff *skb) /* FIXME: each batman_if will be attached to a softif */ struct bat_priv *bat_priv = netdev_priv(soft_device); - if (!atomic_dec_not_zero(&bcast_queue_left)) { + if (!atomic_dec_not_zero(&bat_priv->bcast_queue_left)) { bat_dbg(DBG_BATMAN, bat_priv, "bcast packet queue full\n"); goto out; } @@ -436,7 +436,7 @@ int add_bcast_packet_to_list(struct sk_buff *skb) packet_free: kfree(forw_packet); out_and_inc: - atomic_inc(&bcast_queue_left); + atomic_inc(&bat_priv->bcast_queue_left); out: return NETDEV_TX_BUSY; } @@ -450,6 +450,8 @@ static void send_outstanding_bcast_packet(struct work_struct *work) container_of(delayed_work, struct forw_packet, delayed_work); unsigned long flags; struct sk_buff *skb1; + /* FIXME: each batman_if will be attached to a softif */ + struct bat_priv *bat_priv = netdev_priv(soft_device); spin_lock_irqsave(&forw_bcast_list_lock, flags); hlist_del(&forw_packet->list); @@ -479,7 +481,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work) out: forw_packet_free(forw_packet); - atomic_inc(&bcast_queue_left); + atomic_inc(&bat_priv->bcast_queue_left); } void send_outstanding_bat_packet(struct work_struct *work) @@ -489,6 +491,8 @@ void send_outstanding_bat_packet(struct work_struct *work) struct forw_packet *forw_packet = container_of(delayed_work, struct forw_packet, delayed_work); unsigned long flags; + /* FIXME: each batman_if will be attached to a softif */ + struct bat_priv *bat_priv = netdev_priv(soft_device); spin_lock_irqsave(&forw_bat_list_lock, flags); hlist_del(&forw_packet->list); @@ -510,7 +514,7 @@ void send_outstanding_bat_packet(struct work_struct *work) out: /* don't count own packet */ if (!forw_packet->own) - atomic_inc(&batman_queue_left); + atomic_inc(&bat_priv->batman_queue_left); forw_packet_free(forw_packet); } |