Source-Changes-HG archive

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

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



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

description:
Add the character device switch.

diffstat:

 sys/dev/qbus/dl.c |  21 ++++++++++++++++-----
 sys/dev/qbus/ts.c |  24 +++++++++++++++++++-----
 2 files changed, 35 insertions(+), 10 deletions(-)

diffs (96 lines):

diff -r e780ae9de636 -r e751f3959c36 sys/dev/qbus/dl.c
--- a/sys/dev/qbus/dl.c Thu May 16 11:47:15 2002 +0000
+++ b/sys/dev/qbus/dl.c Thu May 16 11:49:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dl.c,v 1.20 2002/03/17 19:41:01 atatat Exp $   */
+/*     $NetBSD: dl.c,v 1.20.4.1 2002/05/16 11:49:10 gehenna Exp $      */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dl.c,v 1.20 2002/03/17 19:41:01 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dl.c,v 1.20.4.1 2002/05/16 11:49:10 gehenna Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -121,14 +121,25 @@
 static void    dlstart (struct tty *);
 static int     dlparam (struct tty *, struct termios *);
 static void    dlbrk (struct dl_softc *, int);
-struct tty *   dltty (dev_t);
-
-cdev_decl(dl);
 
 struct cfattach dl_ca = {
        sizeof(struct dl_softc), dl_match, dl_attach
 };
 
+dev_type_open(dlopen);
+dev_type_close(dlclose);
+dev_type_read(dlread);
+dev_type_write(dlwrite);
+dev_type_ioctl(dlioctl);
+dev_type_stop(dlstop);
+dev_type_tty(dltty);
+dev_type_poll(dlpoll);
+
+const struct cdevsw dl_cdevsw = {
+       dlopen, dlclose, dlread, dlwrite, dlioctl,
+       dlstop, dltty, dlpoll, nommap, D_TTY
+};
+
 #define        DL_READ_WORD(reg) \
        bus_space_read_2(sc->sc_iot, sc->sc_ioh, reg)
 #define        DL_WRITE_WORD(reg, val) \
diff -r e780ae9de636 -r e751f3959c36 sys/dev/qbus/ts.c
--- a/sys/dev/qbus/ts.c Thu May 16 11:47:15 2002 +0000
+++ b/sys/dev/qbus/ts.c Thu May 16 11:49:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ts.c,v 1.3 2001/11/13 07:11:25 lukem Exp $ */
+/*     $NetBSD: ts.c,v 1.3.8.1 2002/05/16 11:49:10 gehenna Exp $ */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.3 2001/11/13 07:11:25 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.3.8.1 2002/05/16 11:49:10 gehenna Exp $");
 
 #undef TSDEBUG
 
@@ -169,13 +169,27 @@
 static void tsattach(struct device *, struct device *, void *);
 static int tsready(struct uba_unit *);
 
-cdev_decl(ts);
-bdev_decl(ts);
-
 struct cfattach ts_ca = {
        sizeof(struct ts_softc), tsmatch, tsattach
 };
 
+dev_type_open(tsopen);
+dev_type_close(tsclose);
+dev_type_read(tsread);
+dev_type_write(tswrite);
+dev_type_ioctl(tsioctl);
+dev_type_strategy(tsstrategy);
+dev_type_dump(tsdump);
+
+const struct bdevsw ts_bdevsw = {
+       tsopen, tsclose, tsstrategy, tsioctl, tsdump, nosize, D_TAPE
+};
+
+const struct cdevsw ts_cdevsw = {
+       tsopen, tsclose, tsread, tswrite, tsioctl,
+       nostop, notty, nopoll, nommap, D_TAPE
+};
+
 /* Bits in minor device */ 
 #define TS_UNIT(dev)   (minor(dev)&03)
 #define TS_HIDENSITY   010



Home | Main Index | Thread Index | Old Index