X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/c10bcf0aabaedee4b1f74ec2184fd7dfce84d0c5..de59ccc2375aad4c9f0ff41f3291584ead755f15:/usr/src/sys/vax/uba/up.c diff --git a/usr/src/sys/vax/uba/up.c b/usr/src/sys/vax/uba/up.c index 9357c868b4..44e1bdbeb2 100644 --- a/usr/src/sys/vax/uba/up.c +++ b/usr/src/sys/vax/uba/up.c @@ -1,4 +1,4 @@ -/* up.c 4.45 82/03/31 */ +/* up.c 4.53 82/05/27 */ #include "up.h" #if NSC > 0 @@ -42,7 +42,11 @@ struct size daddr_t nblocks; int cyloff; } up_sizes[8] = { +#ifdef ERNIE + 49324, 0, /* A=cyl 0 thru 26 */ +#else 15884, 0, /* A=cyl 0 thru 26 */ +#endif 33440, 27, /* B=cyl 27 thru 81 */ 495520, 0, /* C=cyl 0 thru 814 */ 15884, 562, /* D=cyl 562 thru 588 */ @@ -68,13 +72,13 @@ struct size #else 213760, 155, #endif -}, am_sizes[8] = { +}, upam_sizes[8] = { 15884, 0, /* A=cyl 0 thru 31 */ 33440, 32, /* B=cyl 32 thru 97 */ 524288, 0, /* C=cyl 0 thru 1023 */ - 0, 0, - 0, 0, - 0, 0, + 27786, 668, + 27786, 723, + 125440, 778, 181760, 668, /* G=cyl 668 thru 1022 */ 291346, 98, /* H=cyl 98 thru 667 */ }; @@ -111,7 +115,7 @@ struct upst { 32, 19, 32*19, 823, up_sizes, /* 9300/cdc */ /* 9300 actually has 815 cylinders... */ 32, 10, 32*10, 823, fj_sizes, /* fujitsu 160m */ - 32, 16, 32*16, 1024, am_sizes, /* ampex capricorn */ + 32, 16, 32*16, 1024, upam_sizes, /* ampex capricorn */ }; u_char up_offset[16] = { @@ -156,6 +160,7 @@ upslave(ui, reg) upaddr->upcs1 = 0; /* conservative */ upaddr->upcs2 = ui->ui_slave; + upaddr->upcs1 = UP_NOP|UP_GO; if (upaddr->upcs2&UPCS2_NED) { upaddr->upcs1 = UP_DCLR|UP_GO; return (0); @@ -460,7 +465,7 @@ updgo(um) { register struct updevice *upaddr = (struct updevice *)um->um_addr; - um->um_tab.b_active++; /* should now be 2 */ + um->um_tab.b_active = 2; /* should now be 2 */ upaddr->upba = um->um_ubinfo; upaddr->upcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300); } @@ -492,6 +497,7 @@ upintr(sc21) upaddr->upcs1 = UP_TRE; goto doattn; } + um->um_tab.b_active = 1; /* * Get device and block structures, and a pointer * to the uba_device for the drive. Select the drive. @@ -738,7 +744,6 @@ upecc(ui) i++; bit -= 8; } - um->um_tab.b_active = 2; /* Either complete or continuing... */ if (up->upwc == 0) return (0); /* @@ -766,6 +771,7 @@ upecc(ui) up->upba = ubaddr; cmd = (ubaddr >> 8) & 0x300; cmd |= UP_IE|UP_GO|UP_RCOM; + um->um_tab.b_active = 2; /* continuing transfer ... */ up->upcs1 = cmd; #endif return (1); @@ -858,6 +864,7 @@ updump(dev) register struct uba_device *ui; register short *rp; struct upst *st; + register int retry; unit = minor(dev) >> 3; if (unit >= NUP) @@ -869,20 +876,22 @@ updump(dev) uba = phys(struct uba_hd *, ui->ui_hd)->uh_physuba; ubainit(uba); upaddr = (struct updevice *)ui->ui_physaddr; - DELAY(2000000); + DELAY(5000000); num = maxfree; - start = 0; upaddr->upcs2 = unit; DELAY(100); - if ((upaddr->upcs1&UP_DVA) == 0) - return (EFAULT); - if ((upaddr->upds & UPDS_VV) == 0) { - upaddr->upcs1 = UP_DCLR|UP_GO; - upaddr->upcs1 = UP_PRESET|UP_GO; - upaddr->upof = UPOF_FMT22; - } + upaddr->upcs1 = UP_DCLR|UP_GO; + upaddr->upcs1 = UP_PRESET|UP_GO; + upaddr->upof = UPOF_FMT22; + retry = 0; + do { + DELAY(25); + if (++retry > 527) + break; + } while ((upaddr->upds & UP_RDY) == 0); if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) return (EFAULT); + start = 0; st = &upst[ui->ui_type]; sizes = phys(struct size *, st->sizes); if (dumplo < 0 || dumplo + num >= sizes[minor(dev)&07].nblocks) @@ -909,9 +918,20 @@ updump(dev) *--rp = 0; *--rp = -blk*NBPG / sizeof (short); *--rp = UP_GO|UP_WCOM; + retry = 0; do { DELAY(25); + if (++retry > 527) + break; } while ((upaddr->upcs1 & UP_RDY) == 0); + if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) { + printf("up%d: not ready", unit); + if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) { + printf("\n"); + return (EIO); + } + printf(" (flakey)\n"); + } if (upaddr->upds&UPDS_ERR) return (EIO); start += blk*NBPG;