xref: /csrg-svn/sys/kern/tty_conf.c (revision 68171)
149594Sbostic /*-
263178Sbostic  * Copyright (c) 1982, 1986, 1991, 1993
363178Sbostic  *	The Regents of the University of California.  All rights reserved.
465771Sbostic  * (c) UNIX System Laboratories, Inc.
565771Sbostic  * All or some portions of this file are derived from material licensed
665771Sbostic  * to the University of California by American Telephone and Telegraph
765771Sbostic  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
865771Sbostic  * the permission of UNIX System Laboratories, Inc.
923389Smckusick  *
1049594Sbostic  * %sccs.include.redist.c%
1149594Sbostic  *
12*68171Scgd  *	@(#)tty_conf.c	8.5 (Berkeley) 01/09/95
1323389Smckusick  */
148553Sroot 
1556517Sbostic #include <sys/param.h>
1656517Sbostic #include <sys/systm.h>
1756517Sbostic #include <sys/buf.h>
1856517Sbostic #include <sys/ioctl.h>
1956517Sbostic #include <sys/proc.h>
2056517Sbostic #include <sys/tty.h>
2156517Sbostic #include <sys/conf.h>
228553Sroot 
2352404Storek #define	ttynodisc ((int (*) __P((dev_t, struct tty *)))enodev)
2452404Storek #define	ttyerrclose ((int (*) __P((struct tty *, int flags)))enodev)
2552404Storek #define	ttyerrio ((int (*) __P((struct tty *, struct uio *, int)))enodev)
2652404Storek #define	ttyerrinput ((int (*) __P((int c, struct tty *)))enodev)
2752404Storek #define	ttyerrstart ((int (*) __P((struct tty *)))enodev)
288553Sroot 
29*68171Scgd int	nullioctl __P((struct tty *tp, u_long cmd, caddr_t data,
3052404Storek 			int flag, struct proc *p));
318553Sroot 
328553Sroot #include "tb.h"
338553Sroot #if NTB > 0
3452404Storek int	tbopen __P((dev_t dev, struct tty *tp));
3552404Storek int	tbclose __P((struct tty *tp, int flags));
3652404Storek int	tbread __P((struct tty *, struct uio *, int flags));
37*68171Scgd int	tbioctl __P((struct tty *tp, u_long cmd, caddr_t data,
3852404Storek 			int flag, struct proc *p));
3952404Storek int	tbinput __P((int c, struct tty *tp));
408553Sroot #endif
4146745Smckusick 
4226123Skarels #include "sl.h"
4326123Skarels #if NSL > 0
4452404Storek int	slopen __P((dev_t dev, struct tty *tp));
4552404Storek int	slclose __P((struct tty *tp, int flags));
46*68171Scgd int	sltioctl __P((struct tty *tp, u_long cmd, caddr_t data,
4752404Storek 			int flag, struct proc *p));
4852404Storek int	slinput __P((int c, struct tty *tp));
4952404Storek int	slstart __P((struct tty *tp));
5026123Skarels #endif
518553Sroot 
5226123Skarels 
538553Sroot struct	linesw linesw[] =
548553Sroot {
5560516Storek 	{ ttyopen, ttylclose, ttread, ttwrite, nullioctl,
5660516Storek 	  ttyinput, ttstart, ttymodem },		/* 0- termios */
5737587Smarc 
5860516Storek 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
5960516Storek 	  ttyerrinput, ttyerrstart, nullmodem },	/* 1- defunct */
6037587Smarc 
6160516Storek 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
6260516Storek 	  ttyerrinput, ttyerrstart, nullmodem },	/* 2- defunct */
6352404Storek 
648553Sroot #if NTB > 0
6560516Storek 	{ tbopen, tbclose, tbread, enodev, tbioctl,
6660516Storek 	  tbinput, ttstart, nullmodem },		/* 3- TABLDISC */
678553Sroot #else
6860516Storek 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
6960516Storek 	  ttyerrinput, ttyerrstart, nullmodem },
708553Sroot #endif
7152404Storek 
7226123Skarels #if NSL > 0
7360516Storek 	{ slopen, slclose, ttyerrio, ttyerrio, sltioctl,
7460516Storek 	  slinput, slstart, nullmodem },		/* 4- SLIPDISC */
7526123Skarels #else
7660516Storek 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
7760516Storek 	  ttyerrinput, ttyerrstart, nullmodem },
7826123Skarels #endif
798553Sroot };
808553Sroot 
8164592Sbostic int	nlinesw = sizeof (linesw) / sizeof (linesw[0]);
8212753Ssam 
8312753Ssam /*
8412753Ssam  * Do nothing specific version of line
8512753Ssam  * discipline specific ioctl command.
8612753Ssam  */
8712753Ssam /*ARGSUSED*/
8852404Storek nullioctl(tp, cmd, data, flags, p)
8912753Ssam 	struct tty *tp;
90*68171Scgd 	u_long cmd;
9112753Ssam 	char *data;
9212753Ssam 	int flags;
9352404Storek 	struct proc *p;
9412753Ssam {
9512753Ssam 
9612753Ssam #ifdef lint
9752404Storek 	tp = tp; data = data; flags = flags; p = p;
9812753Ssam #endif
9912753Ssam 	return (-1);
10012753Ssam }
101