summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/wd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa/wd.c')
-rw-r--r--sys/i386/isa/wd.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 49ab5ce..1b00118 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.91 1995/11/20 12:41:53 phk Exp $
+ * $Id: wd.c,v 1.92 1995/11/23 07:24:41 dyson Exp $
*/
/* TODO:
@@ -105,6 +105,12 @@ extern void wdstart(int ctrlr);
#define WDOPT_SLEEPHACK 0x4000
#define WDOPT_MULTIMASK 0x00ff
+#ifdef JREMOD
+#define CDEV_MAJOR 3
+#define BDEV_MAJOR 0
+static void wd_devsw_install();
+#endif /*JREMOD */
+
static int wd_goaway(struct kern_devconf *, int);
static int wdc_goaway(struct kern_devconf *, int);
static int wd_externalize(struct kern_devconf *, struct sysctl_req *);
@@ -314,6 +320,10 @@ wdprobe(struct isa_device *dvp)
du->dk_port = dvp->id_iobase;
wdc_registerdev(dvp);
+#ifdef JREMOD
+ wd_devsw_install();
+#endif /*JREMOD*/
+
/* check if we have registers that work */
outb(du->dk_port + wd_sdh, WDSD_IBM); /* set unit 0 */
@@ -2116,4 +2126,30 @@ wdwait(struct disk *du, u_char bits_wanted, int timeout)
return (-1);
}
+#ifdef JREMOD
+struct bdevsw wd_bdevsw =
+ { wdopen, wdclose, wdstrategy, wdioctl, /*0*/
+ wddump, wdsize, 0 };
+
+struct cdevsw wd_cdevsw =
+ { wdopen, wdclose, rawread, rawwrite, /*3*/
+ wdioctl, nostop, nullreset, nodevtotty,/* wd */
+ seltrue, nommap, wdstrategy };
+
+static wd_devsw_installed = 0;
+
+static void wd_devsw_install()
+{
+ dev_t descript;
+ if( ! wd_devsw_installed ) {
+ descript = makedev(CDEV_MAJOR,0);
+ cdevsw_add(&descript,&wd_cdevsw,NULL);
+#if defined(BDEV_MAJOR)
+ descript = makedev(BDEV_MAJOR,0);
+ bdevsw_add(&descript,&wd_bdevsw,NULL);
+#endif /*BDEV_MAJOR*/
+ wd_devsw_installed = 1;
+ }
+}
+#endif /* JREMOD */
#endif /* NWDC > 0 */
OpenPOWER on IntegriCloud