Cleanups for 4.4BSD-Lite
[unix-history] / usr / src / sys / kern / tty_conf.c
CommitLineData
f406ae69 1/*-
7a6e4544
KB
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
da7c5cc6 4 *
f406ae69
KB
5 * %sccs.include.redist.c%
6 *
6c1c42d5 7 * @(#)tty_conf.c 8.2 (Berkeley) %G%
da7c5cc6 8 */
de2d206e 9
38a01dbe
KB
10#include <sys/param.h>
11#include <sys/systm.h>
12#include <sys/buf.h>
13#include <sys/ioctl.h>
14#include <sys/proc.h>
15#include <sys/tty.h>
16#include <sys/conf.h>
de2d206e 17
46580f56
CT
18#define ttynodisc ((int (*) __P((dev_t, struct tty *)))enodev)
19#define ttyerrclose ((int (*) __P((struct tty *, int flags)))enodev)
20#define ttyerrio ((int (*) __P((struct tty *, struct uio *, int)))enodev)
21#define ttyerrinput ((int (*) __P((int c, struct tty *)))enodev)
22#define ttyerrstart ((int (*) __P((struct tty *)))enodev)
de2d206e 23
46580f56
CT
24int nullioctl __P((struct tty *tp, int cmd, caddr_t data,
25 int flag, struct proc *p));
de2d206e 26
de2d206e
BJ
27#include "tb.h"
28#if NTB > 0
46580f56
CT
29int tbopen __P((dev_t dev, struct tty *tp));
30int tbclose __P((struct tty *tp, int flags));
31int tbread __P((struct tty *, struct uio *, int flags));
32int tbioctl __P((struct tty *tp, int cmd, caddr_t data,
33 int flag, struct proc *p));
34int tbinput __P((int c, struct tty *tp));
de2d206e 35#endif
03022474 36
5d6d0450
MK
37#include "sl.h"
38#if NSL > 0
46580f56
CT
39int slopen __P((dev_t dev, struct tty *tp));
40int slclose __P((struct tty *tp, int flags));
41int sltioctl __P((struct tty *tp, int cmd, caddr_t data,
42 int flag, struct proc *p));
43int slinput __P((int c, struct tty *tp));
44int slstart __P((struct tty *tp));
5d6d0450
MK
45#endif
46
de2d206e
BJ
47
48struct linesw linesw[] =
49{
8809369e
CT
50 { ttyopen, ttylclose, ttread, ttwrite, nullioctl,
51 ttyinput, ttstart, ttymodem }, /* 0- termios */
5982a210 52
8809369e
CT
53 { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
54 ttyerrinput, ttyerrstart, nullmodem }, /* 1- defunct */
46580f56 55
8809369e
CT
56 { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
57 ttyerrinput, ttyerrstart, nullmodem }, /* 2- defunct */
5982a210 58
de2d206e 59#if NTB > 0
8809369e
CT
60 { tbopen, tbclose, tbread, enodev, tbioctl,
61 tbinput, ttstart, nullmodem }, /* 3- TABLDISC */
5d6d0450 62#else
8809369e
CT
63 { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
64 ttyerrinput, ttyerrstart, nullmodem },
5d6d0450 65#endif
46580f56 66
5d6d0450 67#if NSL > 0
8809369e
CT
68 { slopen, slclose, ttyerrio, ttyerrio, sltioctl,
69 slinput, slstart, nullmodem }, /* 4- SLIPDISC */
de2d206e 70#else
8809369e
CT
71 { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
72 ttyerrinput, ttyerrstart, nullmodem },
de2d206e 73#endif
de2d206e
BJ
74};
75
dc717036 76int nldisp = sizeof (linesw) / sizeof (linesw[0]);
88a7a62a
SL
77
78/*
79 * Do nothing specific version of line
80 * discipline specific ioctl command.
81 */
82/*ARGSUSED*/
46580f56 83nullioctl(tp, cmd, data, flags, p)
88a7a62a 84 struct tty *tp;
46580f56 85 int cmd;
88a7a62a
SL
86 char *data;
87 int flags;
46580f56 88 struct proc *p;
88a7a62a
SL
89{
90
91#ifdef lint
46580f56 92 tp = tp; data = data; flags = flags; p = p;
88a7a62a
SL
93#endif
94 return (-1);
95}