1*4764Swnj /* utreg.h 81/11/07 4.3 */ 24742Swnj 34742Swnj /* 44742Swnj * System Industries Model 9700 Tape Drive 54742Swnj * emulates TU45 on the UNIBUS 64742Swnj */ 74742Swnj 8*4764Swnj struct utdevice { 94742Swnj u_short utcs1; /* control status register 1 */ 104742Swnj short utwc; /* word count register */ 114742Swnj u_short utba; /* low 16-bits of bus address */ 124747Sroot short utfc; /* frame counter */ 134742Swnj u_short utcs2; /* control status register 2 */ 144742Swnj u_short utds; /* drive status register */ 154742Swnj u_short uter; /* error register */ 164742Swnj u_short utas; /* attention status register */ 174742Swnj u_short utcc; /* NRZI CRC character for validation */ 184742Swnj u_short utdb; /* data buffer reg (not emulated) */ 194742Swnj u_short utmr; /* maintenance reg (not emulated) */ 204742Swnj u_short utdt; /* drive type register (not emulated) */ 214742Swnj u_short utsn; /* serial number reg (not emulated) */ 224742Swnj u_short uttc; /* tape control register */ 234742Swnj u_short utbae; /* buffer address extension register */ 244742Swnj u_short utcs3; /* control and status register 3 */ 254742Swnj }; 264742Swnj 274742Swnj /* 284742Swnj * utcs1 -- 294742Swnj * cmds, interrupt enable, extended address bits, and status 304742Swnj */ 31*4764Swnj #define UT_GO 0x0001 /* go bit */ 324742Swnj /* function codes reside in bits 5-1 */ 33*4764Swnj #define UT_NOP 0x0000 /* no operation */ 34*4764Swnj #define UT_REWOFFL 0x0002 /* rewind offline */ 35*4764Swnj #define UT_LOOP 0x0004 /* loop read/write */ 36*4764Swnj #define UT_REW 0x0006 /* rewind */ 37*4764Swnj #define UT_CLEAR 0x0008 /* drive clear */ 38*4764Swnj #define UT_SENSE 0x000a /* drive sense */ 39*4764Swnj #define UT_PRESET 0x0010 /* read in preset */ 40*4764Swnj #define UT_DIAGN 0x0012 /* diagnostic mode set */ 41*4764Swnj #define UT_ERASE 0x0014 /* erase */ 42*4764Swnj #define UT_WEOF 0x0016 /* write tape mark */ 43*4764Swnj #define UT_SFORW 0x0018 /* forward space block */ 44*4764Swnj #define UT_SREV 0x001a /* reverse space block */ 45*4764Swnj #define UT_SFORWF 0x001c /* forward space file */ 46*4764Swnj #define UT_SREVF 0x001e /* reverse space file */ 47*4764Swnj #define UT_WCHFORW 0x0028 /* write check forward */ 48*4764Swnj #define UT_WCHREV 0x002e /* write check reverse */ 49*4764Swnj #define UT_WCOM 0x0030 /* write forward */ 50*4764Swnj #define UT_RCOM 0x0038 /* read forward */ 51*4764Swnj #define UT_RREV 0x003e /* read reverse */ 524742Swnj /* the remainder are control and status bits */ 53*4764Swnj #define UT_IE 0x0040 /* interrupt-enable */ 54*4764Swnj #define UT_RDY 0x0080 /* controller ready */ 55*4764Swnj #define UT_EADDR 0x0300 /* extended address bits */ 564742Swnj /* bit 10 unused */ 57*4764Swnj #define UT_DVA 0x0800 /* drive available */ 584742Swnj /* bit 12 unused */ 594742Swnj /* bit 13 - massbus control parity error not emulated */ 60*4764Swnj #define UT_TRE 0x4000 /* transfer error */ 61*4764Swnj #define UT_SC 0x8000 /* special condition */ 624742Swnj 634742Swnj #define UT_BITS \ 644742Swnj "\10\20SC\17TRE\14DVA\10RDY\7IE\1GO" 654742Swnj 664742Swnj /* 674742Swnj * utcs2 -- 68*4764Swnj * controller clear, error flags, and unit select 694742Swnj */ 70*4764Swnj /* bits 0-2 are unit select */ 71*4764Swnj #define UTCS2_BAI 0x0008 /* UNIBUS address increment inhibit */ 72*4764Swnj #define UTCS2_PAT 0x0010 /* parity test */ 73*4764Swnj #define UTCS2_CLR 0x0020 /* controller clear */ 74*4764Swnj #define UTCS2_IR 0x0040 /* input ready (not emulated) */ 75*4764Swnj #define UTCS2_OR 0x0080 /* output ready (not emulated) */ 76*4764Swnj #define UTCS2_RPE 0x0100 /* rom parity error */ 77*4764Swnj #define UTCS2_MXF 0x0200 /* missed transfer */ 78*4764Swnj #define UTCS2_NEM 0x0400 /* non existant memory */ 79*4764Swnj #define UTCS2_PGE 0x0800 /* program error */ 80*4764Swnj #define UTCS2_NED 0x1000 /* non existent drive */ 81*4764Swnj #define UTCS2_PE 0x2000 /* parity error */ 82*4764Swnj #define UTCS2_WCE 0x4000 /* write check error */ 83*4764Swnj #define UTCS2_DLT 0x8000 /* data late */ 844742Swnj 85*4764Swnj #define UTCS2_BITS \ 864742Swnj "\10\20DLT\17WCE\16PE\15NED\14\NEM\13\PGE\12\MXF\11RPE\10OR\7IR\6CLR\5PAT\4\BAI" 874742Swnj 884742Swnj /* 894742Swnj * utds -- 90*4764Swnj * beginning of tape, end of tape, error summary bit, plus lots more 914742Swnj */ 92*4764Swnj #define UTDS_SLA 0x0001 /* slave attention */ 93*4764Swnj #define UTDS_BOT 0x0002 /* beginning of tape */ 94*4764Swnj #define UTDS_TM 0x0004 /* tape mark */ 95*4764Swnj #define UTDS_IDB 0x0008 /* identification burst */ 96*4764Swnj #define UTDS_SDWN 0x0010 /* slowing down */ 97*4764Swnj #define UTDS_PES 0x0020 /* phase encode status */ 98*4764Swnj #define UTDS_SSC 0x0040 /* slave status change */ 99*4764Swnj #define UTDS_DRY 0x0080 /* drive ready */ 100*4764Swnj #define UTDS_DPR 0x0100 /* drive present (always 1) */ 101*4764Swnj #define UTDS_GCR 0x0200 /* GCR status */ 102*4764Swnj #define UTDS_EOT 0x0400 /* end of tape */ 103*4764Swnj #define UTDS_WRL 0x0800 /* write lock */ 104*4764Swnj #define UTDS_MOL 0x1000 /* medium on line */ 105*4764Swnj #define UTDS_PIP 0x2000 /* positioning in progress */ 106*4764Swnj #define UTDS_ERR 0x4000 /* composite error */ 107*4764Swnj #define UTDS_ATA 0x8000 /* attention active */ 1084742Swnj 1094742Swnj #define UTDS_BITS \ 1104742Swnj "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13EOT\12GCR\11DPR\10DRY\ 1114742Swnj \7SSC\6PES\5SDWN\4IDB\3TM\2BOT\1SLA" 1124742Swnj 1134742Swnj /* 1144742Swnj * uter -- 115*4764Swnj * detailed breakdown of error summary bit from cs2 1164742Swnj */ 117*4764Swnj #define UTER_ILF 0x0001 /* illegal function */ 118*4764Swnj #define UTER_ILR 0x0002 /* illegal register (always 0) */ 119*4764Swnj #define UTER_RMR 0x0004 /* register modification refused */ 120*4764Swnj #define UTER_RPE 0x0008 /* read data parity error */ 121*4764Swnj #define UTER_FMT 0x0010 /* format error */ 122*4764Swnj #define UTER_DPAR 0x0020 /* data bus parity error */ 123*4764Swnj #define UTER_INC 0x0040 /* incorrectable data */ 124*4764Swnj #define UTER_PEF 0x0080 /* PE format error */ 125*4764Swnj #define UTER_NSG 0x0100 /* non standard gap */ 126*4764Swnj #define UTER_FCE 0x0200 /* frame count error */ 127*4764Swnj #define UTER_CS 0x0400 /* correctable skew */ 128*4764Swnj #define UTER_NEF 0x0800 /* non executable function */ 129*4764Swnj #define UTER_DTE 0x1000 /* drive timing error */ 130*4764Swnj #define UTER_OPI 0x2000 /* operation incomplete */ 131*4764Swnj #define UTER_UNS 0x4000 /* unsafe */ 132*4764Swnj #define UTER_COR 0x8000 /* correctible data error */ 1334742Swnj 1344747Sroot /* 1354747Sroot * These errors we consider "hard"; UTER_OPI and UTER_RPE 1364747Sroot * are considered "soft", at least for the moment. 1374747Sroot */ 1384747Sroot #define UTER_HARD (UTER_UNS|UTER_NEF|UTER_DPAR|UTER_FMT|UTER_RMR|\ 1394747Sroot UTER_ILR|UTER_ILF) 1404742Swnj 1414742Swnj #define UTER_BITS \ 142*4764Swnj "\10\20COR\17UNS\16OPI\15DTE\14NEF\13CS\12FCE\11NSG\10PEF\ 1434742Swnj \7INC\6DPAR\5FMT\4RPE\3RMR\2ILR\1ILF" 1444742Swnj 1454742Swnj /* 1464742Swnj * uttc -- 147*4764Swnj * tape format and density 1484742Swnj */ 149*4764Swnj /* bits 0-2 are slave select */ 150*4764Swnj #define UTTC_EVPAR 0x0008 /* even parity */ 151*4764Swnj #define UTTC_FMT 0x00f0 /* format select (see below) */ 152*4764Swnj #define UTTC_DEN 0x0700 /* density select (see below) */ 1534742Swnj /* bit 11 not used */ 154*4764Swnj #define UTTC_EAODTE 0x1000 /* (not emulated) */ 155*4764Swnj #define UTTC_TCW 0x2000 /* tape control write */ 156*4764Swnj #define UTTC_FCS 0x4000 /* frame count status */ 157*4764Swnj #define UTTC_ACCL 0x8000 /* acceleration */ 1584742Swnj 1594742Swnj /* the bits to stuff in UTTC_DEN */ 160*4764Swnj #define UT_NRZI 0x0000 /* 800 bpi code */ 161*4764Swnj #define UT_PE 0x0400 /* 1600 bpi code */ 162*4764Swnj #define UT_GCR 0x0500 /* 6250 bpi code */ 1634742Swnj 1644742Swnj /* tape formats - only PDP-11 standard is supported */ 165*4764Swnj #define PDP11FMT 0x00c0 /* PDP-11 standard */ 1664742Swnj 1674742Swnj #define b_repcnt b_bcount 1684742Swnj #define b_command b_resid 1694747Sroot #define b_state b_active 170