1 /*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)conf.h 8.3 (Berkeley) 01/21/94 13 */ 14 15 /* 16 * Definitions of device driver entry switches 17 */ 18 19 struct buf; 20 struct proc; 21 struct tty; 22 struct uio; 23 struct vnode; 24 25 struct bdevsw { 26 int (*d_open) __P((dev_t dev, int oflags, int devtype, 27 struct proc *p)); 28 int (*d_close) __P((dev_t dev, int fflag, int devtype, 29 struct proc *p)); 30 int (*d_strategy) __P((struct buf *bp)); 31 int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, 32 int fflag, struct proc *p)); 33 int (*d_dump) (); /* parameters vary by architecture */ 34 int (*d_psize) __P((dev_t dev)); 35 int d_flags; 36 }; 37 38 #ifdef KERNEL 39 extern struct bdevsw bdevsw[]; 40 #endif 41 42 struct cdevsw { 43 int (*d_open) __P((dev_t dev, int oflags, int devtype, 44 struct proc *p)); 45 int (*d_close) __P((dev_t dev, int fflag, int devtype, 46 struct proc *)); 47 int (*d_read) __P((dev_t dev, struct uio *uio, int ioflag)); 48 int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag)); 49 int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, 50 int fflag, struct proc *p)); 51 int (*d_stop) __P((struct tty *tp, int rw)); 52 int (*d_reset) __P((int uban)); /* XXX */ 53 struct tty *d_ttys; 54 int (*d_select) __P((dev_t dev, int which, struct proc *p)); 55 int (*d_mmap) __P(()); 56 int (*d_strategy) __P((struct buf *bp)); 57 }; 58 59 #ifdef KERNEL 60 extern struct cdevsw cdevsw[]; 61 62 /* symbolic sleep message strings */ 63 extern char devopn[], devio[], devwait[], devin[], devout[]; 64 extern char devioc[], devcls[]; 65 #endif 66 67 struct linesw { 68 int (*l_open) __P((dev_t dev, struct tty *tp)); 69 int (*l_close) __P((struct tty *tp, int flag)); 70 int (*l_read) __P((struct tty *tp, struct uio *uio, 71 int flag)); 72 int (*l_write) __P((struct tty *tp, struct uio *uio, 73 int flag)); 74 int (*l_ioctl) __P((struct tty *tp, int cmd, caddr_t data, 75 int flag, struct proc *p)); 76 int (*l_rint) __P((int c, struct tty *tp)); 77 int (*l_start) __P((struct tty *tp)); 78 int (*l_modem) __P((struct tty *tp, int flag)); 79 }; 80 81 #ifdef KERNEL 82 extern struct linesw linesw[]; 83 #endif 84 85 struct swdevt { 86 dev_t sw_dev; 87 int sw_flags; 88 int sw_nblks; 89 struct vnode *sw_vp; 90 }; 91 #define SW_FREED 0x01 92 #define SW_SEQUENTIAL 0x02 93 #define sw_freed sw_flags /* XXX compat */ 94 95 #ifdef KERNEL 96 extern struct swdevt swdevt[]; 97 #endif 98