xref: /original-bsd/sys/sys/conf.h (revision 8bb6539f)
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.11 (Berkeley) 02/05/92
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)	();	/* parameters vary by architecture */
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)	__P((dev_t dev, struct tty *tp));
62 	int	(*l_close)	__P((struct tty *tp, int flag));
63 	int	(*l_read)	__P((struct tty *tp, struct uio *uio,
64 				     int flag));
65 	int	(*l_write)	__P((struct tty *tp, struct uio *uio,
66 				     int flag));
67 	int	(*l_ioctl)	__P((struct tty *tp, int cmd, caddr_t data,
68 				     int flag, struct proc *p));
69 	int	(*l_rint)	__P((int c, struct tty *tp));
70 	int	(*l_start)	__P((struct tty *tp));
71 	int	(*l_modem)	__P((struct tty *tp, int flag));
72 };
73 
74 #ifdef KERNEL
75 extern struct linesw linesw[];
76 #endif
77 
78 struct swdevt {
79 	dev_t	sw_dev;
80 	int	sw_freed;
81 	int	sw_nblks;
82 	struct	vnode *sw_vp;
83 };
84 
85 #ifdef KERNEL
86 extern struct swdevt swdevt[];
87 #endif
88