Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /*- |
2 | * Copyright (c) 1982, 1986, 1991 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. All advertising materials mentioning features or use of this software | |
14 | * must display the following acknowledgement: | |
15 | * This product includes software developed by the University of | |
16 | * California, Berkeley and its contributors. | |
17 | * 4. Neither the name of the University nor the names of its contributors | |
18 | * may be used to endorse or promote products derived from this software | |
19 | * without specific prior written permission. | |
20 | * | |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
31 | * SUCH DAMAGE. | |
32 | * | |
600f7f07 | 33 | * from: @(#)tty_conf.c 7.6 (Berkeley) 5/9/91 |
39dc5c41 | 34 | * $Id: tty_conf.c,v 1.6 1993/11/27 16:04:36 davidg Exp $ |
15637ed4 RG |
35 | */ |
36 | ||
37 | #include "param.h" | |
38 | #include "systm.h" | |
39 | #include "buf.h" | |
40 | #include "ioctl.h" | |
41 | #include "tty.h" | |
42 | #include "conf.h" | |
43 | ||
44 | int enodev(); | |
45 | int nullop(); | |
4c45483e | 46 | static int nullioctl(struct tty *, int, caddr_t, int); |
15637ed4 | 47 | |
4c45483e GW |
48 | #define VE(x) ((void (*)())x) /* XXX */ |
49 | #define IE(x) ((int (*)())x) /* XXX */ | |
15637ed4 | 50 | |
4c45483e | 51 | /* XXX - doesn't work */ |
15637ed4 RG |
52 | #include "tb.h" |
53 | #if NTB > 0 | |
54 | int tbopen(),tbclose(),tbread(),tbinput(),tbioctl(); | |
55 | #endif | |
56 | ||
57 | #include "sl.h" | |
58 | #if NSL > 0 | |
59 | int slopen(),slclose(),slinput(),sltioctl(),slstart(); | |
60 | #endif | |
8b3438a6 RG |
61 | #include "ppp.h" |
62 | #if NPPP > 0 | |
63 | int pppopen(),pppclose(),pppread(),pppwrite(),pppinput(); | |
64 | int ppptioctl(),pppstart(),pppselect(); | |
65 | #endif | |
15637ed4 RG |
66 | |
67 | ||
68 | struct linesw linesw[] = | |
69 | { | |
70 | ttyopen, ttylclose, ttread, ttwrite, nullioctl, | |
71 | ttyinput, enodev, nullop, ttstart, ttymodem, /* 0- termios */ | |
72 | ||
4c45483e GW |
73 | IE(enodev), VE(enodev), IE(enodev), IE(enodev), IE(enodev), /* 1- defunct */ |
74 | VE(enodev), IE(enodev), IE(enodev), VE(enodev), IE(enodev), | |
15637ed4 | 75 | |
2b5668b3 AC |
76 | ttyopen, ttylclose, ttread, ttwrite, nullioctl, |
77 | ttyinput, enodev, nullop, ttstart, ttymodem, /* 2- NTTYDISC */ | |
4c45483e | 78 | |
15637ed4 | 79 | #if NTB > 0 |
2381d206 | 80 | tbopen, tbclose, tbread, IE(enodev), tbioctl, |
15637ed4 RG |
81 | tbinput, enodev, nullop, ttstart, nullmodem, /* 3- TABLDISC */ |
82 | #else | |
4c45483e GW |
83 | IE(enodev), VE(enodev), IE(enodev), IE(enodev), IE(enodev), |
84 | VE(enodev), IE(enodev), IE(enodev), VE(enodev), IE(enodev), | |
15637ed4 RG |
85 | #endif |
86 | #if NSL > 0 | |
4c45483e | 87 | slopen, VE(slclose), IE(enodev), IE(enodev), sltioctl, |
39dc5c41 | 88 | VE(slinput), enodev, nullop, VE(slstart), ttymodem, /* 4- SLIPDISC */ |
15637ed4 | 89 | #else |
2381d206 DG |
90 | IE(enodev), VE(enodev), IE(enodev), IE(enodev), IE(enodev), |
91 | VE(enodev), IE(enodev), IE(enodev), VE(enodev), IE(enodev), | |
15637ed4 | 92 | #endif |
8b3438a6 | 93 | #if NPPP > 0 |
4c45483e GW |
94 | pppopen, VE(pppclose), pppread, pppwrite, ppptioctl, |
95 | VE(pppinput), enodev, nullop, VE(pppstart), ttymodem, /* 5- PPPDISC */ | |
8b3438a6 | 96 | #else |
2381d206 DG |
97 | IE(enodev), VE(enodev), IE(enodev), IE(enodev), IE(enodev), |
98 | VE(enodev), IE(enodev), IE(enodev), VE(enodev), IE(enodev), | |
8b3438a6 | 99 | #endif |
15637ed4 RG |
100 | }; |
101 | ||
102 | int nldisp = sizeof (linesw) / sizeof (linesw[0]); | |
103 | ||
104 | /* | |
105 | * Do nothing specific version of line | |
106 | * discipline specific ioctl command. | |
107 | */ | |
108 | /*ARGSUSED*/ | |
4c45483e | 109 | static int |
15637ed4 RG |
110 | nullioctl(tp, cmd, data, flags) |
111 | struct tty *tp; | |
4c45483e | 112 | int cmd; |
15637ed4 RG |
113 | char *data; |
114 | int flags; | |
115 | { | |
116 | ||
117 | #ifdef lint | |
118 | tp = tp; data = data; flags = flags; | |
119 | #endif | |
120 | return (-1); | |
121 | } |