Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/gehenna-devsw]: src/sys/dev Add the block/character device switches.



details:   https://anonhg.NetBSD.org/src/rev/3a4e23002c58
branches:  gehenna-devsw
changeset: 527057:3a4e23002c58
user:      gehenna <gehenna%NetBSD.org@localhost>
date:      Thu May 16 04:47:32 2002 +0000

description:
Add the block/character device switches.

diffstat:

 sys/dev/ccd.c |  23 ++++++++++++++++++++---
 sys/dev/md.c  |  40 +++++++++++++++++++---------------------
 sys/dev/vnd.c |  22 ++++++++++++++++++++--
 3 files changed, 59 insertions(+), 26 deletions(-)

diffs (162 lines):

diff -r a2786c99d711 -r 3a4e23002c58 sys/dev/ccd.c
--- a/sys/dev/ccd.c     Thu May 16 04:44:50 2002 +0000
+++ b/sys/dev/ccd.c     Thu May 16 04:47:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ccd.c,v 1.76 2002/03/08 20:48:37 thorpej Exp $ */
+/*     $NetBSD: ccd.c,v 1.76.6.1 2002/05/16 04:47:32 gehenna Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.76 2002/03/08 20:48:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.76.6.1 2002/05/16 04:47:32 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -151,7 +151,6 @@
 
 /* called by biodone() at interrupt time */
 void   ccdiodone __P((struct buf *));
-int    ccdsize __P((dev_t));
 
 static void ccdstart __P((struct ccd_softc *, struct buf *));
 static void ccdinterleave __P((struct ccd_softc *));
@@ -165,6 +164,24 @@
 static void ccdgetdisklabel __P((dev_t));
 static void ccdmakedisklabel __P((struct ccd_softc *));
 
+dev_type_open(ccdopen);
+dev_type_close(ccdclose);
+dev_type_read(ccdread);
+dev_type_write(ccdwrite);
+dev_type_ioctl(ccdioctl);
+dev_type_strategy(ccdstrategy);
+dev_type_dump(ccddump);
+dev_type_size(ccdsize);
+
+const struct bdevsw ccd_bdevsw = {
+       ccdopen, ccdclose, ccdstrategy, ccdioctl, ccddump, ccdsize, D_DISK
+};
+
+const struct cdevsw ccd_cdevsw = {
+       ccdopen, ccdclose, ccdread, ccdwrite, ccdioctl,
+       nostop, notty, nopoll, nommap, D_DISK
+};
+
 #ifdef DEBUG
 static void printiinfo __P((struct ccdiinfo *));
 #endif
diff -r a2786c99d711 -r 3a4e23002c58 sys/dev/md.c
--- a/sys/dev/md.c      Thu May 16 04:44:50 2002 +0000
+++ b/sys/dev/md.c      Thu May 16 04:47:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.28 2002/01/13 19:28:07 tsutsui Exp $  */
+/*     $NetBSD: md.c,v 1.28.8.1 2002/05/16 04:47:32 gehenna Exp $      */
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.28 2002/01/13 19:28:07 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.28.8.1 2002/05/16 04:47:32 gehenna Exp $");
 
 #include "opt_md.h"
 
@@ -95,7 +95,23 @@
 void mdattach __P((int));
 static void md_attach __P((struct device *, struct device *, void *));
 
-void mdstrategy __P((struct buf *bp));
+dev_type_open(mdopen);
+dev_type_close(mdclose);
+dev_type_read(mdread);
+dev_type_write(mdwrite);
+dev_type_ioctl(mdioctl);
+dev_type_strategy(mdstrategy);
+dev_type_size(mdsize);
+
+const struct bdevsw md_bdevsw = {
+       mdopen, mdclose, mdstrategy, mdioctl, nodump, mdsize, D_DISK
+};
+
+const struct cdevsw md_cdevsw = {
+       mdopen, mdclose, mdread, mdwrite, mdioctl,
+       nostop, notty, nopoll, nommap, D_DISK
+};
+
 struct dkdriver mddkdriver = { mdstrategy };
 
 static int   ramdisk_ndevs;
@@ -181,24 +197,6 @@
 static int md_ioctl_kalloc __P((struct md_softc *sc,
                struct md_conf *umd, struct proc *proc));
 
-dev_type_open(mdopen);
-dev_type_close(mdclose);
-dev_type_read(mdread);
-dev_type_write(mdwrite);
-dev_type_ioctl(mdioctl);
-dev_type_size(mdsize);
-dev_type_dump(mddump);
-
-int
-mddump(dev, blkno, va, size)
-       dev_t dev;
-       daddr_t blkno;
-       caddr_t va;
-       size_t size;
-{
-       return ENODEV;
-}
-
 int
 mdsize(dev_t dev)
 {
diff -r a2786c99d711 -r 3a4e23002c58 sys/dev/vnd.c
--- a/sys/dev/vnd.c     Thu May 16 04:44:50 2002 +0000
+++ b/sys/dev/vnd.c     Thu May 16 04:47:32 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnd.c,v 1.79 2002/05/02 16:25:23 briggs Exp $  */
+/*     $NetBSD: vnd.c,v 1.79.2.1 2002/05/16 04:47:32 gehenna Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.79 2002/05/02 16:25:23 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.79.2.1 2002/05/16 04:47:32 gehenna Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "fs_nfs.h"
@@ -183,6 +183,24 @@
 static int vndlock __P((struct vnd_softc *));
 static void vndunlock __P((struct vnd_softc *));
 
+dev_type_open(vndopen);
+dev_type_close(vndclose);
+dev_type_read(vndread);
+dev_type_write(vndwrite);
+dev_type_ioctl(vndioctl);
+dev_type_strategy(vndstrategy);
+dev_type_dump(vnddump);
+dev_type_size(vndsize);
+
+const struct bdevsw vnd_bdevsw = {
+       vndopen, vndclose, vndstrategy, vndioctl, vnddump, vndsize, D_DISK
+};
+
+const struct cdevsw vnd_cdevsw = {
+       vndopen, vndclose, vndread, vndwrite, vndioctl,
+       nostop, notty, nopoll, nommap, D_DISK
+};
+
 void
 vndattach(num)
        int num;



Home | Main Index | Thread Index | Old Index