2 * IBM/3270 Driver -- Copyright (C) 2000, 2001 UTS Global LLC
4 * tubttyscl.c -- Linemode tty driver scroll-timing functions
10 * Author: Richard Hitt
13 void tty3270_scl_settimer(tub_t *);
14 void tty3270_scl_resettimer(tub_t *);
15 static void tty3270_scl_timeout(unsigned long);
18 tty3270_scl_settimer(tub_t *tubp)
20 struct timer_list *tp = &tubp->tty_stimer;
22 if (tubp->flags & TUB_SCROLLTIMING)
24 if (tubp->tty_scrolltime == 0)
28 tp->expires = jiffies + HZ * tubp->tty_scrolltime;
29 tp->data = (unsigned long)tubp;
30 tp->function = tty3270_scl_timeout;
32 tubp->flags |= TUB_SCROLLTIMING;
36 tty3270_scl_resettimer(tub_t *tubp)
38 struct timer_list *tp = &tubp->tty_stimer;
40 if ((tubp->flags & TUB_SCROLLTIMING) == 0)
44 tubp->flags &= ~TUB_SCROLLTIMING;
48 tty3270_scl_timeout(unsigned long data)
50 tub_t *tubp = (void *)data;
53 TUBLOCK(tubp->irq, flags);
54 tubp->stat = TBS_RUNNING;
55 tty3270_scl_resettimer(tubp);
56 tubp->cmd = TBC_CLRUPDLOG;
58 TUBUNLOCK(tubp->irq, flags);
62 tty3270_scl_set(tub_t *tubp, char *buf, int count)
64 if (strncmp(buf, "scrolltime=", 11) == 0) {
65 tubp->tty_scrolltime =
66 simple_strtoul(buf + 11, 0, 0);
73 tty3270_scl_init(tub_t *tubp)
75 extern int tubscrolltime;
77 tubp->tty_scrolltime = tubscrolltime;
78 if (tubp->tty_scrolltime < 0)
79 tubp->tty_scrolltime = DEFAULT_SCROLLTIME;
84 tty3270_scl_fini(tub_t *tubp)
86 if ((tubp->flags & TUB_OPEN_STET) == 0)
87 tty3270_scl_resettimer(tubp);