must include proc before tty.h and socketvar.h
[unix-history] / usr / src / sys / kern / tty_conf.c
CommitLineData
f406ae69
KB
1/*-
2 * Copyright (c) 1982, 1986, 1991 The Regents of the University of California.
3 * All rights reserved.
da7c5cc6 4 *
f406ae69
KB
5 * %sccs.include.redist.c%
6 *
063b2136 7 * @(#)tty_conf.c 7.8 (Berkeley) %G%
da7c5cc6 8 */
de2d206e 9
94368568
JB
10#include "param.h"
11#include "systm.h"
12#include "buf.h"
3358b36b 13#include "ioctl.h"
063b2136 14#include "proc.h"
94368568
JB
15#include "tty.h"
16#include "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 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));
de2d206e 34
de2d206e
BJ
35#include "tb.h"
36#if NTB > 0
46580f56
CT
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));
de2d206e 43#endif
03022474 44
5d6d0450
MK
45#include "sl.h"
46#if NSL > 0
46580f56
CT
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));
5d6d0450
MK
53#endif
54
de2d206e
BJ
55
56struct linesw linesw[] =
57{
e39f9ea6 58 ttyopen, ttylclose, ttread, ttwrite, nullioctl,
46580f56 59 ttyinput, ttstart, ttymodem, /* 0- termios */
5982a210 60
46580f56
CT
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 */
5982a210 66
de2d206e 67#if NTB > 0
03022474 68 tbopen, tbclose, tbread, enodev, tbioctl,
46580f56 69 tbinput, ttstart, nullmodem, /* 3- TABLDISC */
5d6d0450 70#else
46580f56
CT
71 ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
72 ttyerrinput, ttyerrstart, nullmodem,
5d6d0450 73#endif
46580f56 74
5d6d0450 75#if NSL > 0
46580f56
CT
76 slopen, slclose, ttyerrio, ttyerrio, sltioctl,
77 slinput, slstart, nullmodem, /* 4- SLIPDISC */
de2d206e 78#else
46580f56
CT
79 ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
80 ttyerrinput, ttyerrstart, nullmodem,
de2d206e 81#endif
de2d206e
BJ
82};
83
dc717036 84int nldisp = sizeof (linesw) / sizeof (linesw[0]);
88a7a62a
SL
85
86/*
87 * Do nothing specific version of line
88 * discipline specific ioctl command.
89 */
90/*ARGSUSED*/
46580f56 91nullioctl(tp, cmd, data, flags, p)
88a7a62a 92 struct tty *tp;
46580f56 93 int cmd;
88a7a62a
SL
94 char *data;
95 int flags;
46580f56 96 struct proc *p;
88a7a62a
SL
97{
98
99#ifdef lint
46580f56 100 tp = tp; data = data; flags = flags; p = p;
88a7a62a
SL
101#endif
102 return (-1);
103}