1: /*
   2:  * Copyright (c) 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	1.2 (2.11BSD) 1998/1/28
   7:  */
   8: 
   9: /*
  10:  * Definitions for the Mass Storage Control Protocol
  11:  *
  12:  *	Unused mscp definitions are commented out because of the
  13:  *	limited symbol table size in the V7 C compiler,
  14:  *	`too many defines'.
  15:  *	Lots of strangeness in mscp packet definitions, i.e.,
  16:  *	dealing with longs as hi & lo words. This is due to the
  17:  *	way the PDP-11 stores a long, i.e., high order word
  18:  *	in low memory word and low order word in high memory word.
  19:  *	The UDA does not like that at all !
  20:  *
  21:  *	Fred Canter 10/22/83
  22: */
  23: 
  24: #include "pdp/mscp_common.h"
  25: 
  26: /*
  27:  * An MSCP packet
  28:  */
  29: 
  30: struct mscp {
  31:     struct  mscp_header m_header;   /* device specific header */
  32:     u_short m_cmdref;       /* command reference number */
  33:     u_short m_elref;        /* plus error log reference number */
  34:     u_short m_unit;         /* unit number */
  35:     u_short m_xxx1;         /* unused */
  36:     u_char  m_opcode;       /* opcode */
  37:     u_char  m_flags;        /* end message flags */
  38:     u_short m_modifier;     /* modifiers */
  39:     union {
  40:     struct {
  41:         u_short Ms_bytecnt; /* byte count */
  42:         u_short Ms_zzz2;    /* 64kb max on V7 */
  43:         u_short Ms_buf_l;   /* buffer descriptor low word */
  44:         u_short Ms_buf_h;   /* buffer descriptor hi  word */
  45:         long    Ms_xx2[2];  /* unused */
  46:         u_short Ms_lbn_l;   /* logical block number low word */
  47:         u_short Ms_lbn_h;   /* logical bhock number hi  word */
  48:         long    Ms_xx4;     /* unused */
  49:         long    *Ms_dscptr; /* pointer to descriptor (software) */
  50:         long    Ms_sftwds[4];   /* software words, padding */
  51:     } m_generic;
  52:     struct {
  53:         u_short Ms_version; /* MSCP version */
  54:         u_short Ms_cntflgs; /* controller flags */
  55:         u_short Ms_hsttmo;  /* host timeout */
  56:         u_short Ms_usefrac; /* use fraction */
  57:         long    Ms_time;    /* time and date */
  58:     } m_setcntchar;
  59:     struct {
  60:         u_short Ms_multunt; /* multi-unit code */
  61:         u_short Ms_unitflgs;    /* unit flags */
  62:         long    Ms_hostid;  /* host identifier */
  63:         quad    Ms_unitid;  /* unit identifier */
  64:         long    Ms_mediaid; /* media type identifier */
  65:         u_short Ms_shdwunt; /* shadow unit */
  66:         u_short Ms_shdwsts; /* shadow status */
  67:         u_short Ms_track;   /* track size */
  68:         u_short Ms_group;   /* group size */
  69:         u_short Ms_cylinder;    /* cylinder size */
  70:         u_short Ms_xx3;     /* reserved */
  71:         u_short Ms_rctsize; /* RCT table size */
  72:         char    Ms_rbns;    /* RBNs / track */
  73:         char    Ms_rctcpys; /* RCT copies */
  74:     } m_getunitsts;
  75:     } m_un;
  76:     int m_msgpad[3];        /* pad msg length to 64 bytes */
  77:                     /* required by UQ bus port spec */
  78: };
  79: 
  80: /*
  81:  * generic packet
  82:  */
  83: 
  84: #define m_zzz2      m_un.m_generic.Ms_zzz2
  85: #define m_bytecnt   m_un.m_generic.Ms_bytecnt
  86: #define m_buf_l     m_un.m_generic.Ms_buf_l
  87: #define m_buf_h     m_un.m_generic.Ms_buf_h
  88: #define m_lbn_l     m_un.m_generic.Ms_lbn_l
  89: #define m_lbn_h     m_un.m_generic.Ms_lbn_h
  90: #define m_dscptr    m_un.m_generic.Ms_dscptr
  91: #define m_sftwds    m_un.m_generic.Ms_sftwds
  92: #define m_status    m_modifier
  93: 
  94: /*
  95:  * Abort / Get Command Status packet
  96:  */
  97: 
  98: #define m_outref    m_bytecnt
  99: 
 100: /*
 101:  * Online / Set Unit Characteristics packet
 102:  */
 103: 
 104: #define m_elgfll    m_lbn_l
 105: #define m_elgflh    m_lbn_h
 106: #define m_copyspd   m_shdwsts
 107: 
 108: /*
 109:  * Replace packet
 110:  */
 111: 
 112: #define m_rbn   m_bytecnt
 113: 
 114: /*
 115:  * Set Controller Characteristics packet
 116:  */
 117: 
 118: #define m_version   m_un.m_setcntchar.Ms_version
 119: #define m_cntflgs   m_un.m_setcntchar.Ms_cntflgs
 120: #define m_hsttmo    m_un.m_setcntchar.Ms_hsttmo
 121: #define m_usefrac   m_un.m_setcntchar.Ms_usefrac
 122: #define m_time      m_un.m_setcntchar.Ms_time
 123: 
 124: /*
 125:  * Get Unit Status end packet
 126:  */
 127: 
 128: #define m_multunt   m_un.m_getunitsts.Ms_multunt
 129: #define m_unitflgs  m_un.m_getunitsts.Ms_unitflgs
 130: #define m_hostid    m_un.m_getunitsts.Ms_hostid
 131: #define m_unitid    m_un.m_getunitsts.Ms_unitid
 132: #define m_mediaid   m_un.m_getunitsts.Ms_mediaid
 133: #define m_shdwunt   m_un.m_getunitsts.Ms_shdwunt
 134: #define m_shdwsts   m_un.m_getunitsts.Ms_shdwsts
 135: #define m_track     m_un.m_getunitsts.Ms_track
 136: #define m_group     m_un.m_getunitsts.Ms_group
 137: #define m_cylinder  m_un.m_getunitsts.Ms_cylinder
 138: #define m_rctsize   m_un.m_getunitsts.Ms_rctsize
 139: #define m_rbns      m_un.m_getunitsts.Ms_rbns
 140: #define m_rctcpys   m_un.m_getunitsts.Ms_rctcpys
 141: 
 142: /*
 143:  * Online / Set Unit Characteristics end packet
 144:  */
 145: 
 146: #define m_uslow     m_un.m_getunitsts.Ms_track
 147: #define m_ushigh    m_un.m_getunitsts.Ms_group
 148: #define m_volser    m_sftwds[0]
 149: 
 150: /*
 151:  * Set Controller Characteristics end packet
 152:  */
 153: 
 154: #define m_cnttmo    m_hsttmo
 155: #define m_cntcmdl   m_usefrac
 156: #define m_cntid     m_unitid
 157: 
 158: /*
 159:  * MSCP Error Log packet
 160:  *
 161:  *	NOTE: MSCP packet must be padded to this size.
 162:  */
 163: 
 164: struct mslg {
 165:     struct  mscp_header me_header;  /* device specific header */
 166:     int me_cmdref;      /* command reference number */
 167:     int me_elref;       /* error log reference number */
 168:     short   me_unit;        /* unit number */
 169:     short   me_seqnum;      /* sequence number */
 170:     u_char  me_format;      /* format */
 171:     u_char  me_flags;       /* error log message flags */
 172:     short   me_event;       /* event code */
 173:     quad    me_cntid;       /* controller id */
 174:     u_char  me_cntsvr;      /* controller software version */
 175:     u_char  me_cnthvr;      /* controller hardware version */
 176:     short   me_multunt;     /* multi-unit code */
 177:     quad    me_unitid;      /* unit id */
 178:     u_char  me_unitsvr;     /* unit software version */
 179:     u_char  me_unithvr;     /* unit hardware version */
 180:     short   me_group;       /* group; retry + level */
 181:     int me_volser[2];       /* volume serial number */
 182:     int me_hdr[2];      /* header */
 183:     char    me_sdistat[12];     /* SDI status information */
 184: };
 185: 
 186: #define me_busaddr  me_unitid
 187: #define me_sdecyl   me_group

