1: /*	@(#)tmscp.h	1.2 (2.11BSD) 1998/2/23 */
   2: 
   3: /****************************************************************
   4:  *                                                              *
   5:  *        Licensed from Digital Equipment Corporation           *
   6:  *                       Copyright (c)                          *
   7:  *               Digital Equipment Corporation                  *
   8:  *                   Maynard, Massachusetts                     *
   9:  *                         1985, 1986                           *
  10:  *                    All rights reserved.                      *
  11:  *                                                              *
  12:  *        The Information in this software is subject to change *
  13:  *   without notice and should not be construed as a commitment *
  14:  *   by  Digital  Equipment  Corporation.   Digital   makes  no *
  15:  *   representations about the suitability of this software for *
  16:  *   any purpose.  It is supplied "As Is" without expressed  or *
  17:  *   implied  warranty. 					*
  18:  *								*
  19:  *        If the Regents of the University of California or its *
  20:  *   licensees modify the software in a manner creating  	*
  21:  *   diriviative copyright rights, appropriate copyright  	*
  22:  *   legends may be placed on  the drivative work in addition   *
  23:  *   to that set forth above. 					*
  24:  *								*
  25:  ****************************************************************
  26:  *
  27:  * Modification history:
  28:  *
  29:  * 23-Feb-98 - sms
  30:  *	The version number and revision history were accidentally omitted
  31:  *	when update #401 was prepared (29-Jan-98).
  32:  *
  33:  *	Rearrange and clarify tmscp packet structure.  It was apparently
  34:  *	possible for the 'mscp_dscptr' field to be overwritten with status
  35:  *	information by the controller.  The 'm_filler' field was not used,
  36:  *	no longer needed and in fact was just wasting 6 bytes of space.  It
  37:  *	was removed.  The per controller structure is now 1864 bytes instead
  38:  *	of 1896.
  39:  *
  40:  * 12-Dec-95 - sms
  41:  *	Begin process of moving definitions common to MSCP and TMSCP into
  42:  *	a different include file.  Define additional flags for the (heavily)
  43:  *	revised TMSCP driver.
  44:  *
  45:  * 18-Oct-85 - afd
  46:  *	Added: defines for tape format (density) flag values.
  47:  *
  48:  * 18-Jul-85 - afd
  49:  *	Added: #define	M_UF_WBKNV	0000100
  50:  *		for write back (which enables cache).
  51:  ************************************************************************/
  52: 
  53: 
  54: #include <machine/mscp_common.h>
  55: 
  56: /*
  57:  * A TMSCP packet.
  58:  *
  59:  * WARNING!  If this structure grows be sure to change the '1864' in the
  60:  * file pdp/machdep2.c!!!
  61:  */
  62: 
  63: struct mscp {
  64:     struct  mscp_header mscp_header;/* device specific header */
  65:     u_short mscp_cmdref;        /* command reference number */
  66:     u_short m_xxx0;         /* filler */
  67:     short   mscp_unit;      /* unit number */
  68:     short   m_xxx1;         /* unused */
  69:     u_char  mscp_opcode;        /* opcode */
  70:     u_char  mscp_flags;     /* end message flags */
  71:     short   mscp_modifier;      /* modifiers */
  72:     union {
  73:     char    FILLER[94];     /* sizeof (mslg) after 16 byte header */
  74:     struct {
  75:         u_short bytecnt;    /* byte count (low order) */
  76:         u_short zzz2;       /* 64kb max for pdp-11 (high order) */
  77:         u_short buf_l;      /* buffer descriptor low word */
  78:         u_short buf_h;      /* buffer descriptor high word */
  79:         long    xxx2[2];    /* unused */
  80:         u_short lbn_l;      /* logical block number low word */
  81:         u_short lbn_h;      /* logical block number high word */
  82:     } gen;
  83:     struct {
  84:         short   version;    /* MSCP version */
  85:         short   cntflgs;    /* controller flags */
  86:         short   hsttmo;     /* host timeout */
  87:         short   usefrac;    /* use fraction */
  88:         u_long  time[2];    /* time and date */
  89:         long    cntdep;     /* controller dependent parameters */
  90:     } scc;
  91:     struct {
  92:         short   multunt;    /* multi-unit code */
  93:         short   unitflgs;   /* unit flags */
  94:         long    hostid;     /* host identifier */
  95:         u_long  unitid[2];  /* unit identifier */
  96:         long    mediaid;    /* media type identifier */
  97:         short   format;     /* format (tape density) */
  98:         short   speed;      /* tape speed = (ips * bpi) /1000 */
  99:         short   fmtmenu;    /* format menu */
 100:         u_short maxwtrec;   /* max write byte count */
 101:         u_short noiserec;   /* max noise record size */
 102:         u_short pad;        /* reserved */
 103:     } gtu;
 104: /*
 105:  * Reposition end message.  Note:  the shorts are not swapped in any
 106:  * of the longs.
 107: */
 108:     struct  {
 109:         u_long  rcskiped;   /* records skipped */
 110:         u_long  tmskiped;   /* tapemarks skipped */
 111:         u_long  pad[2];     /* not used */
 112:         u_long  position;   /* tape position */
 113:     } rep_em;
 114:     } un;
 115:     long    *mscp_dscptr;   /* pointer to descriptor (software) */
 116: };
 117: 
 118: /*
 119:  * generic packet
 120:  */
 121: 
 122: #define mscp_zzz2   un.gen.zzz2
 123: #define mscp_bytecnt    un.gen.bytecnt
 124: #define mscp_buffer_h   un.gen.buf_h
 125: #define mscp_buffer_l   un.gen.buf_l
 126: #define mscp_lbn_h  un.gen.lbn_h
 127: #define mscp_lbn_l  un.gen.lbn_l
 128: #define mscp_status mscp_modifier
 129: #define mscp_endcode    mscp_opcode
 130: #define mscp_position   un.rep_em.position
 131: 
 132: /*
 133:  * Abort / Get Command Status packet
 134:  */
 135: 
 136: #define mscp_outref mscp_bytecnt
 137: 
 138: /*
 139:  * Set Controller Characteristics packet
 140:  */
 141: 
 142: #define mscp_version    un.scc.version
 143: #define mscp_cntflgs    un.scc.cntflgs
 144: #define mscp_hsttmo un.scc.hsttmo
 145: #define mscp_time   un.scc.time
 146: #define mscp_cntdep un.scc.cntdep
 147: 
 148: /*
 149:  * Reposition command packet fields
 150:  */
 151: 
 152: #define mscp_reccnt mscp_bytecnt    /* record/object count */
 153: #define mscp_tmkcnt mscp_buffer_l   /* tape mark count */
 154: 
 155: /*
 156:  * Get Unit Status end packet
 157:  */
 158: 
 159: #define mscp_multunt    un.gtu.multunt
 160: #define mscp_unitflgs   un.gtu.unitflgs
 161: #define mscp_hostid un.gtu.hostid
 162: #define mscp_unitid un.gtu.unitid
 163: #define mscp_mediaid    un.gtu.mediaid
 164: #define mscp_format un.gtu.format /* density:0=high */
 165: #define mscp_speed  un.gtu.speed  /* (ips*bpi)/1000 */
 166: #define mscp_fmtmenu    un.gtu.fmtmenu
 167: 
 168: /*
 169:  * Set Controller Characteristics end packet
 170:  */
 171: 
 172: #define mscp_cnttmo mscp_hsttmo /* controller timeout */
 173: #define mscp_cntcmdl    mscp_usefrac    /* controller soft & hardware version */
 174: #define mscp_cntid  mscp_unitid /* controller id */
 175: 
 176: /*
 177:  * MSCP Error Log packet
 178:  *
 179:  *	NOTE: MSCP packet must be padded to this size.
 180:  */
 181: 
 182: struct mslg {
 183:     struct  mscp_header mslg_header;/* device specific header */
 184:     long    mslg_cmdref;        /* command reference number */
 185:     short   mslg_unit;      /* unit number */
 186:     short   mslg_seqnum;        /* sequence number */
 187:     u_char  mslg_format;        /* format */
 188:     u_char  mslg_flags;     /* error log message flags */
 189:     short   mslg_event;     /* event code */
 190:     u_char  me_cntid[8];        /* controller id */
 191:     u_char  me_cntsvr;      /* controller software version */
 192:     u_char  me_cnthvr;      /* controller hardware version */
 193:     short   mslg_multunt;       /* multi-unit code */
 194:     u_long  me_unitid[2];       /* unit id */
 195:     u_char  me_unitsvr;     /* unit software version */
 196:     u_char  me_unithvr;     /* unit hardware version */
 197:     short   mslg_group;     /* group; retry + level */
 198:     long    mslg_position;      /* position (object count) */
 199:     u_char  me_fmtsvr;      /* formatter software version */
 200:     u_char  me_fmthvr;      /* formatter hardware version */
 201:     short   mslg_xxx2;      /* unused */
 202:     char    mslg_stiunsucc[62]; /* STI status information */
 203: };
 204: 
 205: #define mslg_busaddr    me_unitid.val[0]
 206: #define mslg_sdecyl mslg_group
 207: 
 208: /*
 209:  * These definitions were moved here where they could be included by
 210:  * both the main driver and the tape crash dump module.
 211: */
 212: 
 213: /*
 214:  * Per controller information structure.
 215:  */
 216: struct tmscp_softc {
 217:     struct  tmscpdevice *sc_addr;   /* controller CSR address */
 218:     short   sc_state;       /* state of controller */
 219:     short   sc_ivec;        /* interrupt vector address */
 220:     short   sc_unit;    /* CONTROLLER number - NOT drive unit # */
 221:     short   sc_credits;     /* transfer credits */
 222:     short   sc_lastcmd;     /* pointer into command ring */
 223:     short   sc_lastrsp;     /* pointer into response ring */
 224:     struct  buf sc_cmdbuf;  /* internal command buffer */
 225:     struct  buf sc_ctab;    /* controller queue */
 226:     struct  buf sc_wtab;    /* I/O wait queue for controller */
 227:     struct  tmscp *sc_com;  /* communications area pointer */
 228:     struct  tms_info *sc_drives[4]; /* pointers to per drive info */
 229: };
 230: 
 231: /*
 232:  * The TMSCP packet.  This is the same as MSCP except for the leading 't'
 233:  * in the structure member names.  Eventually the two drivers will use a
 234:  * single definition.
 235: */
 236: struct tmscp {
 237:     struct tmscpca  tmscp_ca;         /* communications area */
 238:     struct mscp tmscp_rsp[NRSP];  /* response packets */
 239:     struct mscp tmscp_cmd[NCMD];  /* command packets */
 240: };                    /* 1864 bytes per controller! */
 241: 
 242: /*
 243:  * Per drive information structure.
 244: */
 245: struct tms_info {
 246:     long        tms_type;   /* Drive type field  */
 247:     int     tms_resid;  /* residual from last xfer */
 248:     u_char      tms_endcode;    /* last command endcode */
 249:     u_char      tms_flags;  /* flags visible to user programs */
 250:     u_short     tms_status; /* Command status from last command */
 251:     u_short     Tflags;     /* Internal driver flags */
 252:     short       tms_fmtmenu;    /* the unit's format (density) menu */
 253:     short       tms_unitflgs;   /* unit flag parameters */
 254:     short       tms_format; /* unit's current format (density) */
 255:     long        tms_position;   /* Drive position */
 256:     struct  buf tms_dtab;   /* I/O tape drive queues */
 257: };
 258: 
 259: /* Bits in minor device */
 260: #define TMSUNIT(dev)    (minor(dev)&03)
 261: #define TMSCTLR(dev)    ((minor(dev) >> 6) & 3)
 262: #define TMSDENS(dev)    ((minor(dev) >> 3) & 3)
 263: #define FMTMASK     (M_TF_800|M_TF_PE|M_TF_GCR) /* = 7 */
 264: 
 265: #define T_NOREWIND  04

