-#define RKDEBUG
-#define RKBDEBUG
-/* rk.c 4.43 82/08/13 */
+/* rk.c 4.51 82/12/17 */
#include "rk.h"
#if NHK > 0
* TODO:
* Learn why we lose an interrupt sometime when spinning drives down
*/
+#include "../machine/pte.h"
+
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
#include "../h/user.h"
-#include "../h/pte.h"
#include "../h/map.h"
#include "../h/vm.h"
-#include "../h/ubareg.h"
-#include "../h/ubavar.h"
#include "../h/dk.h"
-#include "../h/cpu.h"
#include "../h/cmap.h"
#include "../h/dkbad.h"
#include "../h/uio.h"
-#include "../h/rkreg.h"
+#include "../vax/cpu.h"
+#include "../vaxuba/ubareg.h"
+#include "../vaxuba/ubavar.h"
+#include "../vaxuba/rkreg.h"
struct rk_softc {
int sc_softas;
ui->ui_flags = 0;
}
+rkopen(dev)
+ dev_t dev;
+{
+ register int unit = minor(dev) >> 3;
+ register struct uba_device *ui;
+
+ if (unit >= NRK || (ui = rkdinfo[unit]) == 0 || ui->ui_alive == 0)
+ return (ENXIO);
+ return (0);
+}
+
rkstrategy(bp)
register struct buf *bp;
{
int unit;
struct rk_softc *sc = &rk_softc[um->um_ctlr];
int as = (rkaddr->rkatt >> 8) | sc->sc_softas;
- int needie = 1;
sc->sc_wticks = 0;
sc->sc_softas = 0;
}
if (um->um_tab.b_actf && um->um_tab.b_active == 0)
rkstart(um);
- if (((needie = rkaddr->rkcs1) & RK_IE) == 0)
+ if (((rkaddr->rkcs1) & RK_IE) == 0)
rkaddr->rkcs1 = RK_IE;
}
register int unit = minor(dev) >> 3;
if (unit >= NRK)
- u.u_error = ENXIO;
- else
- physio(rkstrategy, &rrkbuf[unit], dev, B_READ, minphys, uio);
+ return (ENXIO);
+ return (physio(rkstrategy, &rrkbuf[unit], dev, B_READ, minphys, uio));
}
-rkwrite(dev)
+rkwrite(dev, uio)
dev_t dev;
+ struct uio *uio;
{
register int unit = minor(dev) >> 3;
if (unit >= NRK)
- u.u_error = ENXIO;
- else
- physio(rkstrategy, &rrkbuf[unit], dev, B_WRITE, minphys, 0);
+ return (ENXIO);
+ return (physio(rkstrategy, &rrkbuf[unit], dev, B_WRITE, minphys, uio));
}
rkecc(ui, flag)
rk_softc[um->um_ctlr].sc_wticks = 0;
if (um->um_ubinfo) {
printf("<%d>", (um->um_ubinfo>>28)&0xf);
- ubadone(um);
+ um->um_ubinfo = 0;
}
for (unit = 0; unit < NRK; unit++) {
if ((ui = rkdinfo[unit]) == 0)