]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/specialix.c
Merge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / drivers / char / specialix.c
index 455855631aeff70f441e26be40f3a745a4cb5609..4b5b5b78acb4835c3e58a212b92c87d035e512c5 100644 (file)
@@ -178,9 +178,6 @@ static int sx_poll = HZ;
         ASYNC_SPD_HI       | ASYNC_SPEED_VHI    | ASYNC_SESSION_LOCKOUT | \
         ASYNC_PGRP_LOCKOUT | ASYNC_CALLOUT_NOHUP)
 
-#undef RS_EVENT_WRITE_WAKEUP
-#define RS_EVENT_WRITE_WAKEUP  0
-
 static struct tty_driver *specialix_driver;
 
 static struct specialix_board sx_board[SX_NBOARD] =  {
@@ -446,8 +443,7 @@ void missed_irq (unsigned long data)
        spin_unlock_irqrestore(&bp->lock, flags);
        if (irq) {
                printk (KERN_INFO "Missed interrupt... Calling int from timer. \n");
-               sx_interrupt (((struct specialix_board *)data)->irq,
-                               (void*)data);
+               sx_interrupt (-1, bp);
        }
        mod_timer(&missed_irq_timer, jiffies + sx_poll);
 }
@@ -602,17 +598,6 @@ static int sx_probe(struct specialix_board *bp)
  *  Interrupt processing routines.
  * */
 
-static inline void sx_mark_event(struct specialix_port * port, int event)
-{
-       func_enter();
-
-       set_bit(event, &port->event);
-       schedule_work(&port->tqueue);
-
-       func_exit();
-}
-
-
 static inline struct specialix_port * sx_get_port(struct specialix_board * bp,
                                               unsigned char const * what)
 {
@@ -809,7 +794,7 @@ static inline void sx_transmit(struct specialix_board * bp)
                sx_out(bp, CD186x_IER, port->IER);
        }
        if (port->xmit_cnt <= port->wakeup_chars)
-               sx_mark_event(port, RS_EVENT_WRITE_WAKEUP);
+               tty_wakeup(tty);
 
        func_exit();
 }
@@ -839,7 +824,7 @@ static inline void sx_check_modem(struct specialix_board * bp)
                        wake_up_interruptible(&port->open_wait);
                } else {
                        dprintk (SX_DEBUG_SIGNALS, "Sending HUP.\n");
-                       schedule_work(&port->tqueue_hangup);
+                       tty_hangup(tty);
                }
        }
 
@@ -849,7 +834,7 @@ static inline void sx_check_modem(struct specialix_board * bp)
                        tty->hw_stopped = 0;
                        port->IER |= IER_TXRDY;
                        if (port->xmit_cnt <= port->wakeup_chars)
