xref: /original-bsd/sys/sys/conf.h (revision e59fb703)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)conf.h	7.10 (Berkeley) 09/06/91
8  */
9 
10 /*
11  * Definitions of device driver entry switches
12  */
13 
14 #ifdef __STDC__
15 struct tty;
16 #endif
17 
18 struct bdevsw {
19 	int	(*d_open)	__P((dev_t dev, int oflags, int devtype,
20 				     struct proc *p));
21 	int	(*d_close)	__P((dev_t dev, int fflag, int devtype,
22 				     struct proc *));
23 	int	(*d_strategy)	__P((struct buf *bp));
24 	int	(*d_ioctl)	__P((dev_t dev, int cmd, caddr_t data,
25 				     int fflag, struct proc *p));
26 	int	(*d_dump)	__P((dev_t dev));
27 	int	(*d_psize)	__P((dev_t dev));
28 	int	d_flags;
29 };
30 
31 #ifdef KERNEL
32 extern struct bdevsw bdevsw[];
33 #endif
34 
35 struct cdevsw {
36 	int	(*d_open)	__P((dev_t dev, int oflags, int devtype,
37 				     struct proc *p));
38 	int	(*d_close)	__P((dev_t dev, int fflag, int devtype,
39 				     struct proc *));
40 	int	(*d_read)	__P((dev_t dev, struct uio *uio, int ioflag));
41 	int	(*d_write)	__P((dev_t dev, struct uio *uio, int ioflag));
42 	int	(*d_ioctl)	__P((dev_t dev, int cmd, caddr_t data,
43 				     int fflag, struct proc *p));
44 	int	(*d_stop)	__P((struct tty *tp, int rw));
45 	int	(*d_reset)	__P((int uban));	/* XXX */
46 	struct	tty *d_ttys;
47 	int	(*d_select)	__P((dev_t dev, int which, struct proc *p));
48 	int	(*d_mmap)	__P(());
49 	int	(*d_strategy)	__P((struct buf *bp));
50 };
51 
52 #ifdef KERNEL
53 extern struct cdevsw cdevsw[];
54 
55 /* symbolic sleep message strings */
56 extern char devopn[], devio[], devwait[], devin[], devout[];
57 extern char devioc[], devcls[];
58 #endif
59 
60 struct linesw {
61 	int	(*l_open)();
62 	int	(*l_close)();
63 	int	(*l_read)();
64 	int	(*l_write)();
65 	int	(*l_ioctl)();
66 	int	(*l_rint)();
67 	int	(*l_rend)();
68 	int	(*l_meta)();
69 	int	(*l_start)();
70 	int	(*l_modem)();
71 };
72 
73 #ifdef KERNEL
74 extern struct linesw linesw[];
75 #endif
76 
77 struct swdevt {
78 	dev_t	sw_dev;
79 	int	sw_freed;
80 	int	sw_nblks;
81 	struct	vnode *sw_vp;
82 };
83 
84 #ifdef KERNEL
85 extern struct swdevt swdevt[];
86 #endif
87