1: /*	@(#)tmscp.h	7.1 (Berkeley) 6/5/86 */
   2: 
   3: /*
   4:  *	@(#)tmscp.h	1.3	10/21/85
   5:  * Definitions for the Tape Mass Storage Control Protocol
   6:  */
   7: 
   8: /****************************************************************
   9:  *                                                              *
  10:  *        Licensed from Digital Equipment Corporation           *
  11:  *                       Copyright (c)                          *
  12:  *               Digital Equipment Corporation                  *
  13:  *                   Maynard, Massachusetts                     *
  14:  *                         1985, 1986                           *
  15:  *                    All rights reserved.                      *
  16:  *                                                              *
  17:  *        The Information in this software is subject to change *
  18:  *   without notice and should not be construed as a commitment *
  19:  *   by  Digital  Equipment  Corporation.   Digital   makes  no *
  20:  *   representations about the suitability of this software for *
  21:  *   any purpose.  It is supplied "As Is" without expressed  or *
  22:  *   implied  warranty. 					*
  23:  *								*
  24:  *        If the Regents of the University of California or its *
  25:  *   licensees modify the software in a manner creating  	*
  26:  *   diriviative copyright rights, appropriate copyright  	*
  27:  *   legends may be placed on  the drivative work in addition   *
  28:  *   to that set forth above. 					*
  29:  *								*
  30:  ****************************************************************
  31:  *
  32:  * Modification history: /sys/vax/tmscp.h
  33:  *
  34:  * 18-Oct-85 - afd
  35:  *	Added: defines for tape format (density) flag values.
  36:  *
  37:  * 18-Jul-85 - afd
  38:  *	Added: #define	M_UF_WBKNV	0000100
  39:  *		for write back (which enables cache).
  40:  ************************************************************************/
  41: 
  42: 
  43: /*
  44:  * Control message opcodes
  45:  */
  46: #define M_OP_ABORT  0001    /* Abort command */
  47: #define M_OP_GTCMD  0002    /* Get command status command */
  48: #define M_OP_GTUNT  0003    /* Get unit status command */
  49: #define M_OP_STCON  0004    /* Set controller characteristics command */
  50: #define M_OP_AVAIL  0010    /* Available command */
  51: #define M_OP_ONLIN  0011    /* Online command */
  52: #define M_OP_STUNT  0012    /* Set unit characteristics command */
  53: #define M_OP_DTACP  0013    /* Determine access paths command */
  54: #define M_OP_ACCES  0020    /* Access command */
  55: #define M_OP_CMPCD  0021    /* Compare controller data command */
  56: #define M_OP_ERASE  0022    /* Erase command */
  57: #define M_OP_FLUSH  0023    /* Flush command */
  58: #define M_OP_ERGAP  0026    /* Erase gap command */
  59: #define M_OP_COMP   0040    /* Compare host data command */
  60: #define M_OP_READ   0041    /* Read command */
  61: #define M_OP_WRITE  0042    /* Write command */
  62: #define M_OP_WRITM  0044    /* Write tape mark command */
  63: #define M_OP_REPOS  0045    /* Reposition command */
  64: #define M_OP_AVATN  0100    /* Available attention message */
  65: #define M_OP_DUPUN  0101    /* Duplicate unit number attention message */
  66: #define M_OP_ACPTH  0102    /* Access path attention message */
  67: #define M_OP_END    0200    /* End message flag */
  68: 
  69: 
  70: /*
  71:  * Generic command modifiers
  72:  */
  73: #define M_MD_COMP   0040000     /* Compare */
  74: #define M_MD_CLSEX  0020000     /* Clear serious exception */
  75: #define M_MD_SECOR  0001000     /* Suppress error correction */
  76: #define M_MD_SEREC  0000400     /* Suppress error recovery */
  77: #define M_MD_STWRP  0000004     /* Set write protect */
  78: #define M_MD_ALLCD  0000002     /* All class drivers */
  79: #define M_MD_NXUNT  0000001     /* Next unit */
  80: 
  81: /*
  82:  * TMSCP command modifiers
  83:  */
  84: #define M_MD_DLEOT  0000200     /* Delete LEOT */
  85: #define M_MD_IMMED  0000100     /* Immediate completion */
  86: #define M_MD_EXCAC  0000040     /* Exclusive access */
  87: #define M_MD_UNLOD  0000020     /* Unload */
  88: #define M_MD_REVRS  0000010     /* reverse */
  89: #define M_MD_OBJCT  0000004     /* object count */
  90: #define M_MD_REWND  0000002     /* rewind */
  91: 
  92: /*
  93:  * End message flags
  94:  */
  95: #define M_EF_ERLOG  0040    /* Error log generated */
  96: #define M_EF_SEREX  0020    /* Serious exception */
  97: #define M_EF_EOT    0010    /* End of tape encountered */
  98: #define M_EF_PLS    0004    /* Position lost */
  99: 
 100: 
 101: /*
 102:  * Controller flags
 103:  */
 104: #define M_CF_ATTN   0200    /* Enable attention messages */
 105: #define M_CF_MISC   0100    /* Enable miscellaneous error log messages */
 106: #define M_CF_OTHER  0040    /* Enable other host's error log messages */
 107: #define M_CF_THIS   0020    /* Enable this host's error log messages */
 108: 
 109: 
 110: /*
 111:  * Unit flags
 112:  */
 113: #define M_UF_WRTPH  0020000     /* Write protect (hardware) */
 114: #define M_UF_WRTPS  0010000     /* Write protect (software or volume) */
 115: #define M_UF_WBKNV  0000100     /* Write back (enables cache) */
 116: #define M_UF_VSMSU  0000040     /* Variable speed mode suppression */
 117: #define M_UF_VARSP  0000020     /* Variable speed unit */
 118: #define M_UF_CMPWR  0000002     /* Compare writes */
 119: #define M_UF_CMPRD  0000001     /* Compare reads */
 120: 
 121: 
 122: /*
 123:  * Status codes
 124:  */
 125: #define M_ST_MASK   037     /* Status code mask */
 126: #define M_ST_SUCC   000     /* Success */
 127: #define M_ST_ICMD   001     /* Invalid command */
 128: #define M_ST_ABRTD  002     /* Command aborted */
 129: #define M_ST_OFFLN  003     /* Unit offline */
 130: #define M_ST_AVLBL  004     /* Unit available */
 131: #define M_ST_WRTPR  006     /* Write protected */
 132: #define M_ST_COMP   007     /* Compare error */
 133: #define M_ST_DATA   010     /* Data error */
 134: #define M_ST_HSTBF  011     /* Host buffer access error */
 135: #define M_ST_CNTLR  012     /* Controller error */
 136: #define M_ST_DRIVE  013     /* Drive error */
 137: #define M_ST_FMTER  014     /* Formatter error */
 138: #define M_ST_BOT    015     /* BOT encountered */
 139: #define M_ST_TAPEM  016     /* Tape mark encountered */
 140: #define M_ST_RDTRN  020     /* Record data truncated */
 141: #define M_ST_PLOST  021     /* Position lost */
 142: #define M_ST_SEX    022     /* Serious exception */
 143: #define M_ST_LED    023     /* LEOT detected */
 144: #define M_ST_DIAG   037     /* Message from an internal diagnostic */
 145: 
 146: /*
 147:  * An MSCP packet
 148:  */
 149: 
 150: struct mscp {
 151:     struct  mscp_header mscp_header;/* device specific header */
 152:     long    mscp_cmdref;        /* command reference number */
 153:     short   mscp_unit;      /* unit number */
 154:     short   mscp_xxx1;      /* unused */
 155:     u_char  mscp_opcode;        /* opcode */
 156:     u_char  mscp_flags;     /* end message flags */
 157:     short   mscp_modifier;      /* modifiers */
 158:     union {
 159:     struct {
 160:         long    Mscp_bytecnt;   /* byte count */
 161:         long    Mscp_buffer;    /* buffer descriptor */
 162:         long    Mscp_mapbase;   /* physical addr of map registers */
 163:         long    Mscp_xxx2;  /* unused */
 164:         long    Mscp_lbn;   /* logical block number */
 165:         long    Mscp_xxx4;  /* unused */
 166:         long    *Mscp_dscptr;   /* pointer to descriptor (software) */
 167:         long    Mscp_sftwds[17];/* software words, padding */
 168:     } mscp_generic;
 169:     struct {
 170:         short   Mscp_version;   /* MSCP version */
 171:         short   Mscp_cntflgs;   /* controller flags */
 172:         short   Mscp_hsttmo;    /* host timeout */
 173:         short   Mscp_usefrac;   /* use fraction */
 174:         quad    Mscp_time;  /* time and date */
 175:         long    Mscp_cntdep;    /* controller dependent parameters */
 176:     } mscp_setcntchar;
 177:     struct {
 178:         short   Mscp_multunt;   /* multi-unit code */
 179:         short   Mscp_unitflgs;  /* unit flags */
 180:         long    Mscp_hostid;    /* host identifier */
 181:         quad    Mscp_unitid;    /* unit identifier */
 182:         long    Mscp_mediaid;   /* media type identifier */
 183:         short   Mscp_format;    /* format (tape density) */
 184:         short   Mscp_speed; /* tape speed = (ips * bpi) /1000 */
 185:         short   Mscp_fmtmenu;   /* format menu */
 186:         short   Mscp_group; /* group size */
 187:         short   Mscp_cylinder;  /* cylinder size */
 188:         short   Mscp_xxx3;  /* reserved */
 189:         short   Mscp_rctsize;   /* RCT table size */
 190:         char    Mscp_rbns;  /* RBNs / track */
 191:         char    Mscp_rctcpys;   /* RCT copies */
 192:     } mscp_getunitsts;
 193:     } mscp_un;
 194:     short mscp_fil1;
 195:     short mscp_fil2;
 196:     short mscp_fil3;
 197: };
 198: 
 199: #define mscp_msglen (sizeof (struct mscp) - sizeof(struct mscp_header))
 200: 
 201: /*
 202:  * generic packet
 203:  */
 204: 
 205: #define mscp_bytecnt    mscp_un.mscp_generic.Mscp_bytecnt
 206: #define mscp_buffer mscp_un.mscp_generic.Mscp_buffer
 207: #define mscp_mapbase    mscp_un.mscp_generic.Mscp_mapbase
 208: #define mscp_lbn    mscp_un.mscp_generic.Mscp_lbn
 209: #define mscp_dscptr mscp_un.mscp_generic.Mscp_dscptr
 210: #define mscp_sftwds mscp_un.mscp_generic.Mscp_sftwds
 211: #define mscp_status mscp_modifier
 212: 
 213: /*
 214:  * Abort / Get Command Status packet
 215:  */
 216: 
 217: #define mscp_outref mscp_bytecnt
 218: 
 219: /*
 220:  * Set Controller Characteristics packet
 221:  */
 222: 
 223: #define mscp_version    mscp_un.mscp_setcntchar.Mscp_version
 224: #define mscp_cntflgs    mscp_un.mscp_setcntchar.Mscp_cntflgs
 225: #define mscp_hsttmo mscp_un.mscp_setcntchar.Mscp_hsttmo
 226: #define mscp_usefrac    mscp_un.mscp_setcntchar.Mscp_usefrac
 227: #define mscp_time   mscp_un.mscp_setcntchar.Mscp_time
 228: #define mscp_cntdep mscp_un.mscp_setcntchar.Mscp_cntdep
 229: 
 230: /*
 231:  * Reposition command packet fields
 232:  */
 233: 
 234: #define mscp_reccnt mscp_bytecnt    /* record/object count */
 235: #define mscp_tmkcnt mscp_buffer     /* tape mark count */
 236: 
 237: /*
 238:  * Get Unit Status end packet
 239:  */
 240: 
 241: #define mscp_multunt    mscp_un.mscp_getunitsts.Mscp_multunt
 242: #define mscp_unitflgs   mscp_un.mscp_getunitsts.Mscp_unitflgs
 243: #define mscp_hostid mscp_un.mscp_getunitsts.Mscp_hostid
 244: #define mscp_unitid mscp_un.mscp_getunitsts.Mscp_unitid
 245: #define mscp_mediaid    mscp_un.mscp_getunitsts.Mscp_mediaid
 246: #define mscp_format mscp_un.mscp_getunitsts.Mscp_format /* density:0=high */
 247: #define mscp_speed  mscp_un.mscp_getunitsts.Mscp_speed  /* (ips*bpi)/1000 */
 248: #define mscp_fmtmenu    mscp_un.mscp_getunitsts.Mscp_fmtmenu
 249: 
 250: /*
 251:  * Online / Set Unit Characteristics end packet
 252:  */
 253: 
 254: #define mscp_maxwrt mscp_dscptr /* max write byte count */
 255: #define mscp_noiserec   mscp_cylinder   /* noise record */
 256: 
 257: /*
 258:  * Set Controller Characteristics end packet
 259:  */
 260: 
 261: #define mscp_cnttmo mscp_hsttmo /* controller timeout */
 262: #define mscp_cntcmdl    mscp_usefrac    /* controller soft & hardware version */
 263: #define mscp_cntid  mscp_unitid /* controller id */
 264: 
 265: 
 266: /*
 267:  * Error Log message format codes
 268:  */
 269: #define M_FM_CNTERR 0   /* Controller error */
 270: #define M_FM_BUSADDR    1   /* Host memory access error */
 271: #define M_FM_TAPETRN    5   /* Tape transfer error */
 272: #define M_FM_STIERR 6   /* STI communication or command failure */
 273: #define M_FM_STIDEL 7   /* STI drive error log */
 274: #define M_FM_STIFEL   010   /* STI formatter error log */
 275: 
 276: /*
 277:  * Error Log message flags
 278:  */
 279: #define M_LF_SUCC   0200    /* Operation successful */
 280: #define M_LF_CONT   0100    /* Operation continuing */
 281: #define M_LF_SQNRS  0001    /* Sequence number reset */
 282: 
 283: /*
 284:  * Tape Format Flag Values
 285:  */
 286: #define M_TF_800    001 /* NRZI 800 bpi */
 287: #define M_TF_PE     002 /* Phase Encoded 1600 bpi */
 288: #define M_TF_GCR    004 /* Group Code Recording 6250 bpi */
 289: #define M_TF_BLK    010 /* Cartridge Block Mode */
 290: 
 291: /*
 292:  * MSCP Error Log packet
 293:  *
 294:  *	NOTE: MSCP packet must be padded to this size.
 295:  */
 296: 
 297: struct mslg {
 298:     struct  mscp_header mslg_header;/* device specific header */
 299:     long    mslg_cmdref;        /* command reference number */
 300:     short   mslg_unit;      /* unit number */
 301:     short   mslg_seqnum;        /* sequence number */
 302:     u_char  mslg_format;        /* format */
 303:     u_char  mslg_flags;     /* error log message flags */
 304:     short   mslg_event;     /* event code */
 305:     quad    mslg_cntid;     /* controller id */
 306:     u_char  mslg_cntsvr;        /* controller software version */
 307:     u_char  mslg_cnthvr;        /* controller hardware version */
 308:     short   mslg_multunt;       /* multi-unit code */
 309:     quad    mslg_unitid;        /* unit id */
 310:     u_char  mslg_unitsvr;       /* unit software version */
 311:     u_char  mslg_unithvr;       /* unit hardware version */
 312:     short   mslg_group;     /* group; retry + level */
 313:     long    mslg_position;      /* position (object count) */
 314:     u_char  mslg_fmtsvr;        /* formatter software version */
 315:     u_char  mslg_fmthvr;        /* formatter hardware version */
 316:     short   mslg_xxx2;      /* unused */
 317:     char    mslg_stiunsucc[62]; /* STI status information */
 318: };
 319: 
 320: #define mslg_busaddr    mslg_unitid.val[0]
 321: #define mslg_sdecyl mslg_group

