2.5.34 s390 fixes (9/10): ctc driver.

2.5.34 s390 fixes (9/10): ctc driver.

Post by Martin Schwidefsk » Fri, 13 Sep 2002 01:30:08



Hi Linus,
replace old style bottom half by a tasklet in the ctc driver.

blue skies,
  Martin.

diff -urN linux-2.5.34/drivers/s390/net/ctcmain.c linux-2.5.34-s390/drivers/s390/net/ctcmain.c
--- linux-2.5.34/drivers/s390/net/ctcmain.c     Mon Sep  9 19:35:08 2002

 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/sched.h>
+#include <linux/tqueue.h>

 #include <linux/signal.h>
 #include <linux/string.h>
diff -urN linux-2.5.34/drivers/s390/net/ctctty.c linux-2.5.34-s390/drivers/s390/net/ctctty.c
--- linux-2.5.34/drivers/s390/net/ctctty.c      Mon Sep  9 19:35:12 2002

   wait_queue_head_t    open_wait;
   wait_queue_head_t    close_wait;
   struct semaphore      write_sem;
-  struct tq_struct      tq;
+  struct tasklet_struct tasklet;
   struct timer_list     stoptimer;
 } ctc_tty_info;

         */
        skb_queue_tail(&info->rx_queue, skb);
        /* Schedule dequeuing */
-       queue_task(&info->tq, &tq_immediate);
-       mark_bh(IMMEDIATE_BH);
+       tasklet_schedule(&info->tasklet);
 }


        skb_reserve(skb, skb_res);
        *(skb_put(skb, 1)) = c;
        skb_queue_head(&info->tx_queue, skb);
-       queue_task(&info->tq, &tq_immediate);
-       mark_bh(IMMEDIATE_BH);
+       tasklet_schedule(&info->tasklet);
 }


        if (ctc_tty_shuttingdown)
                return;
        info->flags |= CTC_ASYNC_TX_LINESTAT;
-       queue_task(&info->tq, &tq_immediate);
-       mark_bh(IMMEDIATE_BH);
+       tasklet_schedule(&info->tasklet);
 }


        }
        if (skb_queue_len(&info->tx_queue)) {
                info->lsr &= ~UART_LSR_TEMT;
-               queue_task(&info->tq, &tq_immediate);
-               mark_bh(IMMEDIATE_BH);
+               tasklet_schedule(&info->tasklet);
        }
        if (from_user)

                return;
        if (tty->stopped || tty->hw_stopped || (!skb_queue_len(&info->tx_queue)))
                return;
-       queue_task(&info->tq, &tq_immediate);
-       mark_bh(IMMEDIATE_BH);
+       tasklet_schedule(&info->tasklet);
 }


  * the lower levels.
  */
 static void
-ctc_tty_task(ctc_tty_info *info)
+ctc_tty_task(unsigned long arg)
 {
+       ctc_tty_info *info = (void *)arg;
        unsigned long saveflags;
        int again;

                        info->lsr |= UART_LSR_TEMT;
                again |= ctc_tty_readmodem(info);
                if (again) {
-                       queue_task(&info->tq, &tq_immediate);
-                       mark_bh(IMMEDIATE_BH);
+                       tasklet_schedule(&info->tasklet);
                }
        }

        for (i = 0; i < CTC_TTY_MAX_DEVICES; i++) {
                info = &driver->info[i];
                init_MUTEX(&info->write_sem);
-#if LINUX_VERSION_CODE >= 0x020400
-               INIT_LIST_HEAD(&info->tq.list);
-#else
-               info->tq.next    = NULL;
-#endif
-               info->tq.sync    = 0;
-               info->tq.routine = (void *)(void *)ctc_tty_task;
-               info->tq.data    = info;
+               tasklet_init(&info->tasklet, ctc_tty_task,
+                               (unsigned long) info);
                info->magic = CTC_ASYNC_MAGIC;
                info->line = i;

                kfree(driver);
                driver = NULL;
        } else {
-               int i;
-
-               for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)
-                       driver->info[i].tq.routine = NULL;
                tty_unregister_driver(&driver->ctc_tty_device);
        }
        spin_unlock_irqrestore(&ctc_tty_lock, saveflags);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/