diff options
author | Julian Elischer <julian@FreeBSD.org> | 1995-11-29 10:49:16 +0000 |
---|---|---|
committer | Julian Elischer <julian@FreeBSD.org> | 1995-11-29 10:49:16 +0000 |
commit | 53ac6efbd86e7552454f4b69d25d8980dd619634 (patch) | |
tree | 5ed2d747156a38098db0e540f833114bc9dd1b51 /sys/scsi/sctarg.c | |
parent | 3924871a1d9667169a58975b96b4a57759479f0e (diff) | |
download | src-53ac6efbd86e7552454f4b69d25d8980dd619634.tar.gz src-53ac6efbd86e7552454f4b69d25d8980dd619634.zip |
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)
Notes
Notes:
svn path=/head/; revision=12517
Diffstat (limited to 'sys/scsi/sctarg.c')
-rw-r--r-- | sys/scsi/sctarg.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/sys/scsi/sctarg.c b/sys/scsi/sctarg.c index b7498f592cb6..65cc2f267a0c 100644 --- a/sys/scsi/sctarg.c +++ b/sys/scsi/sctarg.c @@ -37,7 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sctarg.c,v 1.5 1995/11/19 22:22:25 dyson Exp $ + * $Id: sctarg.c,v 1.6 1995/11/21 08:35:49 bde Exp $ */ /* @@ -53,6 +53,15 @@ #include <scsi/scsi_all.h> #include <scsi/scsiconf.h> +#ifdef JREMOD +#include <sys/conf.h> +#include <sys/kernel.h> +#ifdef DEVFS +#include <sys/devfsext.h> +#endif /*DEVFS*/ +#define CDEV_MAJOR 65 +#endif /*JREMOD*/ + #define OPEN 0x01 struct scsi_data { @@ -266,3 +275,36 @@ sctarg_strategy(struct buf *bp, struct scsi_link *sc_link) splx(opri); return; } + +#ifdef JREMOD +struct cdevsw sctarg_cdevsw = + { sctargopen, sctargclose, rawread, rawwrite, /*65*/ + sctargioctl, nostop, nullreset, nodevtotty,/* sctarg */ + seltrue, nommap, sctargstrategy }; + +static sctarg_devsw_installed = 0; + +static void sctarg_drvinit(void *unused) +{ + dev_t dev; + + if( ! sctarg_devsw_installed ) { + dev = makedev(CDEV_MAJOR,0); + cdevsw_add(&dev,&sctarg_cdevsw,NULL); + sctarg_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*/ + "/", "sctarg", major(dev), 0, DV_CHR, 0, 0, 0600); + } + } +#endif +} + +SYSINIT(sctargdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,sctarg_drvinit,NULL) + +#endif /* JREMOD */ + |