# 2.11BSD#431 - /usr/src/sys/pdp/tmscp.h

##### Macros

    FMTMASK           X
    TMSCTLR           X
    TMSDENS           X
    TMSUNIT           X
    T_NOREWIND        X
    mscp_buffer_h     X
    mscp_buffer_l     X
    mscp_bytecnt      X
    mscp_cntcmdl      X
    mscp_cntdep       X
    mscp_cntflgs      X
    mscp_cntid        X
    mscp_cnttmo       X
    mscp_endcode      X
    mscp_fmtmenu      X
    mscp_format       X
    mscp_hostid       X
    mscp_hsttmo       X
    mscp_lbn_h        X
    mscp_lbn_l        X
    mscp_mediaid      X
    mscp_multunt      X
    mscp_outref       X
    mscp_position     X
    mscp_reccnt       X
    mscp_speed        X
    mscp_status       X
    mscp_time         X
    mscp_tmkcnt       X
    mscp_unitflgs     X
    mscp_unitid       X
    mscp_version      X
    mscp_zzz2         X
    mslg_busaddr      X
    mslg_sdecyl       X

##### struct's

    mscp              X
    mslg              X
    tms_info          X
    tmscp             X
    tmscp_softc       X

       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

- in line 238-239(4)
- in /usr/src/sys/pdpstand/tmscp.c line 194(2), 275(2)
- in /usr/src/sys/pdpuba/tmscp.c line 363(2), 460(2), 625(2), 863(2), 880-887(6), 894-898(4), 974(2), 1191(2), 1197(2), 1510(2), 1544(2), 1568(2), 1587(2), 1600(2), 1617(2), 1632(2), 1653(2), 1682(2), 1706(2), 1723(2), 1739(2), 1756(2), 1799(2), 1824(2), 1853(2)
- in /usr/src/sys/pdpuba/tmscpdump.c line 39(2), 126(2), 135-136(4)

mslg defined in line 182; used 4 times

- in /usr/src/sys/pdpuba/tmscp.c line 1208(2), 2001(2)

tms_info defined in line 245; used 53 times

- in line 228
- in /usr/src/sys/pdpuba/tmscp.c line 285(2), 406-409(4), 624(2), 759(2), 976(2), 1192(2), 1340(2), 1409(2), 1486(2), 1514(2), 1549(2), 1573(2), 1591(2), 1599(2), 1621(2), 1631(2), 1656(2), 1685(2), 1709(2), 1726(2), 1742(2), 1759(2), 1803(2), 1827(2), 1856(2)

tmscp defined in line 236; used 23 times

- in line 227
- in /usr/src/sys/pdpstand/tmscp.c line 69(2), 88(2), 175(2), 193(2), 215-217(4), 274(2), 300(2)
- in /usr/src/sys/pdpuba/tmscp.c line 395-400(4), 459(2)

tmscp_softc defined in line 216; used 64 times

- in /usr/src/sys/pdpuba/tmscp.c line 284(2), 370(2), 390(2), 432(2), 458(2), 623(2), 758(2), 861(2), 896(2), 936(2), 972(2), 1188(2), 1339(2), 1407(2), 1511(2), 1545(2), 1569(2), 1588(2), 1618(2), 1630(2), 1654(2), 1683(2), 1707(2), 1724(2), 1740(2), 1757(2), 1800(2), 1825(2), 1854(2)
- in /usr/src/sys/pdpuba/tmscpdump.c line 32(2), 38(2), 123(2)

#### Defined macros

FMTMASK defined in line 263; used 1 times

- in /usr/src/sys/pdpuba/tmscp.c line 1102

TMSCTLR defined in line 261; used 7 times

- in /usr/src/sys/pdpuba/tmscp.c line 622, 762, 779, 811, 1341, 1407
- in /usr/src/sys/pdpuba/tmscpdump.c line 42

TMSDENS defined in line 262; used 1 times

- in /usr/src/sys/pdpuba/tmscp.c line 1102

TMSUNIT defined in line 260; used 8 times

- in /usr/src/sys/pdpuba/tmscp.c line 621, 760, 809, 1002, 1027, 1345, 1409
- in /usr/src/sys/pdpuba/tmscpdump.c line 42

T_NOREWIND defined in line 265; used 1 times

- in /usr/src/sys/pdpuba/tmscp.c line 786

