summaryrefslogtreecommitdiffstats
path: root/sys/scsi
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/scsi
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/scsi')
-rw-r--r--sys/scsi/cd.c56
-rw-r--r--sys/scsi/ch.c47
-rw-r--r--sys/scsi/od.c53
-rw-r--r--sys/scsi/pt.c44
-rw-r--r--sys/scsi/sctarg.c44
-rw-r--r--sys/scsi/sd.c57
-rw-r--r--sys/scsi/ssc.c50
-rw-r--r--sys/scsi/st.c62
-rw-r--r--sys/scsi/su.c43
-rw-r--r--sys/scsi/uk.c44
-rw-r--r--sys/scsi/worm.c45
11 files changed, 526 insertions, 19 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index f4f31d9..2418658 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: cd.c,v 1.44 1995/11/19 22:22:18 dyson Exp $
+ * $Id: cd.c,v 1.45 1995/11/20 12:42:25 phk Exp $
*/
#define SPLCD splbio
@@ -41,6 +41,15 @@
#include <sys/devconf.h>
#include <sys/dkstat.h>
+#ifdef JREMOD
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 15
+#define BDEV_MAJOR 6
+#endif /*JREMOD */
+
/* static function prototypes */
static errval cd_get_parms __P((int, int));
static errval cd_get_mode __P((u_int32, struct cd_mode_data *, u_int32));
@@ -1296,3 +1305,48 @@ cdsize(dev_t dev)
{
return (-1);
}
+
+#ifdef JREMOD
+struct bdevsw cd_bdevsw =
+ { cdopen, cdclose, cdstrategy, cdioctl, /*6*/
+ nxdump, cdsize, 0 };
+#endif /*JREMOD*/
+
+#ifdef JREMOD
+struct cdevsw cd_cdevsw =
+ { cdopen, cdclose, rawread, nowrite, /*15*/
+ cdioctl, nostop, nullreset, nodevtotty,/* cd */
+ seltrue, nommap, cdstrategy };
+
+static cd_devsw_installed = 0;
+
+static void cd_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! cd_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&cd_cdevsw,NULL);
+ dev_chr = dev;
+#if defined(BDEV_MAJOR)
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&cd_bdevsw,NULL);
+#endif /*BDEV_MAJOR*/
+ cd_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*/
+ "/", "cd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(cddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cd_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c
index 12045d9..b8edea3 100644
--- a/sys/scsi/ch.c
+++ b/sys/scsi/ch.c
@@ -1,8 +1,8 @@
/*
- * Written by grefen@?????
+ * Written by grefen@convex.com (probably moved by now)
* Based on scsi drivers by Julian Elischer (julian@tfs.com)
*
- * $Id: ch.c,v 1.21 1995/05/30 08:13:22 rgrimes Exp $
+ * $Id: ch.c,v 1.22 1995/11/20 12:42:27 phk Exp $
*/
#include <sys/types.h>
@@ -24,6 +24,16 @@
#include <scsi/scsiconf.h>
#include <sys/devconf.h>
+#ifdef JREMOD
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 17
+#endif /*JREMOD*/
+
+
errval ch_getelem __P((u_int32 unit, short *stat, int type, u_int32 from,
void *data, u_int32 flags));
errval ch_move __P((u_int32 unit, short *stat, u_int32 chm, u_int32 from,
@@ -501,3 +511,36 @@ ch_mode_sense(unit, flags)
cd->rot ? "can" : "can't"));
return (0);
}
+
+#ifdef JREMOD
+struct cdevsw ch_cdevsw =
+ { chopen, chclose, noread, nowrite, /*17*/
+ chioctl, nostop, nullreset, nodevtotty,/* ch */
+ noselect, nommap, nostrat };
+
+static ch_devsw_installed = 0;
+
+static void ch_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! ch_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&ch_cdevsw,NULL);
+ ch_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*/
+ "/", "ch", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(chdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ch_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/od.c b/sys/scsi/od.c
index 60a8836..dca9c67 100644
--- a/sys/scsi/od.c
+++ b/sys/scsi/od.c
@@ -28,7 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: od.c,v 1.2 1995/11/19 22:22:21 dyson Exp $
+ * $Id: od.c,v 1.3 1995/11/20 12:42:28 phk Exp $
*/
/*
@@ -62,6 +62,14 @@
#include <machine/md_var.h>
#include <i386/i386/cons.h> /* XXX */
+#ifdef JREMOD
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 70
+#define BDEV_MAJOR 20
+#endif /*JREMOD */
+
u_int32 odstrats, odqueues;
#define SECSIZE 512
@@ -797,3 +805,46 @@ od_sense_handler(struct scsi_xfer *xs)
return SCSIRET_DO_RETRY;
}
+
+#ifdef JREMOD
+struct bdevsw od_bdevsw =
+ { odopen, odclose, odstrategy, odioctl, /*20*/
+ nxdump, odsize, 0 };
+
+struct cdevsw od_cdevsw =
+ { odopen, odclose, rawread, rawwrite, /*70*/
+ odioctl, nostop, nullreset, nodevtotty,/* od */
+ seltrue, nommap, odstrategy };
+
+static od_devsw_installed = 0;
+
+static void od_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! od_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&od_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&od_bdevsw,NULL);
+ od_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*/
+ "/", "rod", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "od", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(oddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,od_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/pt.c b/sys/scsi/pt.c
index 6ecc795..6d34963 100644
--- a/sys/scsi/pt.c
+++ b/sys/scsi/pt.c
@@ -37,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pt.c,v 1.5 1995/05/30 08:13:23 rgrimes Exp $
+ * $Id: pt.c,v 1.6 1995/11/19 22:22:23 dyson 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 61
+#endif /*JREMOD*/
+
struct scsi_data {
struct buf_queue_head buf_queue;
};
@@ -249,3 +258,36 @@ int pt_sense(struct scsi_xfer *xs)
return SCSIRET_CONTINUE;
}
}
+
+#ifdef JREMOD
+struct cdevsw pt_cdevsw =
+ { ptopen, ptclose, rawread, rawwrite, /*61*/
+ ptioctl, nostop, nullreset, nodevtotty,/* pt */
+ seltrue, nommap, ptstrategy };
+
+static pt_devsw_installed = 0;
+
+static void pt_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! pt_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&pt_cdevsw,NULL);
+ pt_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*/
+ "/", "pt", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(ptdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pt_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/sctarg.c b/sys/scsi/sctarg.c
index b7498f5..65cc2f2 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 */
+
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 501aff5..586812d 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.71 1995/11/20 02:12:34 davidg Exp $
+ * $Id: sd.c,v 1.72 1995/11/20 12:42:32 phk Exp $
*/
#define SPLSD splbio
@@ -39,6 +39,16 @@
#include <machine/md_var.h>
#include <i386/i386/cons.h> /* XXX */
+#ifdef JREMOD
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 13
+#define BDEV_MAJOR 4
+#endif /*JREMOD */
+
u_int32 sdstrats, sdqueues;
#define SECSIZE 512
@@ -236,7 +246,7 @@ sd_open(dev, mode, fmt, p, sc_link)
* "unit attention" errors should occur here if the
* drive has been restarted or the pack changed.
* just ingnore the result, it's a decoy instruction
- * The error code will act on the error though
+ * The error handlers will act on the error though
* and invalidate any media information we had.
*/
scsi_test_unit_ready(sc_link, 0);
@@ -950,3 +960,46 @@ sddump(dev_t dev)
}
return (0);
}
+
+#ifdef JREMOD
+struct bdevsw sd_bdevsw =
+ { sdopen, sdclose, sdstrategy, sdioctl, /*4*/
+ sddump, sdsize, 0 };
+
+struct cdevsw sd_cdevsw =
+ { sdopen, sdclose, rawread, rawwrite, /*13*/
+ sdioctl, nostop, nullreset, nodevtotty,/* sd */
+ seltrue, nommap, sdstrategy };
+
+static sd_devsw_installed = 0;
+
+static void sd_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! sd_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&sd_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&sd_bdevsw,NULL);
+ sd_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*/
+ "/", "rsd", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ x=devfs_add_devsw(
+ "/", "sd", major(dev), 0, DV_BLK, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(sddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,sd_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/ssc.c b/sys/scsi/ssc.c
index 442e12b..43a7adb 100644
--- a/sys/scsi/ssc.c
+++ b/sys/scsi/ssc.c
@@ -49,7 +49,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*End copyright
- * $Id: ssc.c,v 1.3 1995/05/03 18:09:18 dufault Exp $
+ * $Id: ssc.c,v 1.4 1995/11/04 11:12:41 bde Exp $
*/
#include <sys/types.h>
@@ -63,6 +63,14 @@
#include <sys/buf.h>
#include <sys/systm.h>
+#ifdef JREMOD
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 49
+#endif /*JREMOD*/
+
static dev_t sscdev = NODEV;
int sscopen(dev_t dev, int flag, int type, struct proc *p)
@@ -116,3 +124,43 @@ void sscstrategy(struct buf *bp) { }
int sscread(dev_t dev, struct uio *uio, int ioflag) { return ENXIO; }
int sscwrite(dev_t dev, struct uio *uio, int ioflag) { return ENXIO; }
int sscselect(dev_t dev, int which, struct proc *p) { return ENXIO; }
+
+
+#ifdef JREMOD
+struct cdevsw ssc_cdevsw =
+ { sscopen, sscclose, sscread, sscwrite, /*49*/
+ sscioctl, nostop, nullreset, nodevtotty,/* scsi super */
+ sscselect, nxmmap, sscstrategy };
+
+static ssc_devsw_installed = 0;
+
+static void ssc_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! ssc_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&ssc_cdevsw,NULL);
+ dev_chr = dev;
+#if defined(BDEV_MAJOR)
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&ssc_bdevsw,NULL);
+#endif /*BDEV_MAJOR*/
+ ssc_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*/
+ "/", "ssc", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(sscdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ssc_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index c872545..6c7db23 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
- * $Id: st.c,v 1.43 1995/11/19 22:22:32 dyson Exp $
+ * $Id: st.c,v 1.44 1995/11/20 12:42:34 phk Exp $
*/
/*
@@ -46,7 +46,16 @@
#include <scsi/scsiconf.h>
#include <sys/devconf.h>
-u_int32 ststrats, stqueues;
+#ifdef JREMOD
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 14
+#define BDEV_MAJOR 5
+#endif /*JREMOD */
+
/* Defines for device specific stuff */
#define PAGE_0_SENSE_DATA_SIZE 12
@@ -595,7 +604,7 @@ errval
st_close(dev_t dev, int flag, int fmt, struct proc *p,
struct scsi_link *sc_link)
{
- unsigned char unit, mode;
+ u_int32 unit, mode;
struct scsi_data *st;
unit = STUNIT(dev);
@@ -897,12 +906,11 @@ done:
void
st_strategy(struct buf *bp, struct scsi_link *sc_link)
{
- unsigned char unit; /* XXX Everywhere else unit is "u_int32". Please int? */
+ u_int32 unit;
u_int32 opri;
struct scsi_data *st;
int len;
- ststrats++;
unit = STUNIT((bp->b_dev));
st = sc_link->sd;
/*
@@ -1110,7 +1118,6 @@ ststart(unit, flags)
100000,
bp,
flags) == SUCCESSFULLY_QUEUED) {
- stqueues++;
} else {
badnews:
printf("st%ld: oops not queued\n", unit);
@@ -1130,7 +1137,7 @@ st_ioctl(dev_t dev, int cmd, caddr_t arg, int flag,
struct proc *p, struct scsi_link *sc_link)
{
errval errcode = 0;
- unsigned char unit;
+ u_int32 unit;
u_int32 number, flags, dsty;
struct scsi_data *st;
u_int32 hold_blksiz;
@@ -2070,3 +2077,44 @@ bad: free(buf, M_TEMP);
free(buf, M_TEMP);
return 0;
}
+
+#ifdef JREMOD
+struct bdevsw st_bdevsw =
+ { stopen, stclose, ststrategy, stioctl, /*5*/
+ nxdump, zerosize, 0 };
+
+struct cdevsw st_cdevsw =
+ { stopen, stclose, rawread, rawwrite, /*14*/
+ stioctl, nostop, nullreset, nodevtotty,/* st */
+ seltrue, nommap, ststrategy };
+
+static st_devsw_installed = 0;
+
+static void st_drvinit(void *unused)
+{
+ dev_t dev;
+ dev_t dev_chr;
+
+ if( ! st_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&st_cdevsw,NULL);
+ dev_chr = dev;
+ dev = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&dev,&st_bdevsw,NULL);
+ st_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*/
+ "/", "rst", major(dev_chr), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(stdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,st_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/su.c b/sys/scsi/su.c
index 71f21bb..8b9d9c6 100644
--- a/sys/scsi/su.c
+++ b/sys/scsi/su.c
@@ -44,7 +44,7 @@
* SUCH DAMAGE.
*End copyright
*
- * $Id: su.c,v 1.5 1995/05/03 18:09:20 dufault Exp $
+ * $Id: su.c,v 1.6 1995/11/06 00:36:08 bde Exp $
*
* Tabstops 4
*/
@@ -58,6 +58,14 @@
#include <sys/buf.h>
#include <sys/systm.h>
+#ifdef JREMOD
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 18
+#endif /*JREMOD*/
+
/* Build an old style device number (unit encoded in the minor number)
* from a base old one (no flag bits) and a full new one
* (BUS, LUN, TARG in the minor number, and flag bits).
@@ -278,3 +286,36 @@ int suselect(dev_t dev, int which, struct proc *p)
return (*cdev->d_select)(base, which, p);
}
+
+#ifdef JREMOD
+struct cdevsw su_cdevsw =
+ { suopen, suclose, suread, suwrite, /*18*/
+ suioctl, nostop, nullreset, nodevtotty,/* scsi */
+ suselect, nxmmap, sustrategy }; /* 'generic' */
+
+static su_devsw_installed = 0;
+
+static void su_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! su_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&su_cdevsw,NULL);
+ su_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*/
+ "/", "su", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(sudev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,su_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c
index 0518612..ab1e6e1 100644
--- a/sys/scsi/uk.c
+++ b/sys/scsi/uk.c
@@ -2,7 +2,7 @@
* Driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com)
*
- * $Id: uk.c,v 1.8 1995/03/04 20:51:08 dufault Exp $
+ * $Id: uk.c,v 1.9 1995/05/30 08:13:56 rgrimes Exp $
*
* If you find that you are adding any code to this file look closely
* at putting it in "scsi_driver.c" instead.
@@ -11,6 +11,15 @@
#include <sys/param.h>
#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 31
+#endif /*JREMOD*/
+
SCSI_DEVICE_ENTRIES(uk)
@@ -36,3 +45,36 @@ struct scsi_device uk_switch =
0,
0,
};
+
+#ifdef JREMOD
+struct cdevsw uk_cdevsw =
+ { ukopen, ukclose, noread, nowrite, /*31*/
+ ukioctl, nostop, nullreset, nodevtotty,/* unknown */
+ seltrue, nommap, NULL }; /* scsi */
+
+static uk_devsw_installed = 0;
+
+static void uk_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! uk_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&uk_cdevsw,NULL);
+ uk_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*/
+ "/", "uk", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(ukdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,uk_drvinit,NULL)
+
+#endif /* JREMOD */
+
diff --git a/sys/scsi/worm.c b/sys/scsi/worm.c
index ef8c983..c0c0afb 100644
--- a/sys/scsi/worm.c
+++ b/sys/scsi/worm.c
@@ -37,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: worm.c,v 1.9 1995/10/21 23:13:11 phk Exp $
+ * $Id: worm.c,v 1.10 1995/11/19 22:22:35 dyson Exp $
*/
/* XXX This is PRELIMINARY.
@@ -59,6 +59,16 @@
#include <scsi/scsiconf.h>
#include <scsi/scsi_disk.h>
+#ifdef JREMOD
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#ifdef DEVFS
+#include <sys/devfsext.h>
+#endif /*DEVFS*/
+#define CDEV_MAJOR 62
+#endif /*JREMOD*/
+
+
struct scsi_data {
struct buf_queue_head buf_queue;
u_int32 n_blks; /* Number of blocks (0 for bogus) */
@@ -359,3 +369,36 @@ worm_close(dev_t dev, int flag, int fmt, struct proc *p,
return 0;
}
+
+#ifdef JREMOD
+struct cdevsw worm_cdevsw =
+ { wormopen, wormclose, rawread, rawwrite, /*62*/
+ wormioctl, nostop, nullreset, nodevtotty,/* worm */
+ seltrue, nommap, wormstrategy };
+
+static worm_devsw_installed = 0;
+
+static void worm_drvinit(void *unused)
+{
+ dev_t dev;
+
+ if( ! worm_devsw_installed ) {
+ dev = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&dev,&worm_cdevsw,NULL);
+ worm_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*/
+ "/", "rworm", major(dev), 0, DV_CHR, 0, 0, 0600);
+ }
+ }
+#endif
+}
+
+SYSINIT(wormdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,worm_drvinit,NULL)
+
+#endif /* JREMOD */
+
OpenPOWER on IntegriCloud