diff options
author | julian <julian@FreeBSD.org> | 1995-11-29 10:49:16 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-11-29 10:49:16 +0000 |
commit | f2f63c6ece7d25485976323df6d684743fe14bb6 (patch) | |
tree | 5ed2d747156a38098db0e540f833114bc9dd1b51 /sys/gnu/isdn/iitel.c | |
parent | be48321f04abe146ffbc5091fe940b107f46c175 (diff) | |
download | FreeBSD-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/isdn/iitel.c')
-rw-r--r-- | sys/gnu/isdn/iitel.c | 74 |
1 files changed, 63 insertions, 11 deletions
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 |