summaryrefslogtreecommitdiffstats
path: root/sys/gnu
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
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')
-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
-rw-r--r--sys/gnu/isdn/iispy.c50
-rw-r--r--sys/gnu/isdn/iitel.c74
-rw-r--r--sys/gnu/isdn/iitty.c76
-rw-r--r--sys/gnu/isdn/isdn.c68
7 files changed, 372 insertions, 48 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 */
diff --git a/sys/gnu/isdn/iispy.c b/sys/gnu/isdn/iispy.c
index 6acaf61..50a9a79 100644
--- a/sys/gnu/isdn/iispy.c
+++ b/sys/gnu/isdn/iispy.c
@@ -1,6 +1,6 @@
-static char _ispyid[] = "@(#)$Id: iispy.c,v 1.3 1995/03/28 07:54:40 bde Exp $";
+static char _ispyid[] = "@(#)$Id: iispy.c,v 1.4 1995/09/08 11:06:56 bde Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.3 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.4 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,10 @@ static char _ispyid[] = "@(#)$Id: iispy.c,v 1.3 1995/03/28 07:54:40 bde Exp
*
*******************************************************************************
* $Log: iispy.c,v $
+ * Revision 1.4 1995/09/08 11:06:56 bde
+ * Fix benign type mismatches in devsw functions. 82 out of 299 devsw
+ * functions were wrong.
+ *
* Revision 1.3 1995/03/28 07:54:40 bde
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
* (except in netccitt, netiso and netns) that I didn't notice when I fixed
@@ -41,11 +45,19 @@ static char _ispyid[] = "@(#)$Id: iispy.c,v 1.3 1995/03/28 07:54:40 bde Exp
#include "proc.h"
#include "user.h"
#include "uio.h"
-#include "kernel.h"
+#include <sys/kernel.h>
/*#include "malloc.h"*/
#include "gnu/isdn/isdn_ioctl.h"
+#ifdef JREMOD
+#include <sys/conf.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 59
+#endif /*JREMOD*/
+
int nispy = NISPY;
int ispy_applnr;
static int next_if =0;
@@ -180,4 +192,36 @@ ispyread(dev_t dev, struct uio * uio, int ioflag)
return error;
}
+#ifdef JREMOD
+struct cdevsw ispy_cdevsw =
+ { ispyopen, ispyclose, ispyread, nowrite, /*59*/
+ ispyioctl, nostop, nullreset, nodevtotty,/* ispy */
+ seltrue, nommap, NULL };
+
+static ispy_devsw_installed = 0;
+
+static void ispy_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! ispy_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&ispy_cdevsw,NULL);
+ ispy_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*/
+ "/", "ispy", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(ispydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ispy_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif
diff --git a/sys/gnu/isdn/iitel.c b/sys/gnu/isdn/iitel.c
index 5cc1d59..a714f38 100644
--- a/sys/gnu/isdn/iitel.c
+++ b/sys/gnu/isdn/iitel.c
@@ -1,6 +1,6 @@
-static char _itelid[] = "@(#)$Id: iitel.c,v 1.5 1995/09/08 11:06:57 bde Exp $";
+static char _itelid[] = "@(#)$Id: iitel.c,v 1.6 1995/11/16 10:22:29 bde Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.5 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.6 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,13 @@ static char _itelid[] = "@(#)$Id: iitel.c,v 1.5 1995/09/08 11:06:57 bde Exp
*
*******************************************************************************
* $Log: iitel.c,v $
+ * Revision 1.6 1995/11/16 10:22:29 bde
+ * Fixed the type of itel_input(). A trailing arg was missing.
+ *
+ * Included "conf.h" to get some prototypes.
+ *
+ * Removed some useless includes.
+ *
* Revision 1.5 1995/09/08 11:06:57 bde
* Fix benign type mismatches in devsw functions. 82 out of 299 devsw
* functions were wrong.
@@ -41,18 +48,25 @@ static char _itelid[] = "@(#)$Id: iitel.c,v 1.5 1995/09/08 11:06:57 bde Exp
#include "itel.h"
#if NITEL > 0
-#include "param.h"
-#include "buf.h"
-#include "systm.h"
-#include "conf.h"
-#include "ioctl.h"
-#include "proc.h"
-#include "uio.h"
-#include "kernel.h"
-#include "malloc.h"
+#include <sys/param.h>
+#include <sys/buf.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/ioctl.h>
+#include <sys/proc.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
#include "gnu/isdn/isdn_ioctl.h"
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 57
+#endif /*JREMOD*/
+
int nitel = NITEL;
static int applnr[NITEL];
static int next_if =0;
@@ -250,4 +264,42 @@ itelwrite(dev_t dev, struct uio * uio, int ioflag)
return error;
}
+#ifdef JREMOD
+struct cdevsw itel_cdevsw =
+ { itelopen, itelclose, itelread, itelwrite, /*57*/
+ itelioctl, nostop, nullreset, nodevtotty,/* itel */
+ seltrue, nommap, NULL };
+
+static itel_devsw_installed = 0;
+
+static void itel_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! itel_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&itel_cdevsw,NULL);
+ dev_chr = dev;
+#if defined(BDEV_MAJOR)
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&itel_bdevsw,NULL);
+#endif /*BDEV_MAJOR*/
+ itel_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*/
+ "/", "itel", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(iteldev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,itel_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif
diff --git a/sys/gnu/isdn/iitty.c b/sys/gnu/isdn/iitty.c
index 5ad2b08..bd39e83 100644
--- a/sys/gnu/isdn/iitty.c
+++ b/sys/gnu/isdn/iitty.c
@@ -1,6 +1,6 @@
-static char _ittyid[] = "@(#)$Id: iitty.c,v 1.11 1995/07/31 21:28:42 bde Exp $";
+static char _ittyid[] = "@(#)$Id: iitty.c,v 1.12 1995/11/16 10:35:29 bde Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.11 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.12 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,15 @@ static char _ittyid[] = "@(#)$Id: iitty.c,v 1.11 1995/07/31 21:28:42 bde Exp
*
*******************************************************************************
* $Log: iitty.c,v $
+ * Revision 1.12 1995/11/16 10:35:29 bde
+ * Fixed the type of ity_input(). A trailing arg was missing.
+ *
+ * Completed function declarations.
+ *
+ * Added prototypes.
+ *
+ * Removed some useless includes.
+ *
* Revision 1.11 1995/07/31 21:28:42 bde
* Use tsleep() instead of ttysleep() to wait for carrier since a generation
* change isn't an error.
@@ -141,21 +150,28 @@ static char _ittyid[] = "@(#)$Id: iitty.c,v 1.11 1995/07/31 21:28:42 bde Exp
#include "ity.h"
#if NITY > 0
-#include "param.h"
-#include "systm.h"
-#include "conf.h"
-#include "ioctl.h"
-#include "select.h"
-#include "tty.h"
-#include "proc.h"
-#include "file.h"
-#include "uio.h"
-#include "kernel.h"
-#include "syslog.h"
-#include "types.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/ioctl.h>
+#include <sys/select.h>
+#include <sys/tty.h>
+#include <sys/proc.h>
+#include <sys/file.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/syslog.h>
+#include <sys/types.h>
#include "gnu/isdn/isdn_ioctl.h"
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 56
+#endif /*JREMOD*/
+
extern int ityparam __P((struct tty *tp, struct termios *t));
extern void itystart __P((struct tty *tp));
@@ -442,4 +458,36 @@ itydevtotty(dev_t dev)
return (&ity_tty[unit]);
}
+#ifdef JREMOD
+struct cdevsw ity_cdevsw =
+ { ityopen, ityclose, ityread, itywrite, /*56*/
+ ityioctl, nostop, nxreset, itydevtotty,/* ity */
+ ttselect, nommap, NULL };
+
+static ity_devsw_installed = 0;
+
+static void ity_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! ity_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&ity_cdevsw,NULL);
+ ity_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*/
+ "/", "ity", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(itydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ity_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif
diff --git a/sys/gnu/isdn/isdn.c b/sys/gnu/isdn/isdn.c
index c653627..9338a5e 100644
--- a/sys/gnu/isdn/isdn.c
+++ b/sys/gnu/isdn/isdn.c
@@ -1,6 +1,6 @@
-static char _isdnid[] = "@(#)$Id: isdn.c,v 1.5 1995/09/08 11:06:58 bde Exp $";
+static char _isdnid[] = "@(#)$Id: isdn.c,v 1.6 1995/11/16 10:47:21 bde Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.5 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.6 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,19 @@ static char _isdnid[] = "@(#)$Id: isdn.c,v 1.5 1995/09/08 11:06:58 bde Exp $
*
*******************************************************************************
* $Log: isdn.c,v $
+ * Revision 1.6 1995/11/16 10:47:21 bde
+ * Fixed a call to the listen function. A trailing arg was missing.
+ *
+ * Fixed the type of isdn_check(). A trailing arg was missing.
+ *
+ * Included "conf.h" to get some prototypes.
+ *
+ * Completed function declarations.
+ *
+ * Added prototypes.
+ *
+ * Removed some useless includes.
+ *
* Revision 1.5 1995/09/08 11:06:58 bde
* Fix benign type mismatches in devsw functions. 82 out of 299 devsw
* functions were wrong.
@@ -55,15 +68,22 @@ static char _isdnid[] = "@(#)$Id: isdn.c,v 1.5 1995/09/08 11:06:58 bde Exp $
#define TYPNR 4
#define N_ISDN_APPL (NII + NITY + NITEL + NISPY)
-#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 "gnu/isdn/isdn_ioctl.h"
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 55
+#endif /*JREMOD*/
+
isdn_appl_t isdn_appl[N_ISDN_APPL];
isdn_ctrl_t isdn_ctrl[N_ISDN_CTRL];
int Isdn_Appl, Isdn_Ctrl, Isdn_Typ;
@@ -647,4 +667,36 @@ passout(int unit, int l, char *buf)
splx(x);
}
+#ifdef JREMOD
+struct cdevsw isdn_cdevsw =
+ { isdnopen, isdnclose, isdnread, nowrite, /*55*/
+ isdnioctl, nostop, nullreset, nodevtotty,/* isdn */
+ seltrue, nommap, NULL };
+
+static isdn_devsw_installed = 0;
+
+static void isdn_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! isdn_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&isdn_cdevsw,NULL);
+ isdn_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*/
+ "/", "isdn", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(isdndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,isdn_drvinit,NULL)
+
+#endif /* JREMOD */
+
#endif /* NISDN > 0 */
OpenPOWER on IntegriCloud