Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/gehenna-devsw]: src/sys/dev/pci Add the character device switch.
details: https://anonhg.NetBSD.org/src/rev/ef2e736c143c
branches: gehenna-devsw
changeset: 527082:ef2e736c143c
user: gehenna <gehenna%NetBSD.org@localhost>
date: Thu May 16 11:56:43 2002 +0000
description:
Add the character device switch.
diffstat:
sys/dev/pci/agp.c | 15 ++++++++++++---
sys/dev/pci/bktr/bktr_os.c | 19 ++++++++++++++++---
sys/dev/pci/mly.c | 15 +++++++++++----
sys/dev/pci/pci_usrreq.c | 20 ++++++++++----------
4 files changed, 49 insertions(+), 20 deletions(-)
diffs (180 lines):
diff -r 67b2b9a9274f -r ef2e736c143c sys/dev/pci/agp.c
--- a/sys/dev/pci/agp.c Thu May 16 11:55:03 2002 +0000
+++ b/sys/dev/pci/agp.c Thu May 16 11:56:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: agp.c,v 1.14 2002/01/22 17:29:36 augustss Exp $ */
+/* $NetBSD: agp.c,v 1.14.8.1 2002/05/16 11:56:43 gehenna Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.14 2002/01/22 17:29:36 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.14.8.1 2002/05/16 11:56:43 gehenna Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -92,7 +92,16 @@
/* XXXfvdl get rid of this one. */
extern struct cfdriver agp_cd;
-cdev_decl(agp);
+
+dev_type_open(agpopen);
+dev_type_close(agpclose);
+dev_type_ioctl(agpioctl);
+dev_type_mmap(agpmmap);
+
+const struct cdevsw agp_cdevsw = {
+ agpopen, agpclose, noread, nowrite, agpioctl,
+ nostop, notty, nopoll, agpmmap,
+};
int agpmatch(struct device *, struct cfdata *, void *);
void agpattach(struct device *, struct device *, void *);
diff -r 67b2b9a9274f -r ef2e736c143c sys/dev/pci/bktr/bktr_os.c
--- a/sys/dev/pci/bktr/bktr_os.c Thu May 16 11:55:03 2002 +0000
+++ b/sys/dev/pci/bktr/bktr_os.c Thu May 16 11:56:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bktr_os.c,v 1.28 2002/01/07 18:05:34 jmcneill Exp $ */
+/* $NetBSD: bktr_os.c,v 1.28.8.1 2002/05/16 11:56:43 gehenna Exp $ */
/* FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.20 2000/10/20 08:16:53 roger Exp */
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bktr_os.c,v 1.28 2002/01/07 18:05:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bktr_os.c,v 1.28.8.1 2002/05/16 11:56:43 gehenna Exp $");
#ifdef __FreeBSD__
#include "bktr.h"
@@ -170,6 +170,19 @@
#endif
#endif /* __NetBSD__ || __OpenBSD__ */
+#ifdef __NetBSD__
+dev_type_open(bktr_open);
+dev_type_close(bktr_close);
+dev_type_read(bktr_read);
+dev_type_write(bktr_write);
+dev_type_ioctl(bktr_ioctl);
+dev_type_mmap(bktr_mmap);
+
+const struct cdevsw bktr_cdevsw = {
+ bktr_open, bktr_close, bktr_read, bktr_write, bktr_ioctl,
+ nostop, notty, nopoll, bktr_mmap,
+};
+#endif /* __NetBSD __ */
#ifdef __NetBSD__
#include <dev/ic/bt8xx.h> /* NetBSD location for .h files */
@@ -1303,6 +1316,7 @@
static int bktr_intr(void *arg) { return common_bktr_intr(arg); }
+#if defined(__OpenBSD__)
#define bktr_open bktropen
#define bktr_close bktrclose
#define bktr_read bktrread
@@ -1310,7 +1324,6 @@
#define bktr_ioctl bktrioctl
#define bktr_mmap bktrmmap
-#if defined(__OpenBSD__)
static int bktr_probe __P((struct device *, void *, void *));
#else
static int bktr_probe __P((struct device *, struct cfdata *, void *));
diff -r 67b2b9a9274f -r ef2e736c143c sys/dev/pci/mly.c
--- a/sys/dev/pci/mly.c Thu May 16 11:55:03 2002 +0000
+++ b/sys/dev/pci/mly.c Thu May 16 11:56:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mly.c,v 1.9 2002/01/14 13:23:36 tsutsui Exp $ */
+/* $NetBSD: mly.c,v 1.9.8.1 2002/05/16 11:56:43 gehenna Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.9 2002/01/14 13:23:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.9.8.1 2002/05/16 11:56:43 gehenna Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -161,14 +161,21 @@
static int mly_user_command(struct mly_softc *, struct mly_user_command *);
static int mly_user_health(struct mly_softc *, struct mly_user_health *);
-cdev_decl(mly);
-
extern struct cfdriver mly_cd;
struct cfattach mly_ca = {
sizeof(struct mly_softc), mly_match, mly_attach
};
+dev_type_open(mlyopen);
+dev_type_close(mlyclose);
+dev_type_ioctl(mlyioctl);
+
+const struct cdevsw mly_cdevsw = {
+ mlyopen, mlyclose, noread, nowrite, mlyioctl,
+ nostop, notty, nopoll, nommap,
+};
+
struct mly_ident {
u_short vendor;
u_short product;
diff -r 67b2b9a9274f -r ef2e736c143c sys/dev/pci/pci_usrreq.c
--- a/sys/dev/pci/pci_usrreq.c Thu May 16 11:55:03 2002 +0000
+++ b/sys/dev/pci/pci_usrreq.c Thu May 16 11:56:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_usrreq.c,v 1.4 2002/03/17 19:41:00 atatat Exp $ */
+/* $NetBSD: pci_usrreq.c,v 1.4.4.1 2002/05/16 11:56:43 gehenna Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.4 2002/03/17 19:41:00 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.4.4.1 2002/05/16 11:56:43 gehenna Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -55,7 +55,14 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pciio.h>
-cdev_decl(pci);
+dev_type_open(pciopen);
+dev_type_ioctl(pciioctl);
+dev_type_mmap(pcimmap);
+
+const struct cdevsw pci_cdevsw = {
+ pciopen, nullclose, noread, nowrite, pciioctl,
+ nostop, notty, nopoll, pcimmap,
+};
int
pciopen(dev_t dev, int flags, int mode, struct proc *p)
@@ -72,13 +79,6 @@
}
int
-pciclose(dev_t dev, int flags, int mode, struct proc *p)
-{
-
- return (0);
-}
-
-int
pciioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
struct pci_softc *sc = device_lookup(&pci_cd, minor(dev));
Home |
Main Index |
Thread Index |
Old Index