mscp_buffer_h defined in line 124; used 6 times

- in /usr/src/sys/pdpstand/tmscp.c line 161, 178, 284, 313
- in /usr/src/sys/pdpuba/tmscp.c line 1117
- in /usr/src/sys/pdpuba/tmscpdump.c line 107

mscp_buffer_l defined in line 125; used 6 times

- in line 153
- in /usr/src/sys/pdpstand/tmscp.c line 177, 283, 312
- in /usr/src/sys/pdpuba/tmscp.c line 1116
- in /usr/src/sys/pdpuba/tmscpdump.c line 106

mscp_bytecnt defined in line 123; used 8 times

- in line 136, 152
- in /usr/src/sys/pdpstand/tmscp.c line 162, 179, 281
- in /usr/src/sys/pdpuba/tmscp.c line 1115, 1815
- in /usr/src/sys/pdpuba/tmscpdump.c line 105

mscp_cntcmdl defined in line 173; never used
mscp_cntdep defined in line 146; used 1 times

- in /usr/src/sys/pdpuba/tmscp.c line 539

mscp_cntflgs defined in line 143; used 2 times

- in /usr/src/sys/pdpstand/tmscp.c line 211
- in /usr/src/sys/pdpuba/tmscp.c line 532

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

- in /usr/src/sys/pdpuba/tmscp.c line 1218, 1861, 1869

mscp_fmtmenu defined in line 166; used 1 times

- in /usr/src/sys/pdpuba/tmscp.c line 1768

mscp_format defined in line 164; used 5 times

- in /usr/src/sys/pdpuba/tmscp.c line 1256, 1532-1534(2), 1693, 1766

mscp_hostid defined in line 161; never used
mscp_hsttmo defined in line 144; used 2 times

- in line 172
- in /usr/src/sys/pdpuba/tmscp.c line 537

mscp_lbn_h defined in line 126; used 2 times

- in /usr/src/sys/pdpstand/tmscp.c line 279
- in /usr/src/sys/pdpuba/tmscpdump.c line 104

mscp_lbn_l defined in line 127; used 2 times

- in /usr/src/sys/pdpstand/tmscp.c line 278
- in /usr/src/sys/pdpuba/tmscpdump.c line 103

mscp_mediaid defined in line 163; used 3 times

- in /usr/src/sys/pdpuba/tmscp.c line 1254, 1694, 1767

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

- in /usr/src/sys/pdpuba/tmscp.c line 1662-1664(2), 1715, 1749, 1816

mscp_reccnt defined in line 152; used 3 times

- in /usr/src/sys/pdpstand/tmscp.c line 315
- in /usr/src/sys/pdpuba/tmscp.c line 1556, 1578

mscp_speed defined in line 165; never used
mscp_status defined in line 128; used 16 times

- in /usr/src/sys/pdpstand/tmscp.c line 248, 254-259(2)
- in /usr/src/sys/pdpuba/tmscp.c line 1215-1217(2), 1657, 1686, 1710, 1743, 1760, 1804, 1858-1859(2), 1878
- in /usr/src/sys/pdpuba/tmscpdump.c line 151-154(2)

mscp_time defined in line 145; used 2 times

- in /usr/src/sys/pdpuba/tmscp.c line 538(2)

mscp_tmkcnt defined in line 153; used 3 times

- in /usr/src/sys/pdpstand/tmscp.c line 160-164(2)
- in /usr/src/sys/pdpuba/tmscp.c line 1558

mscp_unitflgs defined in line 160; used 5 times

- in /usr/src/sys/pdpuba/tmscp.c line 1255, 1524, 1692, 1761, 1769

mscp_unitid defined in line 162; used 1 times

- in line 174

mscp_version defined in line 142; used 1 times

- in /usr/src/sys/pdpuba/tmscp.c line 531

mscp_zzz2 defined in line 122; used 1 times

- in /usr/src/sys/pdpstand/tmscp.c line 219

mslg_busaddr defined in line 205; never used
mslg_sdecyl defined in line 206; never used

#### Usage of this include

tmscp.h used 3 times

- in /usr/src/sys/pdpstand/tmscp.c line 58
- in /usr/src/sys/pdpuba/tmscp.c line 266
- in /usr/src/sys/pdpuba/tmscpdump.c line 21

Last modified: 1998-02-24 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 837 |