Commit 5ac05a98 authored by Chas Williams's avatar Chas Williams Committed by David S. Miller

[ATM]: [zatm] replace sleep_on() with wait_event()

Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarChas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8496efa
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/atm_zatm.h> #include <linux/atm_zatm.h>
#include <linux/capability.h> #include <linux/capability.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/wait.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/string.h> #include <asm/string.h>
...@@ -867,31 +868,21 @@ static void close_tx(struct atm_vcc *vcc) ...@@ -867,31 +868,21 @@ static void close_tx(struct atm_vcc *vcc)
struct zatm_vcc *zatm_vcc; struct zatm_vcc *zatm_vcc;
unsigned long flags; unsigned long flags;
int chan; int chan;
struct sk_buff *skb;
int once = 1;
zatm_vcc = ZATM_VCC(vcc); zatm_vcc = ZATM_VCC(vcc);
zatm_dev = ZATM_DEV(vcc->dev); zatm_dev = ZATM_DEV(vcc->dev);
chan = zatm_vcc->tx_chan; chan = zatm_vcc->tx_chan;
if (!chan) return; if (!chan) return;
DPRINTK("close_tx\n"); DPRINTK("close_tx\n");
while (skb_peek(&zatm_vcc->backlog)) { if (skb_peek(&zatm_vcc->backlog)) {
if (once) { printk("waiting for backlog to drain ...\n");
printk("waiting for backlog to drain ...\n"); event_dump();
event_dump(); wait_event(zatm_vcc->tx_wait, !skb_peek(&zatm_vcc->backlog));
once = 0; }
} if (skb_peek(&zatm_vcc->tx_queue)) {
sleep_on(&zatm_vcc->tx_wait); printk("waiting for TX queue to drain ...\n");
} event_dump();
once = 1; wait_event(zatm_vcc->tx_wait, !skb_peek(&zatm_vcc->tx_queue));
while ((skb = skb_peek(&zatm_vcc->tx_queue))) {
if (once) {
printk("waiting for TX queue to drain ... %p\n",skb);
event_dump();
once = 0;
}
DPRINTK("waiting for TX queue to drain ... %p\n",skb);
sleep_on(&zatm_vcc->tx_wait);
} }
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
#if 0 #if 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment