summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_conf.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-10-05 21:22:24 +0000
committerwollman <wollman@FreeBSD.org>1994-10-05 21:22:24 +0000
commit6fa06f29108f95d36ee569f4f109551a09f9dfac (patch)
tree1b4c3ca2510931df61bf29bb5fa2c27ef84d88f4 /sys/kern/tty_conf.c
parent4c7a70a838fddaab862576e2dd0d34ae4d39e01a (diff)
downloadFreeBSD-src-6fa06f29108f95d36ee569f4f109551a09f9dfac.zip
FreeBSD-src-6fa06f29108f95d36ee569f4f109551a09f9dfac.tar.gz
Allow for loadable line disciplines (eventually).
Diffstat (limited to 'sys/kern/tty_conf.c')
-rw-r--r--sys/kern/tty_conf.c47
1 files changed, 12 insertions, 35 deletions
diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c
index fe5f3ec..6b9bf4f 100644
--- a/sys/kern/tty_conf.c
+++ b/sys/kern/tty_conf.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty_conf.c 8.4 (Berkeley) 1/21/94
- * $Id$
+ * $Id: tty_conf.c,v 1.3 1994/08/02 07:42:50 davidg Exp $
*/
#include <sys/param.h>
@@ -56,28 +56,15 @@
int nullioctl __P((struct tty *tp, int cmd, caddr_t data,
int flag, struct proc *p));
-#include "tb.h"
-#if NTB > 0
-int tbopen __P((dev_t dev, struct tty *tp));
-int tbclose __P((struct tty *tp, int flags));
-int tbread __P((struct tty *, struct uio *, int flags));
-int tbioctl __P((struct tty *tp, int cmd, caddr_t data,
- int flag, struct proc *p));
-int tbinput __P((int c, struct tty *tp));
-#endif
-
-#include "sl.h"
-#if NSL > 0
-int slopen __P((dev_t dev, struct tty *tp));
-int slclose __P((struct tty *tp, int flags));
-int sltioctl __P((struct tty *tp, int cmd, caddr_t data,
- int flag, struct proc *p));
-int slinput __P((int c, struct tty *tp));
-int slstart __P((struct tty *tp));
+#ifndef MAXLDISC
+#define MAXLDISC 8
#endif
+#define NODISC(n) \
+ { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, \
+ ttyerrinput, ttyerrstart, nullmodem },
-struct linesw linesw[] =
+struct linesw linesw[MAXLDISC] =
{
{ ttyopen, ttylclose, ttread, ttwrite, nullioctl,
ttyinput, ttstart, ttymodem }, /* 0- termios */
@@ -93,21 +80,11 @@ struct linesw linesw[] =
ttyerrinput, ttyerrstart, nullmodem },
#endif
-#if NTB > 0
- { tbopen, tbclose, tbread, enodev, tbioctl,
- tbinput, ttstart, nullmodem }, /* 3- TABLDISC */
-#else
- { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
- ttyerrinput, ttyerrstart, nullmodem },
-#endif
-
-#if NSL > 0
- { slopen, slclose, ttyerrio, ttyerrio, sltioctl,
- slinput, slstart, nullmodem }, /* 4- SLIPDISC */
-#else
- { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
- ttyerrinput, ttyerrstart, nullmodem },
-#endif
+ NODISC(3) /* TABLDISC */
+ NODISC(4) /* SLIPDISC */
+ NODISC(5) /* PPPDISC */
+ NODISC(6) /* loadable */
+ NODISC(7) /* loadable */
};
int nlinesw = sizeof (linesw) / sizeof (linesw[0]);
OpenPOWER on IntegriCloud