conf.h revision 7218
1168404Spjd/*-
2168404Spjd * Copyright (c) 1990, 1993
3168404Spjd *	The Regents of the University of California.  All rights reserved.
4168404Spjd * (c) UNIX System Laboratories, Inc.
5168404Spjd * All or some portions of this file are derived from material licensed
6168404Spjd * to the University of California by American Telephone and Telegraph
7168404Spjd * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8168404Spjd * the permission of UNIX System Laboratories, Inc.
9168404Spjd *
10168404Spjd * Redistribution and use in source and binary forms, with or without
11168404Spjd * modification, are permitted provided that the following conditions
12168404Spjd * are met:
13168404Spjd * 1. Redistributions of source code must retain the above copyright
14168404Spjd *    notice, this list of conditions and the following disclaimer.
15168404Spjd * 2. Redistributions in binary form must reproduce the above copyright
16168404Spjd *    notice, this list of conditions and the following disclaimer in the
17168404Spjd *    documentation and/or other materials provided with the distribution.
18168404Spjd * 3. All advertising materials mentioning features or use of this software
19168404Spjd *    must display the following acknowledgement:
20168404Spjd *	This product includes software developed by the University of
21168404Spjd *	California, Berkeley and its contributors.
22209962Smm * 4. Neither the name of the University nor the names of its contributors
23168404Spjd *    may be used to endorse or promote products derived from this software
24168404Spjd *    without specific prior written permission.
25168404Spjd *
26168404Spjd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27168404Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28168404Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29168404Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30168404Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31168404Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32168404Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33168404Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34168404Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35168404Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36168404Spjd * SUCH DAMAGE.
37168404Spjd *
38168404Spjd *	@(#)conf.h	8.3 (Berkeley) 1/21/94
39168404Spjd * $Id: conf.h,v 1.10 1995/03/16 18:16:13 bde Exp $
40168404Spjd */
41168404Spjd
42168404Spjd#ifndef _SYS_CONF_H_
43168404Spjd#define	_SYS_CONF_H_
44168404Spjd
45168404Spjd/*
46168404Spjd * Definitions of device driver entry switches
47168404Spjd */
48168404Spjd
49168404Spjdstruct buf;
50168404Spjdstruct proc;
51168404Spjdstruct tty;
52168404Spjdstruct uio;
53168404Spjdstruct vnode;
54168404Spjd
55168404Spjdtypedef void d_strategy_t __P((struct buf *));
56168404Spjdtypedef int d_open_t __P((dev_t, int, int, struct proc *));
57168404Spjdtypedef int d_close_t __P((dev_t, int, int, struct proc *));
58168404Spjdtypedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *));
59168404Spjdtypedef int d_dump_t __P(());
60168404Spjdtypedef int d_psize_t __P((dev_t));
61168404Spjd
62168404Spjdtypedef int d_read_t __P((dev_t, struct uio *, int));
63168404Spjdtypedef int d_write_t __P((dev_t, struct uio *, int));
64168404Spjdtypedef int d_rdwr_t __P((dev_t, struct uio *, int));
65168404Spjdtypedef int d_stop_t __P((struct tty *, int));
66168404Spjdtypedef int d_reset_t __P((int));
67168404Spjdtypedef int d_select_t __P((dev_t, int, struct proc *));
68168404Spjdtypedef int d_mmap_t __P((/* XXX */));
69168404Spjdtypedef	struct tty * d_ttycv_t __P((dev_t));
70168404Spjd
71168404Spjdstruct bdevsw {
72168404Spjd	d_open_t	*d_open;
73168404Spjd	d_close_t	*d_close;
74168404Spjd	d_strategy_t	*d_strategy;
75168404Spjd	d_ioctl_t	*d_ioctl;
76168404Spjd	d_dump_t	*d_dump;
77168404Spjd	d_psize_t	*d_psize;
78168404Spjd	int		d_flags;
79168404Spjd};
80168404Spjd
81168404Spjd#ifdef KERNEL
82168404Spjdextern struct bdevsw bdevsw[];
83168404Spjd#endif
84168404Spjd
85168404Spjdstruct cdevsw {
86168404Spjd	d_open_t	*d_open;
87168404Spjd	d_close_t	*d_close;
88168404Spjd	d_rdwr_t	*d_read;
89168404Spjd	d_rdwr_t	*d_write;
90168404Spjd	d_ioctl_t	*d_ioctl;
91168404Spjd	d_stop_t	*d_stop;
92168404Spjd	d_reset_t	*d_reset;
93168404Spjd	d_ttycv_t	*d_devtotty;
94168404Spjd	d_select_t	*d_select;
95168404Spjd	d_mmap_t	*d_mmap;
96168404Spjd	d_strategy_t	*d_strategy;
97168404Spjd};
98168404Spjd
99168404Spjd#ifdef KERNEL
100168404Spjdextern struct cdevsw cdevsw[];
101168404Spjd
102168404Spjd/* symbolic sleep message strings */
103168404Spjdextern char devopn[], devio[], devwait[], devin[], devout[];
104168404Spjdextern char devioc[], devcls[];
105168404Spjd#endif
106168404Spjd
107168404Spjdstruct linesw {
108168404Spjd	int	(*l_open)	__P((dev_t dev, struct tty *tp));
109168404Spjd	int	(*l_close)	__P((struct tty *tp, int flag));
110168404Spjd	int	(*l_read)	__P((struct tty *tp, struct uio *uio,
111168404Spjd				     int flag));
112168404Spjd	int	(*l_write)	__P((struct tty *tp, struct uio *uio,
113168404Spjd				     int flag));
114168404Spjd	int	(*l_ioctl)	__P((struct tty *tp, int cmd, caddr_t data,
115168404Spjd				     int flag, struct proc *p));
116168404Spjd	int	(*l_rint)	__P((int c, struct tty *tp));
117168404Spjd	int	(*l_start)	__P((struct tty *tp));
118168404Spjd	int	(*l_modem)	__P((struct tty *tp, int flag));
119168404Spjd};
120168404Spjd
121168404Spjd#ifdef KERNEL
122168404Spjdextern struct linesw linesw[];
123168404Spjdextern int nlinesw;
124168404Spjd
125168404Spjdint ldisc_register __P((int , struct linesw *));
126168404Spjdvoid ldisc_deregister __P((int));
127168404Spjd#define LDISC_LOAD 	-1		/* Loadable line discipline */
128168404Spjd#endif
129168404Spjd
130168404Spjdstruct swdevt {
131168404Spjd	dev_t	sw_dev;
132168404Spjd	int	sw_flags;
133168404Spjd	int	sw_nblks;
134168404Spjd	struct	vnode *sw_vp;
135168404Spjd};
136168404Spjd#define	SW_FREED	0x01
137168404Spjd#define	SW_SEQUENTIAL	0x02
138168404Spjd#define sw_freed	sw_flags	/* XXX compat */
139168404Spjd
140168404Spjd#ifdef KERNEL
141168404Spjdextern struct swdevt swdevt[];
142168404Spjd
143168404Spjddev_t	chrtoblk __P((dev_t dev));
144168404Spjdint	isdisk __P((dev_t dev, int type));
145168404Spjdint	iskmemdev __P((dev_t dev));
146168404Spjdint	iszerodev __P((dev_t dev));
147168404Spjd#endif
148168404Spjd
149168404Spjd#endif /* !_SYS_CONF_H_ */
150168404Spjd