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.8 (Berkeley) 04/20/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 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 struct proc *p)); 42 int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag, 43 struct proc *p)); 44 int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, 45 int fflag, struct proc *p)); 46 int (*d_stop) __P((struct tty *tp, int rw)); 47 int (*d_reset) __P((int uban)); /* XXX */ 48 struct tty *d_ttys; 49 int (*d_select) __P((dev_t dev, int which, struct proc *p)); 50 int (*d_mmap) __P(()); 51 int (*d_strategy) __P((struct buf *bp)); 52 }; 53 54 #ifdef KERNEL 55 struct cdevsw cdevsw[]; 56 57 /* symbolic sleep message strings */ 58 extern char devopn[], devio[], devwait[], devin[], devout[]; 59 extern char devioc[], devcls[]; 60 #endif 61 62 struct linesw { 63 int (*l_open)(); 64 int (*l_close)(); 65 int (*l_read)(); 66 int (*l_write)(); 67 int (*l_ioctl)(); 68 int (*l_rint)(); 69 int (*l_rend)(); 70 int (*l_meta)(); 71 int (*l_start)(); 72 int (*l_modem)(); 73 }; 74 75 #ifdef KERNEL 76 struct linesw linesw[]; 77 #endif 78 79 struct swdevt { 80 dev_t sw_dev; 81 int sw_freed; 82 int sw_nblks; 83 struct vnode *sw_vp; 84 }; 85 86 #ifdef KERNEL 87 struct swdevt swdevt[]; 88 #endif 89