Defined struct's

mscp defined in line 30; used 56 times
mslg defined in line 164; used 4 times

Defined macros

m_buf_h defined in line 87; used 4 times
m_buf_l defined in line 86; used 4 times
m_bytecnt defined in line 85; used 7 times
m_cntcmdl defined in line 155; never used
m_cntflgs defined in line 119; used 3 times
m_cntid defined in line 156; never used
m_cnttmo defined in line 154; never used
m_copyspd defined in line 106; used 1 times
m_cylinder defined in line 137; used 1 times
m_dscptr defined in line 90; used 4 times
m_elgflh defined in line 105; used 1 times
m_elgfll defined in line 104; used 1 times
m_group defined in line 136; used 1 times
m_hostid defined in line 130; never used
m_hsttmo defined in line 120; used 1 times
m_lbn_h defined in line 89; used 4 times
m_lbn_l defined in line 88; used 4 times
m_mediaid defined in line 132; used 6 times
m_multunt defined in line 128; never used
m_outref defined in line 98; never used
m_rbn defined in line 112; never used
m_rbns defined in line 139; never used
m_rctcpys defined in line 140; never used
m_rctsize defined in line 138; never used
m_sftwds defined in line 91; used 1 times
m_shdwsts defined in line 134; used 1 times
m_shdwunt defined in line 133; never used
m_status defined in line 92; used 6 times
m_time defined in line 122; never used
m_track defined in line 135; used 1 times
m_unitflgs defined in line 129; never used
m_unitid defined in line 131; used 1 times
m_usefrac defined in line 121; used 1 times
m_ushigh defined in line 147; used 2 times
m_uslow defined in line 146; used 2 times
m_version defined in line 118; never used
m_volser defined in line 148; never used
m_zzz2 defined in line 84; never used
me_busaddr defined in line 186; never used
me_sdecyl defined in line 187; used 1 times

Usage of this include

Last modified: 1998-01-29
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3084
Valid CSS Valid XHTML 1.0 Strict