alloc tables at boot time version
[unix-history] / usr / src / sys / kern / tty.c
index 1025a9a..2d61be7 100644 (file)
@@ -1,4 +1,4 @@
-/*     tty.c   3.18    %G%     */
+/*     tty.c   4.3     %G%     */
 
 /*
  * TTY subroutines common to more than one line discipline
 
 /*
  * TTY subroutines common to more than one line discipline
@@ -57,6 +57,11 @@ char maptab[] ={
        'X','Y','Z',000,000,000,000,000,
 };
 
        'X','Y','Z',000,000,000,000,000,
 };
 
+short  tthiwat[16] =
+   { 100,100,100,100,100,100,100,200,200,400,400,400,650,650,650,650 };
+short  ttlowat[16] =
+   {  30, 30, 30, 30, 30, 30, 30, 50, 50,120,120,120,125,125,125,125 };
+
 #define        OBUFSIZ 100
 
 /*
 #define        OBUFSIZ 100
 
 /*
@@ -81,9 +86,6 @@ register struct tty *tp;
        tlun.t_flushc = CTRL(o);
        tlun.t_werasc = CTRL(w);
        tlun.t_lnextc = CTRL(v);
        tlun.t_flushc = CTRL(o);
        tlun.t_werasc = CTRL(w);
        tlun.t_lnextc = CTRL(v);
-       tlun.t_lintr = CTRL(c);
-       tlun.t_lerase = CTRL(h);
-       tlun.t_lkill = CTRL(u);
        tp->t_local = 0;
        tp->t_lstate = 0;
 /* end local */
        tp->t_local = 0;
        tp->t_lstate = 0;
 /* end local */
@@ -195,10 +197,12 @@ register struct tty *tp;
 /*
  * Common code for tty ioctls.
  */
 /*
  * Common code for tty ioctls.
  */
-ttioctl(com, tp, addr, dev, flag)
+/*ARGSUSED*/
+ttioctl(tp, com, addr, flag)
 register struct tty *tp;
 caddr_t addr;
 {
 register struct tty *tp;
 caddr_t addr;
 {
+       int dev;
        unsigned t;
        struct sgttyb iocb;
        struct clist tq;
        unsigned t;
        struct sgttyb iocb;
        struct clist tq;
@@ -215,6 +219,7 @@ caddr_t addr;
                return (1);
        }
 
                return (1);
        }
 
+       dev = tp->t_dev;
        /*
         * If the ioctl involves modification,
         * insist on being able to write the device,
        /*
         * If the ioctl involves modification,
         * insist on being able to write the device,
@@ -313,6 +318,9 @@ caddr_t addr;
                                wflushtty(tp);
                        while (canon(tp)>=0) 
                                ;
                                wflushtty(tp);
                        while (canon(tp)>=0) 
                                ;
+#ifdef notdef
+                       wakeup((caddr_t)&tp->t_rawq);
+#endif
                } else if (tp->t_line == NTTYDISC) {
                        if (tp->t_flags&RAW || iocb.sg_flags&RAW ||
                            com == TIOCSETP)
                } else if (tp->t_line == NTTYDISC) {
                        if (tp->t_flags&RAW || iocb.sg_flags&RAW ||
                            com == TIOCSETP)
@@ -327,9 +335,11 @@ caddr_t addr;
                                        tp->t_local |= LPENDIN;
                                        if (tp->t_canq.c_cc)
                                                panic("ioccom canq");
                                        tp->t_local |= LPENDIN;
                                        if (tp->t_canq.c_cc)
                                                panic("ioccom canq");
+#ifdef notdef
                                        if (tp->t_chan)
                                                (void) sdata(tp->t_chan);
                                        else
                                        if (tp->t_chan)
                                                (void) sdata(tp->t_chan);
                                        else
+#endif
                                                wakeup((caddr_t)&tp->t_rawq);
                                }
                        }
                                                wakeup((caddr_t)&tp->t_rawq);
                                }
                        }
@@ -368,15 +378,6 @@ caddr_t addr;
                flushtty(tp, FREAD|FWRITE);
                break;
 
                flushtty(tp, FREAD|FWRITE);
                break;
 
-       /*
-        * Ioctl entries to line discipline
-        */
-       case DIOCSETP:
-       case DIOCGETP:
-               if ((*linesw[tp->t_line].l_ioctl)(com, tp, addr))
-                       u.u_error = ENOTTY;
-               break;
-
        /*
         * Set and fetch special characters
         */
        /*
         * Set and fetch special characters
         */