Source-Changes-HG archive

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

[src/gehenna-devsw]: src/sys/dev/ofw Add the character device switch.



details:   https://anonhg.NetBSD.org/src/rev/b1cb5093430c
branches:  gehenna-devsw
changeset: 527084:b1cb5093430c
user:      gehenna <gehenna%NetBSD.org@localhost>
date:      Thu May 16 11:59:59 2002 +0000

description:
Add the character device switch.

diffstat:

 sys/dev/ofw/ofrtc.c      |  21 +++++++++++----------
 sys/dev/ofw/openfirmio.c |  24 +++++++++---------------
 2 files changed, 20 insertions(+), 25 deletions(-)

diffs (107 lines):

diff -r 626ec7214738 -r b1cb5093430c sys/dev/ofw/ofrtc.c
--- a/sys/dev/ofw/ofrtc.c       Thu May 16 11:57:45 2002 +0000
+++ b/sys/dev/ofw/ofrtc.c       Thu May 16 11:59:59 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofrtc.c,v 1.10 2001/11/13 07:26:28 lukem Exp $ */
+/*     $NetBSD: ofrtc.c,v 1.10.8.1 2002/05/16 11:59:59 gehenna Exp $   */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofrtc.c,v 1.10 2001/11/13 07:26:28 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofrtc.c,v 1.10.8.1 2002/05/16 11:59:59 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,8 +41,6 @@
 
 #include <dev/ofw/openfirm.h>
 
-cdev_decl(ofrtc_);
-
 struct ofrtc_softc {
        struct device sc_dev;
        int sc_phandle;
@@ -58,6 +56,15 @@
 
 extern struct cfdriver ofrtc_cd;
 
+dev_type_open(ofrtc_open);
+dev_type_read(ofrtc_read);
+dev_type_write(ofrtc_write);
+
+const struct cdevsw ofrtc_cdevsw = {
+       ofrtc_open, nullclose, ofrtc_read, ofrtc_write, noioctl,
+       nostop, notty, nopoll, nommap,
+};
+
 static int
 ofrtc_match(struct device *parent, struct cfdata *match, void *aux)
 {
@@ -126,12 +133,6 @@
        return 0;
 }
 
-int
-ofrtc_close(dev_t dev, int flags, int fmt, struct proc *p)
-{
-       return 0;
-}
-
 static void
 twodigit(char *bp, int i)
 {
diff -r 626ec7214738 -r b1cb5093430c sys/dev/ofw/openfirmio.c
--- a/sys/dev/ofw/openfirmio.c  Thu May 16 11:57:45 2002 +0000
+++ b/sys/dev/ofw/openfirmio.c  Thu May 16 11:59:59 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openfirmio.c,v 1.3 2001/11/13 07:26:29 lukem Exp $ */
+/*     $NetBSD: openfirmio.c,v 1.3.8.1 2002/05/16 11:59:59 gehenna Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: openfirmio.c,v 1.3 2001/11/13 07:26:29 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: openfirmio.c,v 1.3.8.1 2002/05/16 11:59:59 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,25 +66,19 @@
 
 void openfirmattach (int);
 
+dev_type_ioctl(openfirmioctl);
+
+const struct cdevsw openfirm_cdevsw = {
+       nullopen, nullclose, noread, nowrite, openfirmioctl,
+       nostop, notty, nopoll, nommap,
+};
+
 void
 openfirmattach(int num)
 {
        /* nothing */
 }
 
-int
-openfirmopen(dev_t dev, int flags, int mode, struct proc *p)
-{
-       return (0);
-}
-
-int
-openfirmclose(dev_t dev, int flags, int mode, struct proc *p)
-{
-
-       return (0);
-}
-
 /*
  * Verify target ID is valid (exists in the OPENPROM tree), as
  * listed from node ID sid forward.



Home | Main Index | Thread Index | Old Index