Commit 44bf898d authored by Linus Torvalds's avatar Linus Torvalds

Update isicom driver to work queue abstraction.

parent a0a34d57
...@@ -80,8 +80,6 @@ static struct tty_driver *isicom_normal; ...@@ -80,8 +80,6 @@ static struct tty_driver *isicom_normal;
static struct isi_board isi_card[BOARD_COUNT]; static struct isi_board isi_card[BOARD_COUNT];
static struct isi_port isi_ports[PORT_COUNT]; static struct isi_port isi_ports[PORT_COUNT];
DECLARE_TASK_QUEUE(tq_isicom);
static struct timer_list tx; static struct timer_list tx;
static char re_schedule = 1; static char re_schedule = 1;
#ifdef ISICOM_DEBUG #ifdef ISICOM_DEBUG
...@@ -354,12 +352,6 @@ static inline int isicom_paranoia_check(struct isi_port const * port, char *name ...@@ -354,12 +352,6 @@ static inline int isicom_paranoia_check(struct isi_port const * port, char *name
return 0; return 0;
} }
static inline void schedule_bh(struct isi_port * port)
{
queue_task(&port->bh_tqueue, &tq_isicom);
mark_bh(ISICOM_BH);
}
/* Transmitter */ /* Transmitter */
static void isicom_tx(unsigned long _data) static void isicom_tx(unsigned long _data)
...@@ -464,7 +456,7 @@ static void isicom_tx(unsigned long _data) ...@@ -464,7 +456,7 @@ static void isicom_tx(unsigned long _data)
if (port->xmit_cnt <= 0) if (port->xmit_cnt <= 0)
port->status &= ~ISI_TXOK; port->status &= ~ISI_TXOK;
if (port->xmit_cnt <= WAKEUP_CHARS) if (port->xmit_cnt <= WAKEUP_CHARS)
schedule_bh(port); schedule_work(&port->bh_tqueue);
restore_flags(flags); restore_flags(flags);
} }
...@@ -483,12 +475,6 @@ static void isicom_tx(unsigned long _data) ...@@ -483,12 +475,6 @@ static void isicom_tx(unsigned long _data)
/* Interrupt handlers */ /* Interrupt handlers */
static void do_isicom_bh(void)
{
run_task_queue(&tq_isicom);
}
static void isicom_bottomhalf(void * data) static void isicom_bottomhalf(void * data)
{ {
...@@ -584,7 +570,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id, ...@@ -584,7 +570,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
printk(KERN_DEBUG "ISICOM: interrupt: DCD->low.\n"); printk(KERN_DEBUG "ISICOM: interrupt: DCD->low.\n");
#endif #endif
port->status &= ~ISI_DCD; port->status &= ~ISI_DCD;
schedule_task(&port->hangup_tq); schedule_work(&port->hangup_tq);
} }
} }
else { else {
...@@ -611,7 +597,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id, ...@@ -611,7 +597,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
port->tty->hw_stopped = 0; port->tty->hw_stopped = 0;
/* start tx ing */ /* start tx ing */
port->status |= (ISI_TXOK | ISI_CTS); port->status |= (ISI_TXOK | ISI_CTS);
schedule_bh(port); schedule_work(&port->bh_tqueue);
} }
} }
else { else {
...@@ -650,7 +636,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id, ...@@ -650,7 +636,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
tty->flip.count++; tty->flip.count++;
if (port->flags & ASYNC_SAK) if (port->flags & ASYNC_SAK)
do_SAK(tty); do_SAK(tty);
queue_task(&tty->flip.tqueue, &tq_timer); schedule_delayed_work(&tty->flip.work, 1);
break; break;
case 2: /* Statistics */ case 2: /* Statistics */
...@@ -688,7 +674,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id, ...@@ -688,7 +674,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
byte_count -= 2; byte_count -= 2;
} }
} }
queue_task(&tty->flip.tqueue, &tq_timer); schedule_delayed_work(&tty->flip.work, 1);
} }
if (card->isa == YES) if (card->isa == YES)
ClearInterrupt(base); ClearInterrupt(base);
...@@ -1806,10 +1792,6 @@ static int isicom_init(void) ...@@ -1806,10 +1792,6 @@ static int isicom_init(void)
return 0; return 0;
} }
/* initialize bottom half */
init_bh(ISICOM_BH, do_isicom_bh);
memset(isi_ports, 0, sizeof(isi_ports)); memset(isi_ports, 0, sizeof(isi_ports));
for (card = 0; card < BOARD_COUNT; card++) { for (card = 0; card < BOARD_COUNT; card++) {
port = &isi_ports[card * 16]; port = &isi_ports[card * 16];
...@@ -1821,10 +1803,8 @@ static int isicom_init(void) ...@@ -1821,10 +1803,8 @@ static int isicom_init(void)
port->channel = channel; port->channel = channel;
port->close_delay = 50 * HZ/100; port->close_delay = 50 * HZ/100;
port->closing_wait = 3000 * HZ/100; port->closing_wait = 3000 * HZ/100;
port->hangup_tq.routine = do_isicom_hangup; INIT_WORK(&port->hangup_tq, do_isicom_hangup, port);
port->hangup_tq.data = port; INIT_WORK(&port->bh_tqueue, isicom_bottomhalf, port);
port->bh_tqueue.routine = isicom_bottomhalf;
port->bh_tqueue.data = port;
port->status = 0; port->status = 0;
init_waitqueue_head(&port->open_wait); init_waitqueue_head(&port->open_wait);
init_waitqueue_head(&port->close_wait); init_waitqueue_head(&port->close_wait);
...@@ -1956,8 +1936,6 @@ void cleanup_module(void) ...@@ -1956,8 +1936,6 @@ void cleanup_module(void)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ); schedule_timeout(HZ);
remove_bh(ISICOM_BH);
#ifdef ISICOM_DEBUG #ifdef ISICOM_DEBUG
printk("ISICOM: isicom_tx tx_count = %ld.\n", tx_count); printk("ISICOM: isicom_tx tx_count = %ld.\n", tx_count);
#endif #endif
......
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