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