SCCS-vsn: sys/vax/stand/up.c 4.5
/*
* UNIBUS peripheral standalone driver
/*
* UNIBUS peripheral standalone driver
tio = *io;
tio.i_bn = st->nspc * st->ncyl - st->nsect;
tio.i_ma = (char *)&upbad[tio.i_unit];
tio = *io;
tio.i_bn = st->nspc * st->ncyl - st->nsect;
tio.i_ma = (char *)&upbad[tio.i_unit];
- tio.i_cc = sizeof (upbad);
+ tio.i_cc = sizeof (struct dkbad);
tio.i_flgs |= F_RDDATA;
for (i = 0; i < 5; i++) {
tio.i_flgs |= F_RDDATA;
for (i = 0; i < 5; i++) {
- if (upstrategy(&tio, READ) == sizeof (upbad))
+ if (upstrategy(&tio, READ) == sizeof (struct dkbad))
if ((io->i_flgs & (F_HDR|F_CHECK)) != 0)
sectsiz += HDRSIZ;
io->i_errcnt = 0;
if ((io->i_flgs & (F_HDR|F_CHECK)) != 0)
sectsiz += HDRSIZ;
io->i_errcnt = 0;
upaddr->upcs2 = unit;
if ((upaddr->upds & UPDS_VV) == 0) {
upaddr->upcs1 = UP_DCLR|UP_GO;
upaddr->upcs2 = unit;
if ((upaddr->upds & UPDS_VV) == 0) {
upaddr->upcs1 = UP_DCLR|UP_GO;
info = ubasetup(io, 1);
upaddr->upwc = -io->i_cc / sizeof (short);
upaddr->upba = info;
info = ubasetup(io, 1);
upaddr->upwc = -io->i_cc / sizeof (short);
upaddr->upba = info;
bn = io->i_bn + (io->i_cc + upaddr->upwc*sizeof(short))/sectsiz;
while((upaddr->upds & UPDS_DRY) == 0)
;
bn = io->i_bn + (io->i_cc + upaddr->upwc*sizeof(short))/sectsiz;
while((upaddr->upds & UPDS_DRY) == 0)
;
- io->i_active = 0; /* else force retry */
}
/*
* Clear drive error and, every eight attempts,
}
/*
* Clear drive error and, every eight attempts,
* recalibrate to clear the slate.
*/
upaddr->upcs1 = UP_TRE|UP_DCLR|UP_GO;
* recalibrate to clear the slate.
*/
upaddr->upcs1 = UP_TRE|UP_DCLR|UP_GO;
- if ((io->i_errcnt&07) == 4 && io->i_active == 0) {
+ if ((io->i_errcnt&07) == 4 ) {
upaddr->upcs1 = UP_RECAL|UP_GO;
upaddr->upcs1 = UP_RECAL|UP_GO;
- recal = 0;
- goto nextrecal;
+ recal = 1;
+ goto restart;
}
/*
* Advance recalibration finite state machine
}
/*
* Advance recalibration finite state machine
case 1:
upaddr->updc = cn;
upaddr->upcs1 = UP_SEEK|UP_GO;
case 1:
upaddr->updc = cn;
upaddr->upcs1 = UP_SEEK|UP_GO;
+ recal++;
+ goto restart;
case 2:
if (io->i_errcnt < 16 || (func & READ) == 0)
goto donerecal;
upaddr->upof = up_offset[io->i_errcnt & 017] | UPOF_FMT22;
upaddr->upcs1 = UP_OFFSET|UP_GO;
case 2:
if (io->i_errcnt < 16 || (func & READ) == 0)
goto donerecal;
upaddr->upof = up_offset[io->i_errcnt & 017] | UPOF_FMT22;
upaddr->upcs1 = UP_OFFSET|UP_GO;
- io->i_active = 1;
- goto readmore;
donerecal:
case 3:
recal = 0;
donerecal:
case 3:
recal = 0;
- * If still ``active'', then don't need any more retries.
+ * If we were offset positioning,
+ * return to centerline.
- if (io->i_active) {
- /*
- * If we were offset positioning,
- * return to centerline.
- */
- if (io->i_errcnt >= 16) {
- upaddr->upof = UPOF_FMT22;
- upaddr->upcs1 = UP_RTC|UP_GO;
- while ((upaddr->upds&UPDS_DRY) == 0)
- DELAY(25);
- }
- goto readmore;
+ if (io->i_errcnt >= 16) {
+ upaddr->upof = UPOF_FMT22;
+ upaddr->upcs1 = UP_RTC|UP_GO;
+ while ((upaddr->upds&UPDS_DRY) == 0)
+ DELAY(25);
#endif
bn = io->i_bn + npf ;
st = &upst[up_type[io->i_unit]];
#endif
bn = io->i_bn + npf ;
st = &upst[up_type[io->i_unit]];
cn = bn/st->nspc;
sn = bn%st->nspc;
tn = sn/st->nsect;
cn = bn/st->nspc;
sn = bn%st->nspc;
tn = sn/st->nsect;
int bit, byte, ecccnt;
ecccnt = 0;
mask = up->upec2;
int bit, byte, ecccnt;
ecccnt = 0;
mask = up->upec2;
- printf("up%d: soft ecc sn%d\n", io->i_unit, io->i_bn + npf );
+ printf("up%d: soft ecc sn%d\n", io->i_unit, bn);
/*
* Compute the
* byte and bit position of the error. The variable i
/*
* Compute the
* byte and bit position of the error. The variable i
up->upwc = twc;
return (0);
}
up->upwc = twc;
return (0);
}