xref: /csrg-svn/sys/kern/tty_conf.c (revision 25391)
123389Smckusick /*
223389Smckusick  * Copyright (c) 1982 Regents of the University of California.
323389Smckusick  * All rights reserved.  The Berkeley software License Agreement
423389Smckusick  * specifies the terms and conditions for redistribution.
523389Smckusick  *
6*25391Skarels  *	@(#)tty_conf.c	6.6 (Berkeley) 11/04/85
723389Smckusick  */
88553Sroot 
917096Sbloom #include "param.h"
1017096Sbloom #include "systm.h"
1117096Sbloom #include "buf.h"
1217575Sbloom #include "ioctl.h"
1317096Sbloom #include "tty.h"
1417096Sbloom #include "conf.h"
158553Sroot 
168553Sroot int	nodev();
178553Sroot int	nulldev();
188553Sroot 
19*25391Skarels int	ttyopen(),ttylclose(),ttread(),ttwrite(),nullioctl(),ttstart();
20*25391Skarels int	ttymodem(), nullmodem(), ttyinput();
218553Sroot 
228553Sroot #include "bk.h"
238553Sroot #if NBK > 0
248553Sroot int	bkopen(),bkclose(),bkread(),bkinput(),bkioctl();
258553Sroot #endif
268553Sroot 
278553Sroot #include "tb.h"
288553Sroot #if NTB > 0
298553Sroot int	tbopen(),tbclose(),tbread(),tbinput(),tbioctl();
308553Sroot #endif
318553Sroot 
328553Sroot struct	linesw linesw[] =
338553Sroot {
34*25391Skarels 	ttyopen, ttylclose, ttread, ttwrite, nullioctl,
35*25391Skarels 	ttyinput, nodev, nulldev, ttstart, ttymodem,
368553Sroot #if NBK > 0
378553Sroot 	bkopen, bkclose, bkread, ttwrite, bkioctl,
38*25391Skarels 	bkinput, nodev, nulldev, ttstart, nullmodem,
398553Sroot #else
408553Sroot 	nodev, nodev, nodev, nodev, nodev,
418553Sroot 	nodev, nodev, nodev, nodev, nodev,
428553Sroot #endif
43*25391Skarels 	ttyopen, ttylclose, ttread, ttwrite, nullioctl,
44*25391Skarels 	ttyinput, nodev, nulldev, ttstart, ttymodem,
458553Sroot #if NTB > 0
468553Sroot 	tbopen, tbclose, tbread, nodev, tbioctl,
47*25391Skarels 	tbinput, nodev, nulldev, ttstart, nullmodem,		/* 3 */
488553Sroot #else
498553Sroot 	nodev, nodev, nodev, nodev, nodev,
508553Sroot 	nodev, nodev, nodev, nodev, nodev,
518553Sroot #endif
528553Sroot #if NTB > 0
538553Sroot 	tbopen, tbclose, tbread, nodev, tbioctl,
54*25391Skarels 	tbinput, nodev, nulldev, ttstart, nullmodem,		/* 4 */
558553Sroot #else
568553Sroot 	nodev, nodev, nodev, nodev, nodev,
578553Sroot 	nodev, nodev, nodev, nodev, nodev,
588553Sroot #endif
598553Sroot };
608553Sroot 
618562Sroot int	nldisp = sizeof (linesw) / sizeof (linesw[0]);
6212753Ssam 
6312753Ssam /*
6412753Ssam  * Do nothing specific version of line
6512753Ssam  * discipline specific ioctl command.
6612753Ssam  */
6712753Ssam /*ARGSUSED*/
6812753Ssam nullioctl(tp, cmd, data, flags)
6912753Ssam 	struct tty *tp;
7012753Ssam 	char *data;
7112753Ssam 	int flags;
7212753Ssam {
7312753Ssam 
7412753Ssam #ifdef lint
7512753Ssam 	tp = tp; data = data; flags = flags;
7612753Ssam #endif
7712753Ssam 	return (-1);
7812753Ssam }
79*25391Skarels 
80*25391Skarels /*
81*25391Skarels  * Default modem control routine.
82*25391Skarels  * Return argument flag, to turn off device on carrier drop.
83*25391Skarels  */
84*25391Skarels nullmodem(flag)
85*25391Skarels 	int flag;
86*25391Skarels {
87*25391Skarels 
88*25391Skarels 	return (flag);
89*25391Skarels }
90