1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)mscp.h	7.1 (Berkeley) 6/5/86
   7:  */
   8: 
   9: /*
  10:  * Definitions for the Mass Storage Control Protocol
  11:  */
  12: 
  13: 
  14: /*
  15:  * Control message opcodes
  16:  */
  17: #define M_OP_ABORT  0001    /* Abort command */
  18: #define M_OP_GTCMD  0002    /* Get command status command */
  19: #define M_OP_GTUNT  0003    /* Get unit status command */
  20: #define M_OP_STCON  0004    /* Set controller characteristics command */
  21: #define M_OP_SEREX  0007    /* Serious exception end message */
  22: #define M_OP_AVAIL  0010    /* Available command */
  23: #define M_OP_ONLIN  0011    /* Online command */
  24: #define M_OP_STUNT  0012    /* Set unit characteristics command */
  25: #define M_OP_DTACP  0013    /* Determine access paths command */
  26: #define M_OP_ACCES  0020    /* Access command */
  27: #define M_OP_CMPCD  0021    /* Compare controller data command */
  28: #define M_OP_ERASE  0022    /* Erase command */
  29: #define M_OP_FLUSH  0023    /* Flush command */
  30: #define M_OP_REPLC  0024    /* Replace command */
  31: #define M_OP_COMP   0040    /* Compare host data command */
  32: #define M_OP_READ   0041    /* Read command */
  33: #define M_OP_WRITE  0042    /* Write command */
  34: #define M_OP_AVATN  0100    /* Available attention message */
  35: #define M_OP_DUPUN  0101    /* Duplicate unit number attention message */
  36: #define M_OP_ACPTH  0102    /* Access path attention message */
  37: #define M_OP_END    0200    /* End message flag */
  38: 
  39: 
  40: /*
  41:  * Generic command modifiers
  42:  */
  43: #define M_MD_EXPRS  0100000     /* Express request */
  44: #define M_MD_COMP   0040000     /* Compare */
  45: #define M_MD_CLSEX  0020000     /* Clear serious exception */
  46: #define M_MD_ERROR  0010000     /* Force error */
  47: #define M_MD_SCCHH  0004000     /* Suppress caching (high speed) */
  48: #define M_MD_SCCHL  0002000     /* Suppress caching (low speed) */
  49: #define M_MD_SECOR  0001000     /* Suppress error correction */
  50: #define M_MD_SEREC  0000400     /* Suppress error recovery */
  51: #define M_MD_SSHDW  0000200     /* Suppress shadowing */
  52: #define M_MD_WBKNV  0000100     /* Write back (non-volatile) */
  53: #define M_MD_WBKVL  0000040     /* Write back (volatile) */
  54: #define M_MD_WRSEQ  0000020     /* Write shadow set one unit at a time */
  55: 
  56: /*
  57:  * AVAILABLE command modifiers
  58:  */
  59: #define M_MD_ALLCD  0000002     /* All class drivers */
  60: #define M_MD_SPNDW  0000001     /* Spin down */
  61: 
  62: /*
  63:  * FLUSH command modifiers
  64:  */
  65: #define M_MD_FLENU  0000001     /* Flush entire unit */
  66: #define M_MD_VOLTL  0000002     /* Volatile only */
  67: 
  68: /*
  69:  * GET UNIT STATUS command modifiers
  70:  */
  71: #define M_MD_NXUNT  0000001     /* Next unit */
  72: 
  73: /*
  74:  * ONLINE command modifiers
  75:  */
  76: #define M_MD_RIP    0000001     /* Allow self destruction */
  77: #define M_MD_IGNMF  0000002     /* Ignore media format error */
  78: 
  79: /*
  80:  * ONLINE and SET UNIT CHARACTERISTICS command modifiers
  81:  */
  82: #define M_MD_ALTHI  0000040     /* Alter host identifier */
  83: #define M_MD_SHDSP  0000020     /* Shadow unit specified */
  84: #define M_MD_CLWBL  0000010     /* Clear write-back data lost */
  85: #define M_MD_STWRP  0000004     /* Set write protect */
  86: 
  87: /*
  88:  * REPLACE command modifiers
  89:  */
  90: #define M_MD_PRIMR  0000001     /* Primary replacement block */
  91: 
  92: 
  93: /*
  94:  * End message flags
  95:  */
  96: #define M_EF_BBLKR  0200    /* Bad block reported */
  97: #define M_EF_BBLKU  0100    /* Bad block unreported */
  98: #define M_EF_ERLOG  0040    /* Error log generated */
  99: #define M_EF_SEREX  0020    /* Serious exception */
 100: 
 101: 
 102: /*
 103:  * Controller flags
 104:  */
 105: #define M_CF_ATTN   0200    /* Enable attention messages */
 106: #define M_CF_MISC   0100    /* Enable miscellaneous error log messages */
 107: #define M_CF_OTHER  0040    /* Enable other host's error log messages */
 108: #define M_CF_THIS   0020    /* Enable this host's error log messages */
 109: #define M_CF_MLTHS  0004    /* Multi-host */
 110: #define M_CF_SHADW  0002    /* Shadowing */
 111: #define M_CF_576    0001    /* 576 byte sectors */
 112: 
 113: 
 114: /*
 115:  * Unit flags
 116:  */
 117: #define M_UF_REPLC  0100000     /* Controller initiated bad block replacement */
 118: #define M_UF_INACT  0040000     /* Inactive shadow set unit */
 119: #define M_UF_WRTPH  0020000     /* Write protect (hardware) */
 120: #define M_UF_WRTPS  0010000     /* Write protect (software or volume) */
 121: #define M_UF_SCCHH  0004000     /* Suppress caching (high speed) */
 122: #define M_UF_SCCHL  0002000     /* Suppress caching (low speed) */
 123: #define M_UF_RMVBL  0000200     /* Removable media */
 124: #define M_UF_WBKNV  0000100     /* Write back (non-volatile) */
 125: #define M_UF_576    0000004     /* 576 byte sectors */
 126: #define M_UF_CMPWR  0000002     /* Compare writes */
 127: #define M_UF_CMPRD  0000001     /* Compare reads */
 128: 
 129: 
 130: /*
 131:  * Status codes
 132:  */
 133: #define M_ST_MASK   037     /* Status code mask */
 134: #define M_ST_SUCC   000     /* Success */
 135: #define M_ST_ICMD   001     /* Invalid command */
 136: #define M_ST_ABRTD  002     /* Command aborted */
 137: #define M_ST_OFFLN  003     /* Unit offline */
 138: #define M_ST_AVLBL  004     /* Unit available */
 139: #define M_ST_MFMTE  005     /* Media format error */
 140: #define M_ST_WRTPR  006     /* Write protected */
 141: #define M_ST_COMP   007     /* Compare error */
 142: #define M_ST_DATA   010     /* Data error */
 143: #define M_ST_HSTBF  011     /* Host buffer access error */
 144: #define M_ST_CNTLR  012     /* Controller error */
 145: #define M_ST_DRIVE  013     /* Drive error */
 146: #define M_ST_DIAG   037     /* Message from an internal diagnostic */
 147: 
 148: /*
 149:  * An MSCP packet
 150:  */
 151: 
 152: struct mscp {
 153:     struct  mscp_header mscp_header;/* device specific header */
 154:     long    mscp_cmdref;        /* command reference number */
 155:     short   mscp_unit;      /* unit number */
 156:     short   mscp_xxx1;      /* unused */
 157:     u_char  mscp_opcode;        /* opcode */
 158:     u_char  mscp_flags;     /* end message flags */
 159:     short   mscp_modifier;      /* modifiers */
 160:     union {
 161:     struct {
 162:         long    Mscp_bytecnt;   /* byte count */
 163:         long    Mscp_buffer;    /* buffer descriptor */
 164:         long    Mscp_xxx2[2];   /* unused */
 165:         long    Mscp_lbn;   /* logical block number */
 166:         long    Mscp_xxx4;  /* unused */
 167:         long    *Mscp_dscptr;   /* pointer to descriptor (software) */
 168:         long    Mscp_sftwds[4]; /* software words, padding */
 169:     } mscp_generic;
 170:     struct {
 171:         short   Mscp_version;   /* MSCP version */
 172:         short   Mscp_cntflgs;   /* controller flags */
 173:         short   Mscp_hsttmo;    /* host timeout */
 174:         short   Mscp_usefrac;   /* use fraction */
 175:         long    Mscp_time;  /* time and date */
 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_shdwunt;   /* shadow unit */
 184:         short   Mscp_shdwsts;   /* shadow status */
 185:         short   Mscp_track; /* track size */
 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_lbn    mscp_un.mscp_generic.Mscp_lbn
 208: #define mscp_dscptr mscp_un.mscp_generic.Mscp_dscptr
 209: #define mscp_sftwds mscp_un.mscp_generic.Mscp_sftwds
 210: #define mscp_status mscp_modifier
 211: 
 212: /*
 213:  * Abort / Get Command Status packet
 214:  */
 215: 
 216: #define mscp_outref mscp_bytecnt
 217: 
 218: /*
 219:  * Online / Set Unit Characteristics packet
 220:  */
 221: 
 222: #define mscp_errlgfl    mscp_lbn
 223: #define mscp_copyspd    mscp_shdwsts
 224: 
 225: /*
 226:  * Replace packet
 227:  */
 228: 
 229: #define mscp_rbn    mscp_bytecnt
 230: 
 231: /*
 232:  * Set Controller Characteristics packet
 233:  */
 234: 
 235: #define mscp_version    mscp_un.mscp_setcntchar.Mscp_version
 236: #define mscp_cntflgs    mscp_un.mscp_setcntchar.Mscp_cntflgs
 237: #define mscp_hsttmo mscp_un.mscp_setcntchar.Mscp_hsttmo
 238: #define mscp_usefrac    mscp_un.mscp_setcntchar.Mscp_usefrac
 239: #define mscp_time   mscp_un.mscp_setcntchar.Mscp_time
 240: 
 241: /*
 242:  * Get Unit Status end packet
 243:  */
 244: 
 245: #define mscp_multunt    mscp_un.mscp_getunitsts.Mscp_multunt
 246: #define mscp_unitflgs   mscp_un.mscp_getunitsts.Mscp_unitflgs
 247: #define mscp_hostid mscp_un.mscp_getunitsts.Mscp_hostid
 248: #define mscp_unitid mscp_un.mscp_getunitsts.Mscp_unitid
 249: #define mscp_mediaid    mscp_un.mscp_getunitsts.Mscp_mediaid
 250: #define mscp_shdwunt    mscp_un.mscp_getunitsts.Mscp_shdwunt
 251: #define mscp_shdwsts    mscp_un.mscp_getunitsts.Mscp_shdwsts
 252: #define mscp_track  mscp_un.mscp_getunitsts.Mscp_track
 253: #define mscp_group  mscp_un.mscp_getunitsts.Mscp_group
 254: #define mscp_cylinder   mscp_un.mscp_getunitsts.Mscp_cylinder
 255: #define mscp_rctsize    mscp_un.mscp_getunitsts.Mscp_rctsize
 256: #define mscp_rbns   mscp_un.mscp_getunitsts.Mscp_rbns
 257: #define mscp_rctcpys    mscp_un.mscp_getunitsts.Mscp_rctcpys
 258: 
 259: /*
 260:  * Online / Set Unit Characteristics end packet
 261:  */
 262: 
 263: #define mscp_untsize    mscp_dscptr
 264: #define mscp_volser mscp_sftwds[0]
 265: 
 266: /*
 267:  * Set Controller Characteristics end packet
 268:  */
 269: 
 270: #define mscp_cnttmo mscp_hsttmo
 271: #define mscp_cntcmdl    mscp_usefrac
 272: #define mscp_cntid  mscp_unitid
 273: 
 274: 
 275: /*
 276:  * Error Log message format codes
 277:  */
 278: #define M_FM_CNTERR 0   /* Controller error */
 279: #define M_FM_BUSADDR    1   /* Host memory access error */
 280: #define M_FM_DISKTRN    2   /* Disk transfer error */
 281: #define M_FM_SDI    3   /* SDI error */
 282: #define M_FM_SMLDSK 4   /* Small disk error */
 283: 
 284: /*
 285:  * Error Log message flags
 286:  */
 287: #define M_LF_SUCC   0200    /* Operation successful */
 288: #define M_LF_CONT   0100    /* Operation continuing */
 289: #define M_LF_SQNRS  0001    /* Sequence number reset */
 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_volser;        /* volume serial number */
 314:     long    mslg_hdr;       /* header */
 315:     char    mslg_sdistat[12];   /* SDI status information */
 316: };
 317: 
 318: #define mslg_busaddr    mslg_unitid.val[0]
 319: #define mslg_sdecyl mslg_group

Defined struct's

mscp defined in line 152; used 40 times
mslg defined in line 297; used 6 times

Defined macros

M_CF_576 defined in line 111; never used
M_CF_ATTN defined in line 105; used 1 times
M_CF_MISC defined in line 106; used 1 times
M_CF_MLTHS defined in line 109; never used
M_CF_OTHER defined in line 107; never used
M_CF_SHADW defined in line 110; never used
M_CF_THIS defined in line 108; used 1 times
M_EF_BBLKR defined in line 96; never used
M_EF_BBLKU defined in line 97; never used
M_EF_ERLOG defined in line 98; never used
M_EF_SEREX defined in line 99; never used
M_FM_BUSADDR defined in line 279; never used
M_FM_CNTERR defined in line 278; never used
M_FM_DISKTRN defined in line 280; never used
M_FM_SDI defined in line 281; never used
M_FM_SMLDSK defined in line 282; never used
M_LF_CONT defined in line 288; used 2 times
M_LF_SQNRS defined in line 289; never used
M_LF_SUCC defined in line 287; used 2 times
M_MD_ALLCD defined in line 59; never used
M_MD_ALTHI defined in line 82; never used
M_MD_CLSEX defined in line 45; never used
M_MD_CLWBL defined in line 84; never used
M_MD_COMP defined in line 44; never used
M_MD_ERROR defined in line 46; never used
M_MD_EXPRS defined in line 43; never used
M_MD_FLENU defined in line 65; never used
M_MD_IGNMF defined in line 77; never used
M_MD_NXUNT defined in line 71; never used
M_MD_PRIMR defined in line 90; never used
M_MD_RIP defined in line 76; never used
M_MD_SCCHH defined in line 47; never used
M_MD_SCCHL defined in line 48; never used
M_MD_SECOR defined in line 49; never used
M_MD_SEREC defined in line 50; never used
M_MD_SHDSP defined in line 83; never used
M_MD_SPNDW defined in line 60; never used
M_MD_SSHDW defined in line 51; never used
M_MD_STWRP defined in line 85; never used
M_MD_VOLTL defined in line 66; never used
M_MD_WBKNV defined in line 52; never used
M_MD_WBKVL defined in line 53; never used
M_MD_WRSEQ defined in line 54; never used
M_OP_ABORT defined in line 17; never used
M_OP_ACCES defined in line 26; never used
M_OP_ACPTH defined in line 36; never used
M_OP_AVAIL defined in line 22; never used
M_OP_AVATN defined in line 34; never used
M_OP_CMPCD defined in line 27; never used
M_OP_COMP defined in line 31; never used
M_OP_DTACP defined in line 25; never used
M_OP_DUPUN defined in line 35; never used
M_OP_END defined in line 37; used 4 times
M_OP_ERASE defined in line 28; never used
M_OP_FLUSH defined in line 29; never used
M_OP_GTCMD defined in line 18; never used
M_OP_GTUNT defined in line 19; used 2 times
M_OP_ONLIN defined in line 23; used 7 times
M_OP_READ defined in line 32; used 3 times
M_OP_REPLC defined in line 30; never used
M_OP_SEREX defined in line 21; never used
M_OP_STCON defined in line 20; used 4 times
M_OP_STUNT defined in line 24; never used
M_OP_WRITE defined in line 33; used 4 times
M_ST_ABRTD defined in line 136; never used
M_ST_AVLBL defined in line 138; used 2 times
M_ST_CNTLR defined in line 144; never used
M_ST_COMP defined in line 141; never used
M_ST_DATA defined in line 142; never used
M_ST_DIAG defined in line 146; never used
M_ST_DRIVE defined in line 145; never used
M_ST_HSTBF defined in line 143; never used
M_ST_ICMD defined in line 135; never used
M_ST_MASK defined in line 133; used 3 times
M_ST_MFMTE defined in line 139; never used
M_ST_OFFLN defined in line 137; used 1 times
M_ST_SUCC defined in line 134; used 5 times
M_ST_WRTPR defined in line 140; never used
M_UF_576 defined in line 125; never used
M_UF_CMPRD defined in line 127; never used
M_UF_CMPWR defined in line 126; never used
M_UF_INACT defined in line 118; never used
M_UF_REPLC defined in line 117; never used
M_UF_RMVBL defined in line 123; never used
M_UF_SCCHH defined in line 121; never used
M_UF_SCCHL defined in line 122; never used
M_UF_WBKNV defined in line 124; never used
M_UF_WRTPH defined in line 119; never used
M_UF_WRTPS defined in line 120; never used
mscp_buffer defined in line 206; used 5 times
mscp_bytecnt defined in line 205; used 8 times
mscp_cntcmdl defined in line 271; never used
mscp_cntflgs defined in line 236; used 3 times
mscp_cntid defined in line 272; never used
mscp_cnttmo defined in line 270; never used
mscp_copyspd defined in line 223; used 2 times
mscp_cylinder defined in line 254; never used
mscp_dscptr defined in line 208; used 9 times
mscp_errlgfl defined in line 222; used 2 times
mscp_group defined in line 253; never used
mscp_hostid defined in line 247; never used
mscp_hsttmo defined in line 237; used 1 times
mscp_lbn defined in line 207; used 4 times
mscp_mediaid defined in line 249; used 11 times
mscp_msglen defined in line 199; used 5 times
mscp_multunt defined in line 245; never used
mscp_outref defined in line 216; never used
mscp_rbn defined in line 229; never used
mscp_rbns defined in line 256; never used
mscp_rctcpys defined in line 257; never used
mscp_rctsize defined in line 255; never used
mscp_sftwds defined in line 209; used 1 times
mscp_shdwsts defined in line 251; used 1 times
mscp_shdwunt defined in line 250; never used
mscp_status defined in line 210; used 7 times
mscp_time defined in line 239; never used
mscp_track defined in line 252; never used
mscp_unitflgs defined in line 246; never used
mscp_unitid defined in line 248; used 1 times
mscp_untsize defined in line 263; used 1 times
mscp_usefrac defined in line 238; used 1 times
mscp_version defined in line 235; used 1 times
mscp_volser defined in line 264; never used
mslg_busaddr defined in line 318; used 1 times
mslg_sdecyl defined in line 319; used 1 times

Usage of this include

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