summaryrefslogtreecommitdiffstats
path: root/sys/gnu/i386
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-11-29 10:49:16 +0000
committerjulian <julian@FreeBSD.org>1995-11-29 10:49:16 +0000
commitf2f63c6ece7d25485976323df6d684743fe14bb6 (patch)
tree5ed2d747156a38098db0e540f833114bc9dd1b51 /sys/gnu/i386
parentbe48321f04abe146ffbc5091fe940b107f46c175 (diff)
downloadFreeBSD-src-f2f63c6ece7d25485976323df6d684743fe14bb6.zip
FreeBSD-src-f2f63c6ece7d25485976323df6d684743fe14bb6.tar.gz
OK, that's it..
That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
Diffstat (limited to 'sys/gnu/i386')
-rw-r--r--sys/gnu/i386/isa/dgb.c41
-rw-r--r--sys/gnu/i386/isa/nic3008.c51
-rw-r--r--sys/gnu/i386/isa/nic3009.c60
3 files changed, 140 insertions, 12 deletions
diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c
index 1e61971..11a868a 100644
--- a/sys/gnu/i386/isa/dgb.c
+++ b/sys/gnu/i386/isa/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.4 1995/10/12 23:28:31 bde Exp $
+ * dgb.c $Id: dgb.c,v 1.5 1995/11/04 13:22:59 bde Exp $
*
* Digiboard driver.
*
@@ -51,6 +51,13 @@
#include <gnu/i386/isa/dgfep.h>
#include <gnu/i386/isa/dgreg.h>
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 58
+#endif /*JREMOD*/
+
#define CALLOUT_MASK 0x80
#define CONTROL_MASK 0x60
#define CONTROL_INIT_STATE 0x20
@@ -1979,4 +1986,36 @@ fepcmd(port, cmd, op1, op2, ncmds, bytecmd)
port->unit, port->pnum);
}
+#ifdef JREMOD
+struct cdevsw dgb_cdevsw =
+ { dgbopen, dgbclose, dgbread, dgbwrite, /*58*/
+ dgbioctl, dgbstop, nxreset, dgbdevtotty, /* dgb */
+ ttselect, nommap, NULL };
+
+static dgb_devsw_installed = 0;
+
+static void dgb_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! dgb_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&dgb_cdevsw,NULL);
+ dgb_devsw_installed = 1;
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name major minor type uid gid perm*/
+ "/", "dgb", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(dgbdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,dgb_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif /* NDGB > 0 */
diff --git a/sys/gnu/i386/isa/nic3008.c b/sys/gnu/i386/isa/nic3008.c
index 5a71444..0913003 100644
--- a/sys/gnu/i386/isa/nic3008.c
+++ b/sys/gnu/i386/isa/nic3008.c
@@ -1,6 +1,6 @@
-static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.8 1995/11/18 04:19:44 bde Exp $";
+static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.9 1995/11/21 14:56:01 bde Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.8 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.9 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,10 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.8 1995/11/18 04:19:44 bde E
*
*******************************************************************************
* $Log: nic3008.c,v $
+ * Revision 1.9 1995/11/21 14:56:01 bde
+ * Completed function declarations, added prototypes and removed redundant
+ * declarations.
+ *
* Revision 1.8 1995/11/18 04:19:44 bde
* Fixed the type of nic_listen(). A trailing arg was missing.
*
@@ -63,7 +67,7 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.8 1995/11/18 04:19:44 bde E
#include "ioctl.h"
#include "kernel.h"
#include "systm.h"
-#include "conf.h"
+#include <sys/conf.h>
#include <sys/proc.h>
#include "i386/isa/isa_device.h"
@@ -71,6 +75,14 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.8 1995/11/18 04:19:44 bde E
#include "gnu/i386/isa/niccyreg.h"
#include "gnu/isdn/isdn_ioctl.h"
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 54
+#endif /*JREMOD*/
+
+
#define OPEN 1
#define LOAD_HEAD 3
#define LOAD_DATA 5
@@ -1206,4 +1218,37 @@ nicintr(int unit)
}
}
+
+#ifdef JREMOD
+struct cdevsw nic_cdevsw =
+ { nicopen, nicclose, noread, nowrite, /*54*/
+ nicioctl, nostop, nullreset, nodevtotty,/* nic */
+ seltrue, nommap, NULL };
+
+static nic_devsw_installed = 0;
+
+static void nic_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! nic_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&nic_cdevsw,NULL);
+ nic_devsw_installed = 1;
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "nic", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(nicdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,nic_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif /* NNIC > 0 */
diff --git a/sys/gnu/i386/isa/nic3009.c b/sys/gnu/i386/isa/nic3009.c
index 9793ebe..083d50f 100644
--- a/sys/gnu/i386/isa/nic3009.c
+++ b/sys/gnu/i386/isa/nic3009.c
@@ -1,6 +1,6 @@
-static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.8 1995/09/19 18:54:42 bde Exp $";
+static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.9 1995/11/21 14:56:02 bde Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.8 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.9 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,10 @@ static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.8 1995/09/19 18:54:42 bde E
*
*******************************************************************************
* $Log: nic3009.c,v $
+ * Revision 1.9 1995/11/21 14:56:02 bde
+ * Completed function declarations, added prototypes and removed redundant
+ * declarations.
+ *
* Revision 1.8 1995/09/19 18:54:42 bde
* Fix benign type mismatches in isa interrupt handlers. Many returned int
* instead of void.
@@ -58,18 +62,25 @@ static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.8 1995/09/19 18:54:42 bde E
#include "nnic.h"
#if NNNIC > 0
-#include "param.h"
-#include "ioctl.h"
-#include "kernel.h"
-#include "systm.h"
-#include "conf.h"
-#include "proc.h"
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/proc.h>
#include "i386/isa/isa_device.h"
#include "gnu/i386/isa/nic3009.h"
#include "gnu/i386/isa/niccyreg.h"
#include "gnu/isdn/isdn_ioctl.h"
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 60
+#endif /*JREMOD*/
+
#define OPEN 1
#define LOAD_HEAD 3
#define LOAD_DATA 5
@@ -1270,4 +1281,37 @@ nnicintr(int unit)
timeout(nnnicintr, (void *)unit,1);
}
+
+#ifdef JREMOD
+struct cdevsw nnic_cdevsw =
+ { nnicopen, nnicclose, noread, nowrite, /*60*/
+ nnicioctl, nostop, nullreset, nodevtotty,/* nnic */
+ seltrue, nommap, NULL };
+
+static nnic_devsw_installed = 0;
+
+static void nnic_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! nnic_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&nnic_cdevsw,NULL);
+ nnic_devsw_installed = 1;
+#ifdef DEVFS
+ {
+ int x;
+/* default for a simple device with no probe routine (usually delete this) */
+ x=devfs_add_devsw(
+/* path name devsw minor type uid gid perm*/
+ "/", "nnic", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(nnicdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,nnic_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif /* NNNIC > 0 */
OpenPOWER on IntegriCloud