-                               sx_mark_event(port, RS_EVENT_WRITE_WAKEUP);
+                               tty_wakeup(tty);
                } else {
                        tty->hw_stopped = 1;
                        port->IER &= ~IER_TXRDY;
@@ -861,7 +846,7 @@ static inline void sx_check_modem(struct specialix_board * bp)
                        tty->hw_stopped = 0;
                        port->IER |= IER_TXRDY;
                        if (port->xmit_cnt <= port->wakeup_chars)
-                               sx_mark_event(port, RS_EVENT_WRITE_WAKEUP);
+                               tty_wakeup(tty);
                } else {
                        tty->hw_stopped = 1;
                        port->IER &= ~IER_TXRDY;
@@ -876,23 +861,22 @@ static inline void sx_check_modem(struct specialix_board * bp)
 
 
 /* The main interrupt processing routine */
-static irqreturn_t sx_interrupt(int irq, void *dev_id)
+static irqreturn_t sx_interrupt(int dummy, void *dev_id)
 {
        unsigned char status;
        unsigned char ack;
-       struct specialix_board *bp;
+       struct specialix_board *bp = dev_id;
        unsigned long loop = 0;
        int saved_reg;
        unsigned long flags;
 
        func_enter();
 
-       bp = dev_id;
        spin_lock_irqsave(&bp->lock, flags);
 
        dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1);
        if (!(bp->flags & SX_BOARD_ACTIVE)) {
-               dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq);
+               dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", bp->irq);
                spin_unlock_irqrestore(&bp->lock, flags);
                func_exit();
                return IRQ_NONE;
@@ -1618,7 +1602,6 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
        tty_ldisc_flush(tty);
        spin_lock_irqsave(&port->lock, flags);
        tty->closing = 0;
-       port->event = 0;
        port->tty = NULL;
        spin_unlock_irqrestore(&port->lock, flags);
        if (port->blocked_open) {
@@ -2124,7 +2107,6 @@ static void sx_throttle(struct tty_struct * tty)
        sx_out(bp, CD186x_CAR, port_No(port));
        spin_unlock_irqrestore(&bp->lock, flags);
        if (I_IXOFF(tty)) {
-               spin_unlock_irqrestore(&bp->lock, flags);
                sx_wait_CCR(bp);
                spin_lock_irqsave(&bp->lock, flags);
                sx_out(bp, CD186x_CCR, CCR_SSCH2);
@@ -2235,32 +2217,6 @@ static void sx_start(struct tty_struct * tty)
        func_exit();
 }
 
-
-/*
- * This routine is called from the work-queue when the interrupt
- * routine has signalled that a hangup has occurred.  The path of
- * hangup processing is:
- *
- *     serial interrupt routine -> (workqueue) ->
- *     do_sx_hangup() -> tty->hangup() -> sx_hangup()
- *
- */
-static void do_sx_hangup(struct work_struct *work)
-{
-       struct specialix_port   *port =
-               container_of(work, struct specialix_port, tqueue_hangup);
-       struct tty_struct       *tty;
-
-       func_enter();
-
-       tty = port->tty;
-       if (tty)
-               tty_hangup(tty);        /* FIXME: module removal race here */
-
-       func_exit();
-}
-
-
 static void sx_hangup(struct tty_struct * tty)
 {
        struct specialix_port *port = (struct specialix_port *)tty->driver_data;
@@ -2278,7 +2234,6 @@ static void sx_hangup(struct tty_struct * tty)
 
        sx_shutdown_port(bp, port);
        spin_lock_irqsave(&port->lock, flags);
-       port->event = 0;
        bp->count -= port->count;
        if (bp->count < 0) {
                printk(KERN_ERR "sx%d: sx_hangup: bad board count: %d port: %d\n",
@@ -2320,26 +2275,6 @@ static void sx_set_termios(struct tty_struct * tty, struct ktermios * old_termio
        }
 }
 
-
-static void do_softint(struct work_struct *work)
-{
-       struct specialix_port   *port =
-               container_of(work, struct specialix_port, tqueue);
-       struct tty_struct       *tty;
-
-       func_enter();
-
-       if(!(tty = port->tty)) {
-               func_exit();
-               return;
-       }
-
-       if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &port->event))
-               tty_wakeup(tty);
-
-       func_exit();
-}
-
 static const struct tty_operations sx_ops = {
        .open  = sx_open,
        .close = sx_close,
@@ -2397,8 +2332,6 @@ static int sx_init_drivers(void)
        memset(sx_port, 0, sizeof(sx_port));
        for (i = 0; i < SX_NPORT * SX_NBOARD; i++) {
                sx_port[i].magic = SPECIALIX_MAGIC;
-               INIT_WORK(&sx_port[i].tqueue, do_softint);
-               INIT_WORK(&sx_port[i].tqueue_hangup, do_sx_hangup);
                sx_port[i].close_delay = 50 * HZ/100;
                sx_port[i].closing_wait = 3000 * HZ/100;
                init_waitqueue_head(&sx_port[i].open_wait);