projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
support for display drivers as console
[unix-history]
/
usr
/
src
/
sys
/
vax
/
stand
/
ht.c
diff --git
a/usr/src/sys/vax/stand/ht.c
b/usr/src/sys/vax/stand/ht.c
index
e28e3bd
..
ab5e529
100644
(file)
--- a/
usr/src/sys/vax/stand/ht.c
+++ b/
usr/src/sys/vax/stand/ht.c
@@
-1,9
+1,9
@@
/*
/*
- * Copyright (c) 1982 Regents of the University of California.
+ * Copyright (c) 1982
, 1986
Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)ht.c
6.2
(Berkeley) %G%
+ * @(#)ht.c
7.3
(Berkeley) %G%
*/
/*
*/
/*
@@
-11,9
+11,9
@@
*/
#include "../machine/pte.h"
*/
#include "../machine/pte.h"
-#include "
../h/
param.h"
-#include "
../h/
inode.h"
-#include "
../h/
fs.h"
+#include "param.h"
+#include "inode.h"
+#include "fs.h"
#include "../vaxmba/htreg.h"
#include "../vaxmba/mbareg.h"
#include "../vaxmba/htreg.h"
#include "../vaxmba/mbareg.h"
@@
-29,33
+29,34
@@
short httypes[] =
htopen(io)
register struct iob *io;
{
htopen(io)
register struct iob *io;
{
- register int skip;
- register struct htdevice *htaddr =
- (struct htdevice *)mbadrv(io->i_unit);
- int i;
+ register struct htdevice *htaddr;
+ register int i, skip;
- for (i = 0; httypes[i]; i++)
+ htaddr = (struct htdevice *)mbadrv(io->i_adapt, io->i_ctlr);
+ if (mbainit(io->i_adapt) == 0)
+ return (EADAPT);
+ for (i = 0;; i++) {
+ if (!httypes[i]) {
+ printf("ht: not a tape\n");
+ return (ENXIO);
+ }
if (httypes[i] == (htaddr->htdt&MBDT_TYPE))
if (httypes[i] == (htaddr->htdt&MBDT_TYPE))
- goto found;
- _stop("not a tape\n");
-found:
- mbainit(UNITTOMBA(io->i_unit));
+ break;
+ }
htaddr->htcs1 = HT_DCLR|HT_GO;
htstrategy(io, HT_REW);
htaddr->htcs1 = HT_DCLR|HT_GO;
htstrategy(io, HT_REW);
- skip = io->i_boff;
- while (skip--) {
+ for (skip = io->i_part; skip--;) {
io->i_cc = -1;
io->i_cc = -1;
- while (htstrategy(io, HT_SFORW))
- ;
+ while (htstrategy(io, HT_SFORW));
DELAY(65536);
htstrategy(io, HT_SENSE);
}
DELAY(65536);
htstrategy(io, HT_SENSE);
}
+ return (0);
}
htclose(io)
register struct iob *io;
{
}
htclose(io)
register struct iob *io;
{
-
htstrategy(io, HT_REW);
}
htstrategy(io, HT_REW);
}
@@
-63,15
+64,15
@@
htstrategy(io, func)
register struct iob *io;
int func;
{
register struct iob *io;
int func;
{
+ register struct htdevice *htaddr;
register int den, errcnt, ds;
int er;
short fc;
register int den, errcnt, ds;
int er;
short fc;
- register struct htdevice *htaddr =
- (struct htdevice *)mbadrv(io->i_unit);
errcnt = 0;
errcnt = 0;
+ htaddr = (struct htdevice *)mbadrv(io->i_adapt, io->i_ctlr);
retry:
retry:
- den = HTTC_1600BPI
|HTTC_PDP11
;
+ den = HTTC_1600BPI
| HTTC_PDP11 | io->i_unit
;
htquiet(htaddr);
htaddr->htcs1 = HT_DCLR|HT_GO;
htaddr->httc = den;
htquiet(htaddr);
htaddr->htcs1 = HT_DCLR|HT_GO;
htaddr->httc = den;
@@
-82,7
+83,7
@@
retry:
return (0);
}
if (func == READ || func == WRITE)
return (0);
}
if (func == READ || func == WRITE)
- mbastart(io, func);
+ mbastart(io,
io->i_ctlr,
func);
else
htaddr->htcs1 = func|HT_GO;
htquiet(htaddr);
else
htaddr->htcs1 = func|HT_GO;
htquiet(htaddr);
@@
-98,11
+99,10
@@
retry:
printf("ht error: ds=%b, er=%b\n",
MASKREG(ds), HTDS_BITS,
MASKREG(er), HTER_BITS);
printf("ht error: ds=%b, er=%b\n",
MASKREG(ds), HTDS_BITS,
MASKREG(er), HTER_BITS);
- if (errcnt == 10) {
+ if (errcnt
++
== 10) {
printf("ht: unrecovered error\n");
return (-1);
}
printf("ht: unrecovered error\n");
return (-1);
}
- errcnt++;
htstrategy(io, HT_SREV);
goto retry;
}
htstrategy(io, HT_SREV);
goto retry;
}
@@
-113,6
+113,7
@@
retry:
return (io->i_cc+fc);
}
return (io->i_cc+fc);
}
+static
htquiet(htaddr)
register struct htdevice *htaddr;
{
htquiet(htaddr)
register struct htdevice *htaddr;
{