xref: /csrg-svn/sys/kern/tty_conf.c (revision 52404)
149594Sbostic /*-
249594Sbostic  * Copyright (c) 1982, 1986, 1991 The Regents of the University of California.
349594Sbostic  * All rights reserved.
423389Smckusick  *
549594Sbostic  * %sccs.include.redist.c%
649594Sbostic  *
7*52404Storek  *	@(#)tty_conf.c	7.7 (Berkeley) 02/05/92
823389Smckusick  */
98553Sroot 
1017096Sbloom #include "param.h"
1117096Sbloom #include "systm.h"
1217096Sbloom #include "buf.h"
1317575Sbloom #include "ioctl.h"
1417096Sbloom #include "tty.h"
1517096Sbloom #include "conf.h"
168553Sroot 
17*52404Storek #define	ttynodisc ((int (*) __P((dev_t, struct tty *)))enodev)
18*52404Storek #define	ttyerrclose ((int (*) __P((struct tty *, int flags)))enodev)
19*52404Storek #define	ttyerrio ((int (*) __P((struct tty *, struct uio *, int)))enodev)
20*52404Storek #define	ttyerrinput ((int (*) __P((int c, struct tty *)))enodev)
21*52404Storek #define	ttyerrstart ((int (*) __P((struct tty *)))enodev)
228553Sroot 
23*52404Storek int	ttyopen __P((dev_t dev, struct tty *tp));
24*52404Storek int	ttylclose __P((struct tty *tp, int flags));
25*52404Storek int	ttread __P((struct tty *, struct uio *, int flags));
26*52404Storek int	ttwrite __P((struct tty *, struct uio *, int flags));
27*52404Storek int	nullioctl __P((struct tty *tp, int cmd, caddr_t data,
28*52404Storek 			int flag, struct proc *p));
29*52404Storek int	ttyinput __P((int c, struct tty *tp));
30*52404Storek int	ttstart __P((struct tty *tp));
31*52404Storek int	ttymodem __P((struct tty *tp, int flags));
32*52404Storek int	nullmodem __P((struct tty *tp, int flags));
338553Sroot 
348553Sroot #include "tb.h"
358553Sroot #if NTB > 0
36*52404Storek int	tbopen __P((dev_t dev, struct tty *tp));
37*52404Storek int	tbclose __P((struct tty *tp, int flags));
38*52404Storek int	tbread __P((struct tty *, struct uio *, int flags));
39*52404Storek int	tbioctl __P((struct tty *tp, int cmd, caddr_t data,
40*52404Storek 			int flag, struct proc *p));
41*52404Storek int	tbinput __P((int c, struct tty *tp));
428553Sroot #endif
4346745Smckusick 
4426123Skarels #include "sl.h"
4526123Skarels #if NSL > 0
46*52404Storek int	slopen __P((dev_t dev, struct tty *tp));
47*52404Storek int	slclose __P((struct tty *tp, int flags));
48*52404Storek int	sltioctl __P((struct tty *tp, int cmd, caddr_t data,
49*52404Storek 			int flag, struct proc *p));
50*52404Storek int	slinput __P((int c, struct tty *tp));
51*52404Storek int	slstart __P((struct tty *tp));
5226123Skarels #endif
538553Sroot 
5426123Skarels 
558553Sroot struct	linesw linesw[] =
568553Sroot {
5735811Smarc 	ttyopen, ttylclose, ttread, ttwrite, nullioctl,
58*52404Storek 	ttyinput, ttstart, ttymodem,			/* 0- termios */
5937587Smarc 
60*52404Storek 	ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
61*52404Storek 	ttyerrinput, ttyerrstart, nullmodem,		/* 1- defunct */
6237587Smarc 
63*52404Storek 	ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
64*52404Storek 	ttyerrinput, ttyerrstart, nullmodem,		/* 2- defunct */
65*52404Storek 
668553Sroot #if NTB > 0
6746745Smckusick 	tbopen, tbclose, tbread, enodev, tbioctl,
68*52404Storek 	tbinput, ttstart, nullmodem,			/* 3- TABLDISC */
698553Sroot #else
70*52404Storek 	ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
71*52404Storek 	ttyerrinput, ttyerrstart, nullmodem,
728553Sroot #endif
73*52404Storek 
7426123Skarels #if NSL > 0
75*52404Storek 	slopen, slclose, ttyerrio, ttyerrio, sltioctl,
76*52404Storek 	slinput, slstart, nullmodem,			/* 4- SLIPDISC */
7726123Skarels #else
78*52404Storek 	ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
79*52404Storek 	ttyerrinput, ttyerrstart, nullmodem,
8026123Skarels #endif
818553Sroot };
828553Sroot 
838562Sroot int	nldisp = sizeof (linesw) / sizeof (linesw[0]);
8412753Ssam 
8512753Ssam /*
8612753Ssam  * Do nothing specific version of line
8712753Ssam  * discipline specific ioctl command.
8812753Ssam  */
8912753Ssam /*ARGSUSED*/
90*52404Storek nullioctl(tp, cmd, data, flags, p)
9112753Ssam 	struct tty *tp;
92*52404Storek 	int cmd;
9312753Ssam 	char *data;
9412753Ssam 	int flags;
95*52404Storek 	struct proc *p;
9612753Ssam {
9712753Ssam 
9812753Ssam #ifdef lint
99*52404Storek 	tp = tp; data = data; flags = flags; p = p;
10012753Ssam #endif
10112753Ssam 	return (-1);
10212753Ssam }
103