Defined struct's

mscp defined in line 150; used 34 times
mslg defined in line 297; used 6 times

Defined macros

M_CF_ATTN defined in line 104; used 1 times
M_CF_MISC defined in line 105; used 1 times
M_CF_OTHER defined in line 106; never used
M_CF_THIS defined in line 107; used 1 times
M_EF_EOT defined in line 97; never used
M_EF_ERLOG defined in line 95; never used
M_EF_PLS defined in line 98; never used
M_EF_SEREX defined in line 96; used 1 times
M_FM_BUSADDR defined in line 270; never used
M_FM_CNTERR defined in line 269; never used
M_FM_STIDEL defined in line 273; never used
M_FM_STIERR defined in line 272; never used
M_FM_STIFEL defined in line 274; never used
M_FM_TAPETRN defined in line 271; never used
M_LF_CONT defined in line 280; used 2 times
M_LF_SQNRS defined in line 281; never used
M_LF_SUCC defined in line 279; used 2 times
M_MD_ALLCD defined in line 78; never used
M_MD_CLSEX defined in line 74; used 4 times
M_MD_COMP defined in line 73; never used
M_MD_DLEOT defined in line 84; never used
M_MD_EXCAC defined in line 86; never used
M_MD_IMMED defined in line 85; used 1 times
M_MD_NXUNT defined in line 79; never used
M_MD_OBJCT defined in line 89; used 2 times
M_MD_REVRS defined in line 88; used 2 times
M_MD_REWND defined in line 90; used 2 times
M_MD_SECOR defined in line 75; never used
M_MD_SEREC defined in line 76; never used
M_MD_STWRP defined in line 77; never used
M_MD_UNLOD defined in line 87; used 1 times
M_OP_ABORT defined in line 46; never used
M_OP_ACCES defined in line 54; never used
M_OP_ACPTH defined in line 66; never used
M_OP_AVAIL defined in line 50; used 2 times
M_OP_AVATN defined in line 64; never used
M_OP_CMPCD defined in line 55; never used
M_OP_COMP defined in line 59; never used
M_OP_DTACP defined in line 53; never used
M_OP_DUPUN defined in line 65; never used
M_OP_END defined in line 67; used 8 times
M_OP_ERASE defined in line 56; never used
M_OP_ERGAP defined in line 58; never used
M_OP_FLUSH defined in line 57; never used
M_OP_GTCMD defined in line 47; never used
M_OP_GTUNT defined in line 48; used 4 times
M_OP_ONLIN defined in line 51; used 5 times
M_OP_READ defined in line 60; used 5 times
M_OP_REPOS defined in line 63; used 11 times
M_OP_STCON defined in line 49; used 4 times
M_OP_STUNT defined in line 52; used 5 times
M_OP_WRITE defined in line 61; used 6 times
M_OP_WRITM defined in line 62; used 2 times
M_ST_ABRTD defined in line 128; never used
M_ST_AVLBL defined in line 130; used 2 times
M_ST_BOT defined in line 138; never used
M_ST_CNTLR defined in line 135; never used
M_ST_COMP defined in line 132; never used
M_ST_DATA defined in line 133; never used
M_ST_DIAG defined in line 144; never used
M_ST_DRIVE defined in line 136; never used
M_ST_FMTER defined in line 137; never used
M_ST_HSTBF defined in line 134; never used
M_ST_ICMD defined in line 127; never used
M_ST_LED defined in line 143; never used
M_ST_MASK defined in line 125; used 7 times
M_ST_OFFLN defined in line 129; used 1 times
M_ST_PLOST defined in line 141; never used
M_ST_RDTRN defined in line 140; never used
M_ST_SEX defined in line 142; never used
M_ST_SUCC defined in line 126; used 5 times
M_ST_TAPEM defined in line 139; used 3 times
M_ST_WRTPR defined in line 131; never used
M_TF_800 defined in line 286; used 2 times
M_TF_BLK defined in line 289; never used
M_TF_GCR defined in line 288; never used
M_TF_PE defined in line 287; used 1 times
M_UF_CMPRD defined in line 119; never used
M_UF_CMPWR defined in line 118; never used
M_UF_VARSP defined in line 117; never used
M_UF_VSMSU defined in line 116; never used
M_UF_WBKNV defined in line 115; used 2 times
M_UF_WRTPH defined in line 113; never used
M_UF_WRTPS defined in line 114; never used
mscp_buffer defined in line 206; used 7 times
mscp_bytecnt defined in line 205; used 8 times
mscp_cntcmdl defined in line 262; never used
mscp_cntdep defined in line 228; used 1 times
mscp_cntflgs defined in line 224; used 3 times
mscp_cntid defined in line 263; never used
mscp_cnttmo defined in line 261; used 1 times
mscp_dscptr defined in line 209; used 11 times
mscp_fmtmenu defined in line 248; used 1 times
mscp_format defined in line 246; used 7 times
mscp_hostid defined in line 243; never used
mscp_hsttmo defined in line 225; used 2 times
mscp_lbn defined in line 208; used 3 times
mscp_mapbase defined in line 207; used 1 times
mscp_maxwrt defined in line 254; used 1 times
mscp_mediaid defined in line 245; used 14 times
mscp_msglen defined in line 199; used 7 times
mscp_multunt defined in line 241; never used
mscp_noiserec defined in line 255; never used
mscp_outref defined in line 217; never used
mscp_reccnt defined in line 234; used 2 times
mscp_sftwds defined in line 210; never used
mscp_speed defined in line 247; never used
mscp_status defined in line 211; used 8 times
mscp_time defined in line 227; used 2 times
mscp_tmkcnt defined in line 235; used 4 times
mscp_unitflgs defined in line 242; used 5 times
mscp_unitid defined in line 244; used 3 times
mscp_usefrac defined in line 226; used 1 times
mscp_version defined in line 223; used 2 times
mslg_busaddr defined in line 320; used 1 times
mslg_sdecyl defined in line 321; never used

Usage of this include

Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1662
Valid CSS Valid XHTML 1.0 Strict