Defined struct's

mscp defined in line 63; used 72 times
mslg defined in line 182; used 4 times
tms_info defined in line 245; used 53 times
tmscp defined in line 236; used 23 times
tmscp_softc defined in line 216; used 64 times

Defined macros

FMTMASK defined in line 263; used 1 times
TMSCTLR defined in line 261; used 7 times
TMSDENS defined in line 262; used 1 times
TMSUNIT defined in line 260; used 8 times
T_NOREWIND defined in line 265; used 1 times
mscp_cntcmdl defined in line 173; never used
mscp_cntdep defined in line 146; used 1 times
mscp_cntflgs defined in line 143; used 2 times
mscp_cntid defined in line 174; never used
mscp_cnttmo defined in line 172; never used
mscp_endcode defined in line 129; used 3 times
mscp_fmtmenu defined in line 166; used 1 times
mscp_format defined in line 164; used 5 times
mscp_hostid defined in line 161; never used
mscp_hsttmo defined in line 144; used 2 times
mscp_mediaid defined in line 163; used 3 times
mscp_multunt defined in line 159; never used
mscp_outref defined in line 136; never used
mscp_position defined in line 130; used 5 times
mscp_reccnt defined in line 152; used 3 times
mscp_speed defined in line 165; never used
mscp_time defined in line 145; used 2 times
mscp_tmkcnt defined in line 153; used 3 times
mscp_unitflgs defined in line 160; used 5 times
mscp_unitid defined in line 162; used 1 times
mscp_version defined in line 142; used 1 times
mscp_zzz2 defined in line 122; used 1 times
mslg_busaddr defined in line 205; never used
mslg_sdecyl defined in line 206; never used

Usage of this include

Last modified: 1998-02-24
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3071
Valid CSS Valid XHTML 1.0 Strict