1 /*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)conf.h 8.2 (Berkeley) 11/14/93 8 */ 9 10 /* 11 * Definitions of device driver entry switches 12 */ 13 14 struct buf; 15 struct proc; 16 struct tty; 17 struct uio; 18 struct vnode; 19 20 struct bdevsw { 21 int (*d_open) __P((dev_t dev, int oflags, int devtype, 22 struct proc *p)); 23 int (*d_close) __P((dev_t dev, int fflag, int devtype, 24 struct proc *p)); 25 int (*d_strategy) __P((struct buf *bp)); 26 int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, 27 int fflag, struct proc *p)); 28 int (*d_dump) (); /* parameters vary by architecture */ 29 int (*d_psize) __P((dev_t dev)); 30 int d_flags; 31 }; 32 33 #ifdef KERNEL 34 extern struct bdevsw bdevsw[]; 35 #endif 36 37 struct cdevsw { 38 int (*d_open) __P((dev_t dev, int oflags, int devtype, 39 struct proc *p)); 40 int (*d_close) __P((dev_t dev, int fflag, int devtype, 41 struct proc *)); 42 int (*d_read) __P((dev_t dev, struct uio *uio, int ioflag)); 43 int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag)); 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 extern 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) __P((dev_t dev, struct tty *tp)); 64 int (*l_close) __P((struct tty *tp, int flag)); 65 int (*l_read) __P((struct tty *tp, struct uio *uio, 66 int flag)); 67 int (*l_write) __P((struct tty *tp, struct uio *uio, 68 int flag)); 69 int (*l_ioctl) __P((struct tty *tp, int cmd, caddr_t data, 70 int flag, struct proc *p)); 71 int (*l_rint) __P((int c, struct tty *tp)); 72 int (*l_start) __P((struct tty *tp)); 73 int (*l_modem) __P((struct tty *tp, int flag)); 74 }; 75 76 #ifdef KERNEL 77 extern struct linesw linesw[]; 78 #endif 79 80 struct swdevt { 81 dev_t sw_dev; 82 int sw_flags; 83 int sw_nblks; 84 struct vnode *sw_vp; 85 }; 86 #define SW_FREED 0x01 87 #define SW_SEQUENTIAL 0x02 88 #define sw_freed sw_flags /* XXX compat */ 89 90 #ifdef KERNEL 91 extern struct swdevt swdevt[]; 92 #endif 93