summaryrefslogtreecommitdiff
path: root/sys/arch/pmax/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/pmax/dev')
-rw-r--r--sys/arch/pmax/dev/dcvar.h11
-rw-r--r--sys/arch/pmax/dev/device.h4
-rw-r--r--sys/arch/pmax/dev/dtop.c26
-rw-r--r--sys/arch/pmax/dev/dtopvar.h46
-rw-r--r--sys/arch/pmax/dev/fb.c11
-rw-r--r--sys/arch/pmax/dev/fb_usrreq.c4
-rw-r--r--sys/arch/pmax/dev/lk201.c4
-rw-r--r--sys/arch/pmax/dev/mfb.c22
-rw-r--r--sys/arch/pmax/dev/mfbvar.h4
-rw-r--r--sys/arch/pmax/dev/pm_ds.c13
-rw-r--r--sys/arch/pmax/dev/qvss_compat.c97
-rw-r--r--sys/arch/pmax/dev/rz.c30
-rw-r--r--sys/arch/pmax/dev/sfb.c4
-rw-r--r--sys/arch/pmax/dev/sfbvar.h4
-rw-r--r--sys/arch/pmax/dev/sii.c7
-rw-r--r--sys/arch/pmax/dev/tz.c14
16 files changed, 188 insertions, 113 deletions
diff --git a/sys/arch/pmax/dev/dcvar.h b/sys/arch/pmax/dev/dcvar.h
index d9aad4033a3..954b4c9ef7e 100644
--- a/sys/arch/pmax/dev/dcvar.h
+++ b/sys/arch/pmax/dev/dcvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dcvar.h,v 1.3 1996/09/25 20:48:57 jonathan Exp $ */
+/* $NetBSD: dcvar.h,v 1.4 1997/05/28 14:21:39 jonathan Exp $ */
/*
* External declarations from DECstation dc serial driver.
@@ -37,7 +37,14 @@ int dcintr __P((void * xxxunit));
extern int dcGetc __P ((dev_t dev));
extern int dcparam __P((register struct tty *tp, register struct termios *t));
extern void dcPutc __P((dev_t dev, int c));
-void dc_consinit __P((dev_t dev, dcregs *dcaddr));
+
+struct dc7085regs;
+void dc_consinit __P((dev_t dev, volatile struct dc7085regs *dcaddr));
+
+/* QVSS-compatible in-kernel X input event parser, pointer tracker */
+void (*dcDivertXInput) __P((int cc)); /* X windows keyboard input routine */
+void (*dcMouseEvent) __P((int)); /* X windows mouse motion event routine */
+void (*dcMouseButtons) __P((int)); /* X windows mouse buttons event routine */
#endif /* _DCVAR_H */
#endif /* _KERNEL */
diff --git a/sys/arch/pmax/dev/device.h b/sys/arch/pmax/dev/device.h
index 0d122f5ff7b..819ddd1e4df 100644
--- a/sys/arch/pmax/dev/device.h
+++ b/sys/arch/pmax/dev/device.h
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.11 1996/10/01 01:04:50 jonathan Exp $ */
+/* $NetBSD: device.h,v 1.12 1997/01/31 02:00:56 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,6 +45,7 @@
* different types of controllers.
*/
struct ScsiCmd;
+struct device;
struct pmax_driver {
char *d_name; /* device driver name (e.g., "rz") */
@@ -88,6 +89,7 @@ struct pmax_scsi_device {
int sd_flags; /* flags */
int sd_alive; /* true if init routine succeeded */
+ struct device *sd_devp; /* new config glue kludge */
};
/* Define special unit types used by the config program */
diff --git a/sys/arch/pmax/dev/dtop.c b/sys/arch/pmax/dev/dtop.c
index df0e35c2021..784f03ddea2 100644
--- a/sys/arch/pmax/dev/dtop.c
+++ b/sys/arch/pmax/dev/dtop.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dtop.c,v 1.20 1996/10/13 13:13:55 jonathan Exp $ */
+/* $NetBSD: dtop.c,v 1.23 1997/05/25 04:58:36 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -93,8 +93,6 @@ SOFTWARE.
********************************************************/
-#include "dtop.h"
-#if NDTOP > 0
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
@@ -115,8 +113,11 @@ SOFTWARE.
#include <dev/cons.h>
#include <pmax/cpuregs.h> /* mips cached->uncached */
+#include <machine/dc7085cons.h> /* mdmctl bits same on dtop and dc? */
#include <machine/pmioctl.h>
-#include <machine/dc7085cons.h>
+#include <machine/fbio.h>
+#include <machine/fbvar.h>
+#include <pmax/dev/fbreg.h>
#include <pmax/pmax/asic.h>
#include <pmax/pmax/maxine.h>
@@ -128,12 +129,6 @@ SOFTWARE.
#include <pmax/dev/lk201var.h>
#include <pmax/dev/dtopvar.h>
-#include <machine/fbio.h>
-#include <machine/fbvar.h>
-#include <pmax/dev/fbreg.h>
-
-extern int pmax_boardtype;
-
#define DTOP_MAX_POLL 0x7fff /* about half a sec */
@@ -160,7 +155,8 @@ struct dtop_softc {
short bad_pkts;
struct dtop_ds {
- int (*handler)();
+ int (*handler)
+ __P((dtop_device_t, dtop_message_t, int, int));
dtop_device status;
} device[(DTOP_ADDR_DEFAULT - DTOP_ADDR_FIRST) >> 1];
@@ -184,13 +180,6 @@ int dtop_keyboard_handler __P((dtop_device_t, dtop_message_t, int, int));
int dtopparam __P((struct tty *, struct termios *));
void dtopstart __P((struct tty *));
-void dtopKBDPutc __P((dev_t, int));
-int dtopKBDGetc __P((dev_t));
-
-
-void (*dtopDivertXInput)(); /* X windows keyboard input routine */
-void (*dtopMouseEvent)(); /* X windows mouse motion event routine */
-void (*dtopMouseButtons)(); /* X windows mouse buttons event routine */
/*
@@ -940,4 +929,3 @@ dtop_keyboard_repeat(arg)
dev->keyboard.k_ar_state = K_AR_IDLE;
splx(s);
}
-#endif
diff --git a/sys/arch/pmax/dev/dtopvar.h b/sys/arch/pmax/dev/dtopvar.h
index 0f47e91c284..587e35a18c8 100644
--- a/sys/arch/pmax/dev/dtopvar.h
+++ b/sys/arch/pmax/dev/dtopvar.h
@@ -1,7 +1,53 @@
+/* $NetBSD: dtopvar.h,v 1.2 1997/05/25 04:50:00 jonathan Exp $ */
+
+/*
+ * Copyright (c) 1997 Jonathan Stone. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Jonathan Stone for
+ * the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
int dtopKBDGetc __P((dev_t dev));
void dtopKBDPutc __P((dev_t dev, int c));
/*
+ * Support for UGLY 4.4bsd/pmax-derived console/X11 input redirection
+ * to in-kernel input-event queue.
+ */
+
+/* X11 keyboard input upcall */
+void (*dtopDivertXInput) __P((int));
+
+/* X11 mouse motion event upcall */
+void (*dtopMouseEvent) __P((MouseReport *mrp));
+
+/* X11 mouse buttons event upcall */
+void (*dtopMouseButtons) __P((MouseReport *mrp));
+
+/*
* Device numbers.
*/
#define DTOPKBD_PORT 0
diff --git a/sys/arch/pmax/dev/fb.c b/sys/arch/pmax/dev/fb.c
index 78819923641..0f0bfcc15cb 100644
--- a/sys/arch/pmax/dev/fb.c
+++ b/sys/arch/pmax/dev/fb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fb.c,v 1.18 1996/10/14 04:55:26 jonathan Exp $ */
+/* $NetBSD: fb.c,v 1.19 1997/05/24 08:19:50 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -100,7 +100,8 @@
#include "rasterconsole.h"
-#include "dc.h"
+#include "dc_ioasic.h"
+#include "dc_ds.h"
#include "scc.h"
#include "dtop.h"
@@ -122,7 +123,7 @@ extern int pmax_boardtype;
extern void fbScreenInit __P (( struct fbinfo *fi));
-#if NDC > 0
+#if (NDC_DS > 0) || (NDC_IOASIC > 0)
#include <machine/dc7085cons.h>
#include <pmax/dev/dcvar.h>
#endif
@@ -271,13 +272,13 @@ tb_kbdmouseconfig(fi)
switch (pmax_boardtype) {
-#if NDC > 0
+#if (NDC_DS > 0) || (NDC_IOASIC > 0)
case DS_PMAX:
case DS_3MAX:
fi->fi_glasstty->KBDPutc = dcPutc;
fi->fi_glasstty->kbddev = makedev(DCDEV, DCKBD_PORT);
break;
-#endif /* NDC */
+#endif /* NDC_DS || NDC_IOASIC */
#if NSCC > 0
case DS_3MIN:
diff --git a/sys/arch/pmax/dev/fb_usrreq.c b/sys/arch/pmax/dev/fb_usrreq.c
index 9b01185eb50..b183c32c742 100644
--- a/sys/arch/pmax/dev/fb_usrreq.c
+++ b/sys/arch/pmax/dev/fb_usrreq.c
@@ -183,11 +183,11 @@ fbioctl(dev, cmd, data, flag, p)
break;
case FBIOGVIDEO:
- *(int *)data = fi->fi_blanked;
+ *(int *)data = (fi->fi_blanked) ? FBVIDEO_OFF: FBVIDEO_ON;
break;
case FBIOSVIDEO:
- if (*(int *)data)
+ if (*(int *)data == FBVIDEO_OFF)
return (*(fi->fi_driver->fbd_blank)) (fi);
else
return (*(fi->fi_driver->fbd_unblank)) (fi);
diff --git a/sys/arch/pmax/dev/lk201.c b/sys/arch/pmax/dev/lk201.c
index 6a792aecf58..08b62a312e2 100644
--- a/sys/arch/pmax/dev/lk201.c
+++ b/sys/arch/pmax/dev/lk201.c
@@ -1,3 +1,5 @@
+/* $NetBSD: lk201.c,v 1.6 1997/05/25 05:26:00 jonathan Exp $ */
+
/*
* The LK201 keycode mapping routine is here, along with initialization
* functions for the keyboard and mouse.
@@ -321,8 +323,6 @@ LKgetc(dev)
{
register int c;
- extern sccGetc();
-
#if 0
/*XXX*/ printf("LK-201 getc 0x%x( [%d %d]) in_dev [%d %d]\n",
raw_kbd_getc,
diff --git a/sys/arch/pmax/dev/mfb.c b/sys/arch/pmax/dev/mfb.c
index 1fb35093fbe..baa74cdb61a 100644
--- a/sys/arch/pmax/dev/mfb.c
+++ b/sys/arch/pmax/dev/mfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mfb.c,v 1.20 1996/10/13 13:13:59 jonathan Exp $ */
+/* $NetBSD: mfb.c,v 1.23 1997/04/19 08:25:31 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -202,7 +202,7 @@ void mfbattach __P((struct device *, struct device *, void *));
int mfb_intr __P((void *sc));
struct cfattach mfb_ca = {
- sizeof(struct device), mfbmatch, mfbattach
+ sizeof(struct fbinfo), mfbmatch, mfbattach
};
struct cfdriver mfb_cd = {
@@ -308,13 +308,13 @@ mfbinit(fi, mfbaddr, unit, silent)
fi->fi_base = (caddr_t)(mfbaddr + MFB_OFFSET_BT431);
fi->fi_vdac = (caddr_t)(mfbaddr + MFB_OFFSET_BT455);
fi->fi_size = (fi->fi_pixels + MFB_FB_SIZE) - fi->fi_base;
- fi->fi_linebytes = 1280;
+ fi->fi_linebytes = 2048; /* inter-line stride (blitting) */
fi->fi_driver = &mfb_driver;
fi->fi_blanked = 0;
/* Fill in Frame Buffer Type struct. */
fi->fi_type.fb_boardtype = PMAX_FBTYPE_MFB;
- fi->fi_type.fb_width = 1280;
+ fi->fi_type.fb_width = 1280; /* visible screen pixels */
fi->fi_type.fb_height = 1024;
fi->fi_type.fb_depth = 8;
fi->fi_type.fb_cmsize = 0;
@@ -479,6 +479,7 @@ mfbPosCursor(fi, x, y)
{
bt431_regmap_t *regs = (bt431_regmap_t *)(fi -> fi_base);
+#ifdef MELLON
if (y < 0)
y = 0;
else if (y > fi -> fi_type.fb_width - fi -> fi_cursor.width - 1)
@@ -488,6 +489,15 @@ mfbPosCursor(fi, x, y)
else if (x > fi -> fi_type.fb_height - fi -> fi_cursor.height - 1)
x = fi -> fi_type.fb_height - fi -> fi_cursor.height - 1;
+#else /* old-style pmax glass tty */
+ if (y < fi->fi_fbu->scrInfo.min_cur_y ||
+ y > fi->fi_fbu->scrInfo.max_cur_y)
+ y = fi->fi_fbu->scrInfo.max_cur_y;
+ if (x < fi->fi_fbu->scrInfo.min_cur_x ||
+ x > fi->fi_fbu->scrInfo.max_cur_x)
+ x = fi->fi_fbu->scrInfo.max_cur_x;
+#endif /* old-style pmax glass tty */
+
fi -> fi_cursor.x = x;
fi -> fi_cursor.y = y;
@@ -521,6 +531,8 @@ mfbInitColorMapBlack(fi, blackpix)
u_char rgb [3];
register int i;
+ blackpix = 1; /* XXX XXX XXX defeat screensave bug */
+
if (blackpix)
rgb [0] = rgb [1] = rgb [2] = 0xff;
else
@@ -688,7 +700,7 @@ bt455_video_off(fi)
mfbRestoreCursorColor (fi);
bcopy (cursor_save, cursor_RGB, 6);
- fi -> fi_blanked = 0;
+ fi -> fi_blanked = 1;
return 0;
}
diff --git a/sys/arch/pmax/dev/mfbvar.h b/sys/arch/pmax/dev/mfbvar.h
index 9ba98ecbe5a..112d2701f2e 100644
--- a/sys/arch/pmax/dev/mfbvar.h
+++ b/sys/arch/pmax/dev/mfbvar.h
@@ -1,8 +1,8 @@
-/* $NetBSD: mfbvar.h,v 1.1 1996/09/21 03:06:37 jonathan Exp $ */
+/* $NetBSD: mfbvar.h,v 1.2 1997/05/24 09:15:49 jonathan Exp $ */
/*
* Initialize a Turbochannel MFB 1280x1024x1 2-d framebuffer,
* so it can be used as a bitmapped glass-tty console device.
*/
extern int
-mcfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
+mfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
diff --git a/sys/arch/pmax/dev/pm_ds.c b/sys/arch/pmax/dev/pm_ds.c
index a1619140ba2..8435563d59d 100644
--- a/sys/arch/pmax/dev/pm_ds.c
+++ b/sys/arch/pmax/dev/pm_ds.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_ds.c,v 1.3 1996/10/23 02:34:23 mhitch Exp $ */
+/* $NetBSD: pm_ds.c,v 1.4 1997/05/24 08:19:52 jonathan Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -36,10 +36,10 @@
#include "fb.h"
#include "pm.h"
-#include "dc.h"
+#include "dc_ds.h"
#if 0
-#if NDC == 0
+#if NDC_DS == 0
pm needs dc device
#endif
#endif
@@ -71,6 +71,11 @@ struct fbinfo pmfi; /*XXX*/
extern struct pmax_fbtty pmfb;
/*
+ * rcons methods and globals.
+ */
+extern struct pmax_fbtty pmfb;
+
+/*
* XXX
* pmax raster-console infrastructure needs to reset the mouse, so
* we need a driver callback.
@@ -187,6 +192,8 @@ pminit(fi, unit, cold_console_flag)
fi->fi_glasstty = &pmfb;
+ fi->fi_glasstty = &pmfb;
+
/*
* set putc/getc entry point
*/
diff --git a/sys/arch/pmax/dev/qvss_compat.c b/sys/arch/pmax/dev/qvss_compat.c
index 85f0b394ee0..7213063a143 100644
--- a/sys/arch/pmax/dev/qvss_compat.c
+++ b/sys/arch/pmax/dev/qvss_compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: qvss_compat.c,v 1.6 1996/10/13 03:39:36 christos Exp $ */
+/* $NetBSD: qvss_compat.c,v 1.8 1997/05/25 10:53:33 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -89,7 +89,8 @@
#include <pmax/pmax/cons.h>
#include <pmax/pmax/pmaxtype.h>
-#include "dc.h"
+#include "dc_ds.h"
+#include "dc_ioasic.h"
#include "scc.h"
#include "dtop.h"
@@ -99,8 +100,17 @@
*/
#include <pmax/dev/qvssvar.h> /* our own externs */
+
+struct termios; struct dcregs;
+#include <pmax/dev/dtopvar.h> /* dtop console I/O decls */
+#include <pmax/tc/sccvar.h> /* ioasic z8530 I/O decls */
+#include <pmax/dev/dcvar.h> /* DZ-11 chip console I/O */
+
extern int pmax_boardtype;
+/*
+ * Prototypes of local functions
+ */
extern void pmEventQueueInit __P((pmEventQueue *qe));
void genKbdEvent __P((int ch));
void genMouseEvent __P((MouseReport *newRepPtr));
@@ -110,41 +120,12 @@ void genDeconfigMouse __P((void));
void mouseInput __P((int cc));
-
-#if NDC > 0
-extern void (*dcDivertXInput)();
-extern void (*dcMouseEvent)();
-extern void (*dcMouseButtons)();
-#endif
-#if NSCC > 0
-extern void (*sccDivertXInput)();
-extern void (*sccMouseEvent)();
-extern void (*sccMouseButtons)();
-#endif
-#if NDTOP > 0
-extern void (*dtopDivertXInput)();
-extern void (*dtopMouseEvent)();
-extern void (*dtopMouseButtons)();
-#endif
-
-
-#if 0 /*XXX*/
-#if NDC > 0
-#include <machine/dc7085cons.h>
-extern int dcGetc(), dcparam();
-extern void dcPutc();
-#endif
-#if NDTOP > 0
-#include <pmax/dev/dtopreg.h>
-extern void dtopKBDPutc();
-#endif
#if NSCC > 0
-#include <pmax/dev/sccreg.h>
-extern int sccGetc(), sccparam();
-extern void sccPutc();
+extern void (*sccDivertXInput) __P((int cc));
+extern void (*sccMouseEvent) __P((int));
+extern void (*sccMouseButtons) __P((int));
#endif
-#endif /* 0 */
extern struct fbinfo *firstfi;
@@ -566,14 +547,22 @@ genConfigMouse()
s = spltty();
switch (pmax_boardtype) {
-#if NDC > 0
+#if NDC_IOASIC > 0
case DS_3MAX:
+ dcDivertXInput = genKbdEvent;
+ dcMouseEvent = (void (*) __P((int)))genMouseEvent;
+ dcMouseButtons = (void (*) __P((int)))genMouseButtons;
+ break;
+#endif /* NDC_IOASIC */
+
+#if NDC_DS > 0
case DS_PMAX:
dcDivertXInput = genKbdEvent;
- dcMouseEvent = genMouseEvent;
- dcMouseButtons = genMouseButtons;
+ dcMouseEvent = (void (*) __P((int)))genMouseEvent;
+ dcMouseButtons = (void (*) __P((int)))genMouseButtons;
break;
-#endif
+#endif /* NDC_DS */
+
#if NSCC > 1
case DS_3MIN:
case DS_3MAXPLUS:
@@ -605,27 +594,37 @@ genDeconfigMouse()
s = spltty();
switch (pmax_boardtype) {
-#if NDC > 0
+#if NDC_IOASIC > 0
case DS_3MAX:
+
+ dcDivertXInput = (void (*) __P((int)) )0;
+ dcMouseEvent = (void (*) __P((int)) )0;
+ dcMouseButtons = (void (*) __P((int)) )0;
+ break;
+#endif /* NDC_IOASIC */
+
+#if NDC_DS > 0
case DS_PMAX:
- dcDivertXInput = (void (*)())0;
- dcMouseEvent = (void (*)())0;
- dcMouseButtons = (void (*)())0;
+ dcDivertXInput = (void (*) __P((int)) )0;
+ dcMouseEvent = (void (*) __P((int)) )0;
+ dcMouseButtons = (void (*) __P((int)) )0;
break;
-#endif
+#endif /* NDC_DS */
+
#if NSCC > 1
case DS_3MIN:
case DS_3MAXPLUS:
- sccDivertXInput = (void (*)())0;
- sccMouseEvent = (void (*)())0;
- sccMouseButtons = (void (*)())0;
+ sccDivertXInput = (void (*) __P((int)) )0;
+ sccMouseEvent = (void (*) __P((MouseReport *)) )0;
+ sccMouseButtons = (void (*) __P((MouseReport *)) )0;
break;
#endif
+
#if NDTOP > 0
case DS_MAXINE:
- dtopDivertXInput = (void (*)())0;
- dtopMouseEvent = (void (*)())0;
- dtopMouseButtons = (void (*)())0;
+ dtopDivertXInput = (void (*) __P((int)) )0;
+ dtopMouseEvent = (void (*) __P((MouseReport *)) )0;
+ dtopMouseButtons = (void (*) __P((MouseReport *)) )0;
break;
#endif
default:
diff --git a/sys/arch/pmax/dev/rz.c b/sys/arch/pmax/dev/rz.c
index d0ec6e419cc..c6b4cac3075 100644
--- a/sys/arch/pmax/dev/rz.c
+++ b/sys/arch/pmax/dev/rz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rz.c,v 1.20 1996/10/13 03:39:38 christos Exp $ */
+/* $NetBSD: rz.c,v 1.23 1997/02/04 05:24:55 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -59,6 +59,7 @@
#include <sys/uio.h>
#include <sys/stat.h>
#include <sys/syslog.h>
+#include <sys/device.h>
#include <ufs/ffs/fs.h>
@@ -98,16 +99,6 @@ struct size {
* (including the boot area).
*/
static struct size rzdefaultpart[MAXPARTITIONS] = {
-#ifdef GENERIC /* greedy machines have 64 meg of swap */
- { 0, 32768 }, /* A */
- { 32768, 131072 }, /* B */
- { 0, 0 }, /* C */
- { 17408, 0 }, /* D */
- { 115712, 0 }, /* E */
- { 218112, 0 }, /* F */
- { 163840, 0 }, /* G */
- { 115712, 0 } /* H */
-#else
{ 0, 16384 }, /* A */
{ 16384, 65536 }, /* B */
{ 0, 0 }, /* C */
@@ -116,7 +107,6 @@ static struct size rzdefaultpart[MAXPARTITIONS] = {
{ 218112, 0 }, /* F */
{ 81920, 0 }, /* G */
{ 115712, 0 } /* H */
-#endif
};
extern char *
@@ -127,7 +117,7 @@ readdisklabel __P((dev_t dev, void (*strat) __P((struct buf *bp)),
* Ultrix disklabel declarations
*/
#ifdef COMPAT_ULTRIX
-#include "../../stand/dec_boot.h"
+#include <pmax/stand/dec_boot.h>
extern char *
compat_label __P((dev_t dev, void (*strat) __P((struct buf *bp)),
@@ -144,6 +134,7 @@ struct rzstats {
};
struct rz_softc {
+ struct device sc_dev; /* new config glue */
struct pmax_scsi_device *sc_sd; /* physical unit info */
pid_t sc_format_pid; /* process using "format" mode */
short sc_flags; /* see below */
@@ -156,7 +147,6 @@ struct rz_softc {
#define sc_bopenpart sc_dkdev.dk_bopenmask /* XXX compat */
#define sc_copenpart sc_dkdev.dk_copenmask /* XXX compat */
#define sc_bshift sc_dkdev.dk_blkshift /* XXX compat */
- char sc_xname[8]; /* XXX external name */
struct rzstats sc_stats; /* statisic counts */
struct buf sc_tab; /* queue of pending operations */
struct buf sc_buf; /* buf for doing I/O */
@@ -356,12 +346,14 @@ rzprobe(xxxsd)
sc->sc_rwcmd.unitNumber = sd->sd_slave;
/* XXX set up the external name */
- bzero(sc->sc_xname, sizeof(sc->sc_xname)); /* XXX */
- sprintf(sc->sc_xname, "rz%d", sd->sd_unit); /* XXX */
+ bzero(&sc->sc_dev, sizeof(sc->sc_dev)); /* XXX */
+ sprintf(sc->sc_dev.dv_xname, "rz%d", sd->sd_unit); /* XXX */
+ sc->sc_dev.dv_unit = sd->sd_unit; /* XXX */
+ sc->sc_dev.dv_class = DV_DISK; /* XXX */
/* Initialize the disk structure. */
bzero(&sc->sc_dkdev, sizeof(sc->sc_dkdev));
- sc->sc_dkdev.dk_name = sc->sc_xname;
+ sc->sc_dkdev.dk_name = sc->sc_dev.dv_xname;
/* try to find out what type of device this is */
sc->sc_format_pid = 1; /* force use of sc_cdb */
@@ -445,6 +437,10 @@ rzprobe(xxxsd)
if (inqbuf.rmb)
sc->sc_flags |= RZF_REMOVEABLE;
sc->sc_buf.b_flags = 0;
+
+ sd->sd_devp = &sc->sc_dev; /* XXX */
+ TAILQ_INSERT_TAIL(&alldevs, &sc->sc_dev, dv_list); /* XXX */
+
return (1);
bad:
diff --git a/sys/arch/pmax/dev/sfb.c b/sys/arch/pmax/dev/sfb.c
index 838c0d0e79a..e0894ed6244 100644
--- a/sys/arch/pmax/dev/sfb.c
+++ b/sys/arch/pmax/dev/sfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sfb.c,v 1.18 1996/10/13 13:14:01 jonathan Exp $ */
+/* $NetBSD: sfb.c,v 1.19 1997/01/22 17:27:54 mhitch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -131,7 +131,7 @@ void sfbattach __P((struct device *, struct device *, void *));
int sfb_intr __P((void *sc));
struct cfattach sfb_ca = {
- sizeof(struct device), sfbmatch, sfbattach
+ sizeof(struct fbinfo), sfbmatch, sfbattach
};
struct cfdriver sfb_cd = {
diff --git a/sys/arch/pmax/dev/sfbvar.h b/sys/arch/pmax/dev/sfbvar.h
index b72a71f62bc..f30bbd45562 100644
--- a/sys/arch/pmax/dev/sfbvar.h
+++ b/sys/arch/pmax/dev/sfbvar.h
@@ -1,8 +1,8 @@
-/* $NetBSD: sfbvar.h,v 1.1 1996/09/21 03:06:36 jonathan Exp $ */
+/* $NetBSD: sfbvar.h,v 1.2 1997/05/24 09:15:46 jonathan Exp $ */
/*
* Initialize a Turbochannel SFB 2-d framebuffer,
* so it can be used as a bitmapped glass-tty console device.
*/
extern int
-scfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
+sfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
diff --git a/sys/arch/pmax/dev/sii.c b/sys/arch/pmax/dev/sii.c
index 7052341147a..b010abfccd4 100644
--- a/sys/arch/pmax/dev/sii.c
+++ b/sys/arch/pmax/dev/sii.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sii.c,v 1.20 1996/10/22 23:15:10 mhitch Exp $ */
+/* $NetBSD: sii.c,v 1.23 1997/05/29 19:26:06 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -688,6 +688,8 @@ again:
* and to just clear the bit if it's set.
*/
if (cstat & SII_BER) {
+ regs->cstat = SII_BER;
+ wbflush();
}
#endif
@@ -718,6 +720,7 @@ again:
cstat); /* XXX */
if (cstat & SII_DST) {
sc->sc_target = regs->destat;
+ state = &sc->sc_st[sc->sc_target];
state->prevComm = 0;
} else
panic("sc_target 1");
@@ -825,6 +828,7 @@ again:
cstat, dstat); /* XXX */
if (cstat & SII_DST) {
sc->sc_target = regs->destat;
+ state = &sc->sc_st[sc->sc_target];
state->prevComm = 0;
} else {
#ifdef DEBUG
@@ -1606,6 +1610,7 @@ sii_GetByte(regs, phase, ack)
dstat = regs->dstat;
state = regs->cstat & SII_STATE_MSK;
+ i = -1;
if (!(dstat & SII_IBF) || (dstat & SII_MIS)) {
regs->comm = state | phase;
wbflush();
diff --git a/sys/arch/pmax/dev/tz.c b/sys/arch/pmax/dev/tz.c
index 13bcc3fc275..028b028b646 100644
--- a/sys/arch/pmax/dev/tz.c
+++ b/sys/arch/pmax/dev/tz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tz.c,v 1.14 1996/10/13 12:34:20 jonathan Exp $ */
+/* $NetBSD: tz.c,v 1.15 1997/01/31 02:00:59 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -57,6 +57,7 @@
#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/tprintf.h>
+#include <sys/device.h>
#include <sys/conf.h>
#include <machine/conf.h>
@@ -77,6 +78,7 @@ struct pmax_driver tzdriver = {
};
struct tz_softc {
+ struct device sc_dev; /* new config glue */
struct pmax_scsi_device *sc_sd; /* physical unit info */
int sc_flags; /* see below */
int sc_tapeid; /* tape drive id */
@@ -140,6 +142,12 @@ tzprobe(xxxsd)
sc->sc_cmd.flags = 0;
sc->sc_rwcmd.unitNumber = sd->sd_slave;
+ /* XXX set up device info */ /* XXX */
+ bzero(&sc->sc_dev, sizeof(sc->sc_dev)); /* XXX */
+ sprintf(sc->sc_dev.dv_xname, "tz%d", sd->sd_unit); /* XXX */
+ sc->sc_dev.dv_unit = sd->sd_unit; /* XXX */
+ sc->sc_dev.dv_class = DV_TAPE; /* XXX */
+
/* try to find out what type of device this is */
sc->sc_flags = TZF_ALTCMD; /* force use of sc_cdb */
sc->sc_cdb.len = sizeof(ScsiGroup0Cmd);
@@ -232,6 +240,10 @@ tzprobe(xxxsd)
sc->sc_tapeid = 0;
}
}
+
+ sd->sd_devp = &sc->sc_dev; /* XXX */
+ TAILQ_INSERT_TAIL(&alldevs, &sc->sc_dev, dv_list); /* XXX */
+
return (1);
bad: