1: /*
   2:  *	Definitions for SMD-type disk drives and drivers.
   3:  *	This file is used for RM02/03/05, RP04/05/06,
   4:  *	and Diva controllers.
   5:  */
   6: 
   7: #if NXP > 0
   8: /*
   9:  *	Structures used in the xp driver
  10:  *	to describe drives, controllers, and topology
  11:  */
  12: struct xp_controller {
  13:     struct  buf *xp_actf;       /* pointer to next active xputab */
  14:     struct  buf *xp_actl;       /* pointer to last active xputab */
  15:     struct  hpdevice *xp_addr;  /* csr address */
  16:     char    xp_flags;       /* controller-type flags */
  17:     char    xp_active;      /* nonzero if doing a transfer */
  18: };
  19: 
  20: struct xp_drive {
  21:     struct  xp_controller *xp_ctlr; /* controller to which slave attached */
  22:     char    xp_type;        /* drive type */
  23:     char    xp_unit;        /* slave number */
  24:     struct  size *xp_sizes;     /* pointer to sizes array */
  25:     char    xp_nsect;
  26:     char    xp_ntrack;
  27:     int xp_nspc;        /* sectors/cylinder */
  28:     int xp_cc;          /* current cylinder, for RM's */
  29: #ifdef  BADSECT
  30:     int xp_ncyl;        /* cylinders per pack */
  31: #endif
  32: };
  33: 
  34: /*
  35:  * bits in xp_flags:
  36:  */
  37: #define XP_NOCC     1       /* has no current cylinder register */
  38: #define XP_RH70     2       /* uses 22-bit addressing */
  39: #define XP_NOSEARCH 4       /* won't do search commands */
  40: 
  41: /*
  42:  * Defines for disk drive type registers
  43:  */
  44: #define RP  022     /* RP04/5/6 */
  45: #define RM03    024     /* RM03 */
  46: #define RM02    025     /* RM02 */
  47: #define RM05    027     /* RM05 */
  48: /*
  49:  * These two drive types are dummies because the actual numbers conflict
  50:  * with DEC controllers.  The RM5X actually reads as 25; the Diva Comp VI
  51:  * reads as 22.  Xp_drive must be patched at boot time or initialized.
  52:  */
  53: #define RM5X    076     /* Ampex 815 cyl. RM05 with Emulex Controller */
  54: #define DV  077     /* Diva Comp VI Controller */
  55: 
  56: #define HP_SECT     22
  57: #define HP_TRAC     19
  58: #define RP06_CYL    815
  59: #define RP04_CYL    411
  60: #define RM_SECT     32
  61: #define RM_TRAC     5
  62: #define RM_CYL      823
  63: #define RM5_SECT    32
  64: #define RM5_TRAC    19
  65: #define RM5_CYL     823
  66: #define RM5X_CYL    815
  67: #define DV_SECT     33
  68: #define DV_TRAC     19
  69: #define DV_CYL      815
  70: 
  71: /*
  72:  *	SI Eagle
  73:  */
  74: #define SI_SECT     48
  75: #define SI_TRAC     20
  76: #define SI_CYL      842
  77: #define SI_SN_MSK   017400      /* SI serial number mask */
  78: #define SI_SN_DT    07400       /* SI serial number drive type */
  79: 
  80: #ifdef  BADSECT
  81: #define NCYL(x)     (x)
  82: #else
  83: #define NCYL(x)     /* not used */
  84: #endif	BADSECT
  85: 
  86: /*
  87:  *  Macros to inititialize xp_drive entries.  These can be used as examples,
  88:  *  or as the actual initializers in ioconf.c.  The arguments are the number
  89:  *  of the controller to which the drive is attached, and the physical
  90:  *  drive unit number.  Used only if XP_PROBE is not defined.
  91:  */
  92: #define RM02_INIT(c,u)  \
  93:     { &xp_controller[c], RM02, u, &rm_sizes, \
  94:     RM_SECT, RM_TRAC, RM_SECT*RM_TRAC, 0, NCYL(RM_CYL)  }
  95: #define RM03_INIT(c,u)  \
  96:     { &xp_controller[c], RM03, u, &rm_sizes, \
  97:     RM_SECT, RM_TRAC, RM_SECT*RM_TRAC, 0, NCYL(RM_CYL)  }
  98: #define RM05_INIT(c,u)  \
  99:     { &xp_controller[c], RM05, u, &rm5_sizes, \
 100:     RM5_SECT, RM5_TRAC, RM5_SECT*RM5_TRAC, 0, NCYL(RM5_CYL)  }
 101: #define RM05X_INIT(c,u) \
 102:     { &xp_controller[c], RM05X, u, &rm5_sizes, \
 103:     RM5_SECT, RM5_TRAC, RM5_SECT*RM5_TRAC, 0, NCYL(RM5X_CYL)  }
 104: #define RP06_INIT(c,u)  \
 105:     { &xp_controller[c], RP, u, &hp_sizes, \
 106:     HP_SECT, HP_TRAC, HP_SECT*HP_TRAC, 0, NCYL(RP06_CYL)  }
 107: #define RP05_INIT(c,u)  RP06_INIT(c,u)
 108: #define RP04_INIT(c,u)  \
 109:     { &xp_controller[c], RP, u, &hp_sizes, \
 110:     HP_SECT, HP_TRAC, HP_SECT*HP_TRAC, 0, NCYL(RP04_CYL)  }
 111: #define SI_INIT(c,u)    \
 112:     { &xp_controller[c], RM05, u, &si_sizes, \
 113:     SI_SECT, SI_TRAC, SI_SECT*SI_TRAC, 0, NCYL(SI_CYL)  }
 114: #define DV_INIT(c,u)    \
 115:     { &xp_controller[c], DV, u, &dv_sizes, \
 116:     DV_SECT, DV_TRAC, DV_SECT*DV_TRAC, 0, NCYL(DV_CYL)  }
 117: #endif	NXP
 118: 
 119: /*
 120:  *	Controller registers and bits
 121:  */
 122: struct hpdevice
 123: {
 124:     union   {
 125:         int w;
 126:         char    c[2];
 127:     }   hpcs1;      /* control and status 1 register */
 128:     short   hpwc;       /* word count register */
 129:     caddr_t hpba;       /* UNIBUS address register */
 130:     short   hpda;       /* desired address register */
 131:     union   {
 132:         int w;
 133:         char    c[2];
 134:     }   hpcs2;      /* control and status 2 register */
 135:     short   hpds;       /* drive status register */
 136:     short   hper1;      /* error register 1 */
 137:     short   hpas;       /* attention summary register */
 138:     short   hpla;       /* look ahead register */
 139:     short   hpdb;       /* data buffer register */
 140:     short   hpmr;       /* maintenance register (1) */
 141:     short   hpdt;       /* drive type register */
 142:     short   hpsn;       /* serial number register */
 143:     short   hpof;       /* offset register */
 144:     short   hpdc;       /* desired cylinder address register */
 145:     short   hpcc;       /* HP: current cylinder register */
 146: #define rmhr    hpcc;       /* RM: holding register */
 147:     short   hper2;      /* HP: error register 2 */
 148: #define rmmr2   hper2       /* RM: maintenance register 2 */
 149:     short   hper3;      /* HP: error register 3 */
 150: #define rmer2   hper3       /* RM: error register 2 */
 151:     short   hpec1;      /* burst error bit position */
 152:     short   hpec2;      /* burst error bit pattern */
 153:     short   hpbae;      /* bus address extension register (RH70 only) */
 154:     short   hpcs3;      /* control and status 3 register (RH70 only) */
 155: };
 156: 
 157: /* Other bits of hpcs1 */
 158: #define HP_SC       0100000     /* special condition */
 159: #define HP_TRE      0040000     /* transfer error */
 160: #define HP_MCPE     0020000     /* MASSBUS control bus read parity error */
 161: /* bit 12 is unused */
 162: #define HP_DVA      0004000     /* drive available */
 163: /* bits 9 and 8 are the extended address bits */
 164: #define HP_RDY      0000200     /* controller ready */
 165: #define HP_IE       0000100     /* interrupt enable */
 166: /* bits 5-1 are the command */
 167: #define HP_GO       0000001
 168: #define HP_BITS     \
 169: "\10\20SC\17TRE\16MCPE\14DVA\10RDY\7IE\1GO"
 170: 
 171: /* commands */
 172: #define HP_NOP      000
 173: #define HP_SEEK     004     /* seek */
 174: #define HP_RECAL    006     /* recalibrate */
 175: #define HP_DCLR     010     /* drive clear */
 176: #define HP_RELEASE  012     /* release */
 177: #define HP_OFFSET   014     /* offset */
 178: #define HP_RTC      016     /* return to center-line */
 179: #define HP_PRESET   020     /* read-in preset */
 180: #define HP_PACK     022     /* pack acknowledge */
 181: #define HP_SEARCH   030     /* search */
 182: #define HP_WCDATA   050     /* write check data */
 183: #define HP_WCHDR    052     /* write check header and data */
 184: #define HP_WCOM     060     /* write */
 185: #define HP_WHDR     062     /* write header and data */
 186: #define HP_RCOM     070     /* read data */
 187: #define HP_RHDR     072     /* read header and data */
 188: /* The following two are optionally enabled on some non-DEC controllers */
 189: #define HP_BOOT     074     /* boot */
 190: #define HP_FORMAT   076     /* format */
 191: 
 192: /* hpcs2 */
 193: #define HPCS2_DLT   0100000     /* data late */
 194: #define HPCS2_WCE   0040000     /* write check error */
 195: #define HPCS2_UPE   0020000     /* UNIBUS parity error */
 196: #define HPCS2_NED   0010000     /* nonexistent drive */
 197: #define HPCS2_NEM   0004000     /* nonexistent memory */
 198: #define HPCS2_PGE   0002000     /* programming error */
 199: #define HPCS2_MXF   0001000     /* missed transfer */
 200: #define HPCS2_MDPE  0000400     /* MASSBUS data read parity error */
 201: #define HPCS2_OR    0000200     /* output ready */
 202: #define HPCS2_IR    0000100     /* input ready */
 203: #define HPCS2_CLR   0000040     /* controller clear */
 204: #define HPCS2_PAT   0000020     /* parity test */
 205: #define HPCS2_BAI   0000010     /* address increment inhibit */
 206: /* bits 2-0 are drive select */
 207: 
 208: #define HPCS2_BITS \
 209: "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MXF\11MDPE\
 210: \10OR\7IR\6CLR\5PAT\4BAI"
 211: 
 212: /* hpds */
 213: #define HPDS_ATA    0100000     /* attention active */
 214: #define HPDS_ERR    0040000     /* composite drive error */
 215: #define HPDS_PIP    0020000     /* positioning in progress */
 216: #define HPDS_MOL    0010000     /* medium on line */
 217: #define HPDS_WRL    0004000     /* write locked */
 218: #define HPDS_LST    0002000     /* last sector transferred */
 219: #define HPDS_DAE    0001000     /* dual access enabled (programmable) */
 220: #define HPDS_DPR    0000400     /* drive present */
 221: #define HPDS_DRY    0000200     /* drive ready */
 222: #define HPDS_VV     0000100     /* volume valid */
 223: /* bits 5-1 are spare */
 224: #define HPDS_OM     0000001     /* offset mode */
 225: 
 226: #define HPDS_DREADY (HPDS_DPR|HPDS_DRY|HPDS_MOL|HPDS_VV)
 227: 
 228: #define HPDS_BITS \
 229: "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13LST\12DAE\11DPR\10DRY\7VV\1OM"
 230: 
 231: /* hper1 */
 232: #define HPER1_DCK   0100000     /* data check */
 233: #define HPER1_UNS   0040000     /* drive unsafe */
 234: #define HPER1_OPI   0020000     /* operation incomplete */
 235: #define HPER1_DTE   0010000     /* drive timing error */
 236: #define HPER1_WLE   0004000     /* write lock error */
 237: #define HPER1_IAE   0002000     /* invalid address error */
 238: #define HPER1_AOE   0001000     /* address overflow error */
 239: #define HPER1_HCRC  0000400     /* header crc error */
 240: #define HPER1_HCE   0000200     /* header compare error */
 241: #define HPER1_ECH   0000100     /* ecc hard error */
 242: #define HPER1_WCF   0000040     /* write clock fail (0) */
 243: #define HPER1_FER   0000020     /* format error */
 244: #define HPER1_PAR   0000010     /* parity error */
 245: #define HPER1_RMR   0000004     /* register modification refused */
 246: #define HPER1_ILR   0000002     /* illegal register */
 247: #define HPER1_ILF   0000001     /* illegal function */
 248: 
 249: #define HPER1_BITS \
 250: "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IAE\12AOE\11HCRC\10HCE\
 251: \7ECH\6WCF\5FER\4PAR\3RMR\2ILR\1ILF"
 252: 
 253: /* hpdt */
 254: #define HPDT_NBA    0100000     /* not block addressed; always 0 */
 255: #define HPDT_TAPE   0040000     /* tape drive; always 0 */
 256: #define HPDT_MH     0020000     /* moving head; always 1 */
 257: /* bit 12 is unused */
 258: #define HPDT_DRR    0004000     /* drive request required  */
 259: /* bits 10-9 are unused */
 260: /* bits 8-0 are drive type; the correct values are hard to determine */
 261: #define HPDT_RM05SP 0000047     /* single ported rm05 */
 262: #define HPDT_RM05DP 0000027     /* dual ported rm05 */
 263: #define HPDT_RM02   0000025     /* rm02, possibly rm03? */
 264: #define HPDT_RM03   0000024     /* rm03 */
 265: #define HPDT_RP06   0000022     /* rp06 */
 266: 
 267: /* hpof */
 268: #define HPOF_FMT22  0010000     /* 16 bit format */
 269: #define HPOF_ECI    0004000     /* ecc inhibit */
 270: #define HPOF_HCI    0002000     /* header compare inhibit */
 271: 
 272: /* THE SC21 ACTUALLY JUST IMPLEMENTS ADVANCE/RETARD... */
 273: #define HPOF_P400   0020        /*  +400 uinches */
 274: #define HPOF_M400   0220        /*  -400 uinches */
 275: #define HPOF_P800   0040        /*  +800 uinches */
 276: #define HPOF_M800   0240        /*  -800 uinches */
 277: #define HPOF_P1200  0060        /* +1200 uinches */
 278: #define HPOF_M1200  0260        /* -1200 uinches */
 279: 
 280: #define HPOF_BITS   \
 281: "\10\15FMT22\14ECI\13HCI\10OD"
 282: 
 283: /* rmer2: These are the bits for an RM error register 2 */
 284: #define RMER2_BSE   0100000     /* bad sector error */
 285: #define RMER2_SKI   0040000     /* seek incomplete */
 286: #define RMER2_DPE   0020000     /* drive plug error */
 287: #define RMER2_IVC   0010000     /* invalid command */
 288: #define RMER2_LSC   0004000     /* loss of system clock */
 289: #define RMER2_LBC   0002000     /* loss of bit clock */
 290: /* bits 9-8 are unused */
 291: #define RMER2_DVC   0000200     /* device check */
 292: /* bits 6-4 are unused */
 293: #define RMER2_MDPE  0000010     /* MASSBUS data read parity error */
 294: /* bits 2-0 are unused */
 295: 
 296: #define RMER2_BITS \
 297: "\10\20BSE\17SKI\16DPE\15IVC\14LSC\13LBC\10DVC\4MDPE"
 298: 
 299: /* hpcs3 */
 300: #define HPCS3_APE   0100000     /* address parity error */
 301: #define HPCS3_DPE   0060000     /* data parity error */
 302: #define HPCS3_WCE   0017000     /* write check error */
 303: #define HPCS3_DW    0002000     /* double word */
 304: /* bits 9-8 are unused */
 305: #define HPCS3_IE    0000100     /* interrupt enable */
 306: /* bits 5-4 are unused */
 307: /* bits 3-0 are inverted parity check */
 308: 
 309: #define HPCS3_BITS  \
 310: "\10\20APE\17DPE\15WCE\13DW\7IE"

Defined struct's

hpdevice defined in line 122; used 137 times
xp_controller defined in line 12; used 26 times
xp_drive defined in line 20; used 36 times

Defined macros

DV defined in line 54; used 1 times
DV_CYL defined in line 69; used 2 times
DV_INIT defined in line 114; never used
DV_SECT defined in line 67; used 6 times
DV_TRAC defined in line 68; used 6 times
HPCS2_BAI defined in line 205; never used
HPCS2_CLR defined in line 203; used 2 times
HPCS2_DLT defined in line 193; never used
HPCS2_IR defined in line 202; never used
HPCS2_MDPE defined in line 200; never used
HPCS2_MXF defined in line 199; never used
HPCS2_NED defined in line 196; used 2 times
HPCS2_OR defined in line 201; never used
HPCS2_PAT defined in line 204; never used
HPCS2_PGE defined in line 198; never used
HPCS2_UPE defined in line 195; never used
HPCS2_WCE defined in line 194; never used
HPCS3_APE defined in line 300; never used
HPCS3_BITS defined in line 309; never used
HPCS3_DPE defined in line 301; never used
HPCS3_DW defined in line 303; never used
HPCS3_IE defined in line 305; never used
HPCS3_WCE defined in line 302; never used
HPDS_ATA defined in line 213; never used
HPDS_BITS defined in line 228; never used
HPDS_DAE defined in line 219; never used
HPDS_DPR defined in line 220; used 41 times
HPDS_DREADY defined in line 226; never used
HPDS_DRY defined in line 221; used 50 times
HPDS_ERR defined in line 214; never used
HPDS_LST defined in line 218; never used
HPDS_MOL defined in line 216; used 41 times
HPDS_OM defined in line 224; never used
HPDS_WRL defined in line 217; never used
HPDT_DRR defined in line 258; never used
HPDT_MH defined in line 256; never used
HPDT_NBA defined in line 254; never used
HPDT_RM02 defined in line 263; never used
HPDT_RM03 defined in line 264; never used
HPDT_RM05DP defined in line 262; never used
HPDT_RM05SP defined in line 261; never used
HPDT_RP06 defined in line 265; never used
HPDT_TAPE defined in line 255; never used
HPER1_AOE defined in line 238; never used
HPER1_DTE defined in line 235; never used
HPER1_FER defined in line 243; used 2 times
HPER1_HCE defined in line 240; never used
HPER1_HCRC defined in line 239; never used
HPER1_IAE defined in line 237; never used
HPER1_ILF defined in line 247; never used
HPER1_ILR defined in line 246; never used
HPER1_OPI defined in line 234; never used
HPER1_PAR defined in line 244; never used
HPER1_RMR defined in line 245; never used
HPER1_UNS defined in line 233; never used
HPER1_WCF defined in line 242; never used
HPOF_BITS defined in line 280; never used
HPOF_ECI defined in line 269; never used
HPOF_HCI defined in line 270; never used
HP_BITS defined in line 168; never used
HP_BOOT defined in line 189; never used
HP_DVA defined in line 162; never used
HP_FORMAT defined in line 190; used 2 times
HP_GO defined in line 167; used 97 times
HP_MCPE defined in line 160; never used
HP_NOP defined in line 172; never used
HP_PACK defined in line 180; never used
HP_RELEASE defined in line 176; never used
HP_SC defined in line 158; never used
HP_SECT defined in line 56; used 8 times
HP_SEEK defined in line 173; used 3 times
HP_TRAC defined in line 57; used 8 times
HP_WCDATA defined in line 182; never used
HP_WCHDR defined in line 183; never used
NCYL defined in line 83; used 8 times
RM02 defined in line 46; used 1 times
  • in line 93
RM02_INIT defined in line 92; used 4 times
RM03 defined in line 45; used 1 times
  • in line 96
RM03_INIT defined in line 95; never used
RM05 defined in line 47; used 2 times
RM05X_INIT defined in line 101; used 2 times
RM05_INIT defined in line 98; never used
RM5X defined in line 53; never used
RM5X_CYL defined in line 66; used 2 times
RM5_CYL defined in line 65; used 2 times
RM5_SECT defined in line 63; used 8 times
RM5_TRAC defined in line 64; used 8 times
RMER2_BITS defined in line 296; never used
RMER2_BSE defined in line 284; used 2 times
RMER2_DPE defined in line 286; never used
RMER2_DVC defined in line 291; never used
RMER2_IVC defined in line 287; never used
RMER2_LBC defined in line 289; never used
RMER2_LSC defined in line 288; never used
RMER2_MDPE defined in line 293; never used
RMER2_SKI defined in line 285; never used
RM_CYL defined in line 62; used 3 times
RM_SECT defined in line 60; used 8 times
RM_TRAC defined in line 61; used 8 times
RP defined in line 44; used 2 times
RP04_CYL defined in line 59; used 1 times
RP04_INIT defined in line 108; never used
RP05_INIT defined in line 107; never used
RP06_CYL defined in line 58; used 2 times
RP06_INIT defined in line 104; used 1 times
SI_CYL defined in line 76; used 2 times
SI_INIT defined in line 111; never used
SI_SECT defined in line 74; used 6 times
SI_SN_DT defined in line 78; used 2 times
SI_SN_MSK defined in line 77; used 2 times
SI_TRAC defined in line 75; used 6 times
XP_RH70 defined in line 38; used 13 times
rmer2 defined in line 150; used 2 times
rmhr defined in line 146; never used
rmmr2 defined in line 148; never used

Usage of this include

Last modified: 1984-02-22
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2339
Valid CSS Valid XHTML 1.0 Strict