149594Sbostic /*- 263178Sbostic * Copyright (c) 1982, 1986, 1991, 1993 363178Sbostic * The Regents of the University of California. All rights reserved. 423389Smckusick * 549594Sbostic * %sccs.include.redist.c% 649594Sbostic * 7*64592Sbostic * @(#)tty_conf.c 8.3 (Berkeley) 09/23/93 823389Smckusick */ 98553Sroot 1056517Sbostic #include <sys/param.h> 1156517Sbostic #include <sys/systm.h> 1256517Sbostic #include <sys/buf.h> 1356517Sbostic #include <sys/ioctl.h> 1456517Sbostic #include <sys/proc.h> 1556517Sbostic #include <sys/tty.h> 1656517Sbostic #include <sys/conf.h> 178553Sroot 1852404Storek #define ttynodisc ((int (*) __P((dev_t, struct tty *)))enodev) 1952404Storek #define ttyerrclose ((int (*) __P((struct tty *, int flags)))enodev) 2052404Storek #define ttyerrio ((int (*) __P((struct tty *, struct uio *, int)))enodev) 2152404Storek #define ttyerrinput ((int (*) __P((int c, struct tty *)))enodev) 2252404Storek #define ttyerrstart ((int (*) __P((struct tty *)))enodev) 238553Sroot 2452404Storek int nullioctl __P((struct tty *tp, int cmd, caddr_t data, 2552404Storek int flag, struct proc *p)); 268553Sroot 278553Sroot #include "tb.h" 288553Sroot #if NTB > 0 2952404Storek int tbopen __P((dev_t dev, struct tty *tp)); 3052404Storek int tbclose __P((struct tty *tp, int flags)); 3152404Storek int tbread __P((struct tty *, struct uio *, int flags)); 3252404Storek int tbioctl __P((struct tty *tp, int cmd, caddr_t data, 3352404Storek int flag, struct proc *p)); 3452404Storek int tbinput __P((int c, struct tty *tp)); 358553Sroot #endif 3646745Smckusick 3726123Skarels #include "sl.h" 3826123Skarels #if NSL > 0 3952404Storek int slopen __P((dev_t dev, struct tty *tp)); 4052404Storek int slclose __P((struct tty *tp, int flags)); 4152404Storek int sltioctl __P((struct tty *tp, int cmd, caddr_t data, 4252404Storek int flag, struct proc *p)); 4352404Storek int slinput __P((int c, struct tty *tp)); 4452404Storek int slstart __P((struct tty *tp)); 4526123Skarels #endif 468553Sroot 4726123Skarels 488553Sroot struct linesw linesw[] = 498553Sroot { 5060516Storek { ttyopen, ttylclose, ttread, ttwrite, nullioctl, 5160516Storek ttyinput, ttstart, ttymodem }, /* 0- termios */ 5237587Smarc 5360516Storek { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 5460516Storek ttyerrinput, ttyerrstart, nullmodem }, /* 1- defunct */ 5537587Smarc 5660516Storek { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 5760516Storek ttyerrinput, ttyerrstart, nullmodem }, /* 2- defunct */ 5852404Storek 598553Sroot #if NTB > 0 6060516Storek { tbopen, tbclose, tbread, enodev, tbioctl, 6160516Storek tbinput, ttstart, nullmodem }, /* 3- TABLDISC */ 628553Sroot #else 6360516Storek { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 6460516Storek ttyerrinput, ttyerrstart, nullmodem }, 658553Sroot #endif 6652404Storek 6726123Skarels #if NSL > 0 6860516Storek { slopen, slclose, ttyerrio, ttyerrio, sltioctl, 6960516Storek slinput, slstart, nullmodem }, /* 4- SLIPDISC */ 7026123Skarels #else 7160516Storek { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 7260516Storek ttyerrinput, ttyerrstart, nullmodem }, 7326123Skarels #endif 748553Sroot }; 758553Sroot 76*64592Sbostic int nlinesw = sizeof (linesw) / sizeof (linesw[0]); 7712753Ssam 7812753Ssam /* 7912753Ssam * Do nothing specific version of line 8012753Ssam * discipline specific ioctl command. 8112753Ssam */ 8212753Ssam /*ARGSUSED*/ 8352404Storek nullioctl(tp, cmd, data, flags, p) 8412753Ssam struct tty *tp; 8552404Storek int cmd; 8612753Ssam char *data; 8712753Ssam int flags; 8852404Storek struct proc *p; 8912753Ssam { 9012753Ssam 9112753Ssam #ifdef lint 9252404Storek tp = tp; data = data; flags = flags; p = p; 9312753Ssam #endif 9412753Ssam return (-1); 9512753Ssam } 96