Home | History | Annotate | Line # | Download | only in kern
tty_conf.c revision 1.1.1.3
      1  1.1.1.2  fvdl /*-
      2  1.1.1.2  fvdl  * Copyright (c) 1982, 1986, 1991, 1993
      3  1.1.1.2  fvdl  *	The Regents of the University of California.  All rights reserved.
      4  1.1.1.2  fvdl  * (c) UNIX System Laboratories, Inc.
      5  1.1.1.2  fvdl  * All or some portions of this file are derived from material licensed
      6  1.1.1.2  fvdl  * to the University of California by American Telephone and Telegraph
      7  1.1.1.2  fvdl  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
      8  1.1.1.2  fvdl  * the permission of UNIX System Laboratories, Inc.
      9  1.1.1.2  fvdl  *
     10  1.1.1.2  fvdl  * Redistribution and use in source and binary forms, with or without
     11  1.1.1.2  fvdl  * modification, are permitted provided that the following conditions
     12  1.1.1.2  fvdl  * are met:
     13  1.1.1.2  fvdl  * 1. Redistributions of source code must retain the above copyright
     14  1.1.1.2  fvdl  *    notice, this list of conditions and the following disclaimer.
     15  1.1.1.2  fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1.1.2  fvdl  *    notice, this list of conditions and the following disclaimer in the
     17  1.1.1.2  fvdl  *    documentation and/or other materials provided with the distribution.
     18  1.1.1.2  fvdl  * 3. All advertising materials mentioning features or use of this software
     19  1.1.1.2  fvdl  *    must display the following acknowledgement:
     20  1.1.1.2  fvdl  *	This product includes software developed by the University of
     21  1.1.1.2  fvdl  *	California, Berkeley and its contributors.
     22  1.1.1.2  fvdl  * 4. Neither the name of the University nor the names of its contributors
     23  1.1.1.2  fvdl  *    may be used to endorse or promote products derived from this software
     24  1.1.1.2  fvdl  *    without specific prior written permission.
     25  1.1.1.2  fvdl  *
     26  1.1.1.2  fvdl  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27  1.1.1.2  fvdl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28  1.1.1.2  fvdl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29  1.1.1.2  fvdl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30  1.1.1.2  fvdl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31  1.1.1.2  fvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32  1.1.1.2  fvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33  1.1.1.2  fvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34  1.1.1.2  fvdl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35  1.1.1.2  fvdl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36  1.1.1.2  fvdl  * SUCH DAMAGE.
     37  1.1.1.2  fvdl  *
     38  1.1.1.3  fvdl  *	@(#)tty_conf.c	8.5 (Berkeley) 1/9/95
     39  1.1.1.2  fvdl  */
     40  1.1.1.2  fvdl 
     41  1.1.1.2  fvdl #include <sys/param.h>
     42  1.1.1.2  fvdl #include <sys/systm.h>
     43  1.1.1.2  fvdl #include <sys/buf.h>
     44  1.1.1.2  fvdl #include <sys/ioctl.h>
     45  1.1.1.2  fvdl #include <sys/proc.h>
     46  1.1.1.2  fvdl #include <sys/tty.h>
     47  1.1.1.2  fvdl #include <sys/conf.h>
     48  1.1.1.2  fvdl 
     49  1.1.1.2  fvdl #define	ttynodisc ((int (*) __P((dev_t, struct tty *)))enodev)
     50  1.1.1.2  fvdl #define	ttyerrclose ((int (*) __P((struct tty *, int flags)))enodev)
     51  1.1.1.2  fvdl #define	ttyerrio ((int (*) __P((struct tty *, struct uio *, int)))enodev)
     52  1.1.1.2  fvdl #define	ttyerrinput ((int (*) __P((int c, struct tty *)))enodev)
     53  1.1.1.2  fvdl #define	ttyerrstart ((int (*) __P((struct tty *)))enodev)
     54  1.1.1.2  fvdl 
     55  1.1.1.3  fvdl int	nullioctl __P((struct tty *tp, u_long cmd, caddr_t data,
     56  1.1.1.2  fvdl 			int flag, struct proc *p));
     57  1.1.1.2  fvdl 
     58  1.1.1.2  fvdl #include "tb.h"
     59  1.1.1.2  fvdl #if NTB > 0
     60  1.1.1.2  fvdl int	tbopen __P((dev_t dev, struct tty *tp));
     61  1.1.1.2  fvdl int	tbclose __P((struct tty *tp, int flags));
     62  1.1.1.2  fvdl int	tbread __P((struct tty *, struct uio *, int flags));
     63  1.1.1.3  fvdl int	tbioctl __P((struct tty *tp, u_long cmd, caddr_t data,
     64  1.1.1.2  fvdl 			int flag, struct proc *p));
     65  1.1.1.2  fvdl int	tbinput __P((int c, struct tty *tp));
     66  1.1.1.2  fvdl #endif
     67  1.1.1.2  fvdl 
     68  1.1.1.2  fvdl #include "sl.h"
     69  1.1.1.2  fvdl #if NSL > 0
     70  1.1.1.2  fvdl int	slopen __P((dev_t dev, struct tty *tp));
     71  1.1.1.2  fvdl int	slclose __P((struct tty *tp, int flags));
     72  1.1.1.3  fvdl int	sltioctl __P((struct tty *tp, u_long cmd, caddr_t data,
     73  1.1.1.2  fvdl 			int flag, struct proc *p));
     74  1.1.1.2  fvdl int	slinput __P((int c, struct tty *tp));
     75  1.1.1.2  fvdl int	slstart __P((struct tty *tp));
     76  1.1.1.2  fvdl #endif
     77  1.1.1.2  fvdl 
     78  1.1.1.2  fvdl 
     79  1.1.1.2  fvdl struct	linesw linesw[] =
     80  1.1.1.2  fvdl {
     81  1.1.1.2  fvdl 	{ ttyopen, ttylclose, ttread, ttwrite, nullioctl,
     82  1.1.1.2  fvdl 	  ttyinput, ttstart, ttymodem },		/* 0- termios */
     83  1.1.1.2  fvdl 
     84  1.1.1.2  fvdl 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
     85  1.1.1.2  fvdl 	  ttyerrinput, ttyerrstart, nullmodem },	/* 1- defunct */
     86  1.1.1.2  fvdl 
     87  1.1.1.2  fvdl 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
     88  1.1.1.2  fvdl 	  ttyerrinput, ttyerrstart, nullmodem },	/* 2- defunct */
     89  1.1.1.2  fvdl 
     90  1.1.1.2  fvdl #if NTB > 0
     91  1.1.1.2  fvdl 	{ tbopen, tbclose, tbread, enodev, tbioctl,
     92  1.1.1.2  fvdl 	  tbinput, ttstart, nullmodem },		/* 3- TABLDISC */
     93  1.1.1.2  fvdl #else
     94  1.1.1.2  fvdl 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
     95  1.1.1.2  fvdl 	  ttyerrinput, ttyerrstart, nullmodem },
     96  1.1.1.2  fvdl #endif
     97  1.1.1.2  fvdl 
     98  1.1.1.2  fvdl #if NSL > 0
     99  1.1.1.2  fvdl 	{ slopen, slclose, ttyerrio, ttyerrio, sltioctl,
    100  1.1.1.2  fvdl 	  slinput, slstart, nullmodem },		/* 4- SLIPDISC */
    101  1.1.1.2  fvdl #else
    102  1.1.1.2  fvdl 	{ ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl,
    103  1.1.1.2  fvdl 	  ttyerrinput, ttyerrstart, nullmodem },
    104  1.1.1.2  fvdl #endif
    105  1.1.1.2  fvdl };
    106  1.1.1.2  fvdl 
    107  1.1.1.2  fvdl int	nlinesw = sizeof (linesw) / sizeof (linesw[0]);
    108  1.1.1.2  fvdl 
    109  1.1.1.2  fvdl /*
    110  1.1.1.2  fvdl  * Do nothing specific version of line
    111  1.1.1.2  fvdl  * discipline specific ioctl command.
    112  1.1.1.2  fvdl  */
    113  1.1.1.2  fvdl /*ARGSUSED*/
    114  1.1.1.2  fvdl nullioctl(tp, cmd, data, flags, p)
    115  1.1.1.2  fvdl 	struct tty *tp;
    116  1.1.1.3  fvdl 	u_long cmd;
    117  1.1.1.2  fvdl 	char *data;
    118  1.1.1.2  fvdl 	int flags;
    119  1.1.1.2  fvdl 	struct proc *p;
    120  1.1.1.2  fvdl {
    121  1.1.1.2  fvdl 
    122  1.1.1.2  fvdl #ifdef lint
    123  1.1.1.2  fvdl 	tp = tp; data = data; flags = flags; p = p;
    124  1.1.1.2  fvdl #endif
    125  1.1.1.2  fvdl 	return (-1);
    126  1.1.1.2  fvdl }
    127