Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199870
b: refs/heads/master
c: 5f411a9
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Jun 4, 2010
1 parent fe22f45 commit 0721675
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: 9d20015391dfc47f6371492925cc0333ac403414
refs/heads/master: 5f411a90ee163801434775264b4f9932f1de9e4c
24 changes: 15 additions & 9 deletions trunk/drivers/staging/batman-adv/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ void send_outstanding_bcast_packet(struct work_struct *work)
hlist_del(&forw_packet->list);
spin_unlock_irqrestore(&forw_bcast_list_lock, flags);

if (atomic_read(&module_state) == MODULE_DEACTIVATING)
goto out;

/* rebroadcast packet */
rcu_read_lock();
list_for_each_entry_rcu(batman_if, &if_list, list) {
Expand All @@ -453,15 +456,15 @@ void send_outstanding_bcast_packet(struct work_struct *work)

forw_packet->num_packets++;

/* if we still have some more bcasts to send and we are not shutting
* down */
if ((forw_packet->num_packets < 3) &&
(atomic_read(&module_state) != MODULE_DEACTIVATING))
/* if we still have some more bcasts to send */
if (forw_packet->num_packets < 3) {
_add_bcast_packet_to_list(forw_packet, ((5 * HZ) / 1000));
else {
forw_packet_free(forw_packet);
atomic_inc(&bcast_queue_left);
return;
}

out:
forw_packet_free(forw_packet);
atomic_inc(&bcast_queue_left);
}

void send_outstanding_bat_packet(struct work_struct *work)
Expand All @@ -476,17 +479,20 @@ void send_outstanding_bat_packet(struct work_struct *work)
hlist_del(&forw_packet->list);
spin_unlock_irqrestore(&forw_bat_list_lock, flags);

if (atomic_read(&module_state) == MODULE_DEACTIVATING)
goto out;

send_packet(forw_packet);

/**
* we have to have at least one packet in the queue
* to determine the queues wake up time unless we are
* shutting down
*/
if ((forw_packet->own) &&
(atomic_read(&module_state) != MODULE_DEACTIVATING))
if (forw_packet->own)
schedule_own_packet(forw_packet->if_incoming);

out:
/* don't count own packet */
if (!forw_packet->own)
atomic_inc(&batman_queue_left);
Expand Down

0 comments on commit 0721675

Please sign in to comment.