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*56517Sbostic * @(#)tty_conf.c 7.9 (Berkeley) 10/11/92 823389Smckusick */ 98553Sroot 10*56517Sbostic #include <sys/param.h> 11*56517Sbostic #include <sys/systm.h> 12*56517Sbostic #include <sys/buf.h> 13*56517Sbostic #include <sys/ioctl.h> 14*56517Sbostic #include <sys/proc.h> 15*56517Sbostic #include <sys/tty.h> 16*56517Sbostic #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 ttyopen __P((dev_t dev, struct tty *tp)); 2552404Storek int ttylclose __P((struct tty *tp, int flags)); 2652404Storek int ttread __P((struct tty *, struct uio *, int flags)); 2752404Storek int ttwrite __P((struct tty *, struct uio *, int flags)); 2852404Storek int nullioctl __P((struct tty *tp, int cmd, caddr_t data, 2952404Storek int flag, struct proc *p)); 3052404Storek int ttyinput __P((int c, struct tty *tp)); 3152404Storek int ttstart __P((struct tty *tp)); 3252404Storek int ttymodem __P((struct tty *tp, int flags)); 3352404Storek int nullmodem __P((struct tty *tp, int flags)); 348553Sroot 358553Sroot #include "tb.h" 368553Sroot #if NTB > 0 3752404Storek int tbopen __P((dev_t dev, struct tty *tp)); 3852404Storek int tbclose __P((struct tty *tp, int flags)); 3952404Storek int tbread __P((struct tty *, struct uio *, int flags)); 4052404Storek int tbioctl __P((struct tty *tp, int cmd, caddr_t data, 4152404Storek int flag, struct proc *p)); 4252404Storek int tbinput __P((int c, struct tty *tp)); 438553Sroot #endif 4446745Smckusick 4526123Skarels #include "sl.h" 4626123Skarels #if NSL > 0 4752404Storek int slopen __P((dev_t dev, struct tty *tp)); 4852404Storek int slclose __P((struct tty *tp, int flags)); 4952404Storek int sltioctl __P((struct tty *tp, int cmd, caddr_t data, 5052404Storek int flag, struct proc *p)); 5152404Storek int slinput __P((int c, struct tty *tp)); 5252404Storek int slstart __P((struct tty *tp)); 5326123Skarels #endif 548553Sroot 5526123Skarels 568553Sroot struct linesw linesw[] = 578553Sroot { 5835811Smarc ttyopen, ttylclose, ttread, ttwrite, nullioctl, 5952404Storek ttyinput, ttstart, ttymodem, /* 0- termios */ 6037587Smarc 6152404Storek ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 6252404Storek ttyerrinput, ttyerrstart, nullmodem, /* 1- defunct */ 6337587Smarc 6452404Storek ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 6552404Storek ttyerrinput, ttyerrstart, nullmodem, /* 2- defunct */ 6652404Storek 678553Sroot #if NTB > 0 6846745Smckusick tbopen, tbclose, tbread, enodev, tbioctl, 6952404Storek tbinput, ttstart, nullmodem, /* 3- TABLDISC */ 708553Sroot #else 7152404Storek ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 7252404Storek ttyerrinput, ttyerrstart, nullmodem, 738553Sroot #endif 7452404Storek 7526123Skarels #if NSL > 0 7652404Storek slopen, slclose, ttyerrio, ttyerrio, sltioctl, 7752404Storek slinput, slstart, nullmodem, /* 4- SLIPDISC */ 7826123Skarels #else 7952404Storek ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, 8052404Storek ttyerrinput, ttyerrstart, nullmodem, 8126123Skarels #endif 828553Sroot }; 838553Sroot 848562Sroot int nldisp = sizeof (linesw) / sizeof (linesw[0]); 8512753Ssam 8612753Ssam /* 8712753Ssam * Do nothing specific version of line 8812753Ssam * discipline specific ioctl command. 8912753Ssam */ 9012753Ssam /*ARGSUSED*/ 9152404Storek nullioctl(tp, cmd, data, flags, p) 9212753Ssam struct tty *tp; 9352404Storek int cmd; 9412753Ssam char *data; 9512753Ssam int flags; 9652404Storek struct proc *p; 9712753Ssam { 9812753Ssam 9912753Ssam #ifdef lint 10052404Storek tp = tp; data = data; flags = flags; p = p; 10112753Ssam #endif 10212753Ssam return (-1); 10312753Ssam } 104