Annotation of 43BSDReno/sys/hpdev/rdreg.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1988 University of Utah.
        !             3:  * Copyright (c) 1982, 1990 The Regents of the University of California.
        !             4:  * All rights reserved.
        !             5:  *
        !             6:  * This code is derived from software contributed to Berkeley by
        !             7:  * the Systems Programming Group of the University of Utah Computer
        !             8:  * Science Department.
        !             9:  *
        !            10:  * Redistribution is only permitted until one year after the first shipment
        !            11:  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
        !            12:  * binary forms are permitted provided that: (1) source distributions retain
        !            13:  * this entire copyright notice and comment, and (2) distributions including
        !            14:  * binaries display the following acknowledgement:  This product includes
        !            15:  * software developed by the University of California, Berkeley and its
        !            16:  * contributors'' in the documentation or other materials provided with the
        !            17:  * distribution and in all advertising materials mentioning features or use
        !            18:  * of this software.  Neither the name of the University nor the names of
        !            19:  * its contributors may be used to endorse or promote products derived from
        !            20:  * this software without specific prior written permission.
        !            21:  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
        !            22:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
        !            23:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            24:  *
        !            25:  * from: Utah $Hdr: rdreg.h 1.14 89/02/27$
        !            26:  *
        !            27:  *     @(#)rdreg.h     7.1 (Berkeley) 5/8/90
        !            28:  */
        !            29: 
        !            30: struct rd_iocmd {
        !            31:        char    c_pad;
        !            32:        char    c_unit;
        !            33:        char    c_volume;
        !            34:        char    c_saddr;
        !            35:        short   c_hiaddr;
        !            36:        long    c_addr;
        !            37:        char    c_nop2;
        !            38:        char    c_slen;
        !            39:        long    c_len;
        !            40:        char    c_cmd;
        !            41:        char    c_pad2;
        !            42: };
        !            43: 
        !            44: struct rd_rscmd {
        !            45:        char    c_unit;
        !            46:        char    c_sram;
        !            47:        char    c_ram;
        !            48:        char    c_cmd;
        !            49: };
        !            50: 
        !            51: struct rd_stat {
        !            52:        char    c_vu;
        !            53:        char    c_pend;
        !            54:        short   c_ref;
        !            55:        short   c_fef;
        !            56:        short   c_aef;
        !            57:        short   c_ief;
        !            58:        union {
        !            59:                char cu_raw[10];
        !            60:                struct {
        !            61:                        short   cu_msw;
        !            62:                        long    cu_lsl;
        !            63:                } cu_sva;
        !            64:                struct {
        !            65:                        long    cu_cyhd;
        !            66:                        short   cu_sect;
        !            67:                } cu_tva;
        !            68:        } c_pf;
        !            69: };
        !            70: #define c_raw  c_pf.cu_raw
        !            71: #define c_blk  c_pf.cu_sva.cu_lsl      /* for now */
        !            72: #define c_tva  c_pf.cu_tva
        !            73: 
        !            74: struct rd_ssmcmd {
        !            75:        char    c_unit;
        !            76:        char    c_cmd;
        !            77:        short   c_refm;
        !            78:        short   c_fefm;
        !            79:        short   c_aefm;
        !            80:        short   c_iefm;
        !            81: };
        !            82: 
        !            83: struct rd_srcmd {
        !            84:        char    c_unit;
        !            85:        char    c_nop;
        !            86:        char    c_cmd;
        !            87:        char    c_param;
        !            88: };
        !            89: 
        !            90: struct rd_clearcmd {
        !            91:        char    c_unit;
        !            92:        char    c_cmd;
        !            93: };
        !            94: 
        !            95: struct rd_describe {
        !            96:        u_int   d_iuw:16,       /* controller: installed unit word */
        !            97:                d_cmaxxfr:16,   /* controller: max transfer rate (Kb) */
        !            98:                d_ctype:8,      /* controller: controller type */
        !            99:                d_utype:8,      /* unit: unit type */
        !           100:                d_name:24,      /* unit: name (6 BCD digits) */
        !           101:                d_sectsize:16,  /* unit: # of bytes per block (sector) */
        !           102:                d_blkbuf:8,     /* unit: # of blocks which can be buffered */
        !           103:                d_burstsize:8,  /* unit: recommended burst size */
        !           104:                d_blocktime:16, /* unit: block time (u-sec) */
        !           105:                d_uavexfr:16,   /* unit: average transfer rate (Kb) */
        !           106:                d_retry:16,     /* unit: optimal retry time (1/100-sec) */
        !           107:                d_access:16,    /* unit: access time param (1/100-sec) */
        !           108:                d_maxint:8,     /* unit: maximum interleave */
        !           109:                d_fvbyte:8,     /* unit: fixed volume byte */
        !           110:                d_rvbyte:8,     /* unit: removeable volume byte */
        !           111:                d_maxcyl:24,    /* volume: maximum cylinder */
        !           112:                d_maxhead:8,    /* volume: maximum head */
        !           113:                d_maxsect:16,   /* volume: maximum sector on track */
        !           114:                d_maxvsecth:16, /* volume: maximum sector on volume (MSW) */
        !           115:                d_maxvsectl:32, /* volume: maximum sector on volume (LSWs) */
        !           116:                d_interleave:8; /* volume: current interleave */
        !           117:  };
        !           118: 
        !           119: /* indicies into rdinfo -- order is arbitrary */
        !           120: #define        RD7945A         0
        !           121: #define        RD9134D         1
        !           122: #define        RD9122S         2
        !           123: #define        RD7912P         3
        !           124: #define        RD7914P         4
        !           125: #define        RD7958A         5
        !           126: #define RD7957A                6
        !           127: #define        RD7933H         7
        !           128: #define        RD9134L         8
        !           129: #define        RD7936H         9
        !           130: #define        RD7937H         10
        !           131: #define RD7914CT       11
        !           132: #define RD7946A                12
        !           133: #define RD9122D                13
        !           134: #define RD7957B                14
        !           135: #define RD7958B                15
        !           136: #define RD7959B                16
        !           137: 
        !           138: /* HW ids */
        !           139: #define        RD7946AID       0x220   /* also 7945A */
        !           140: #define        RD9134DID       0x221   /* also 9122S */
        !           141: #define        RD9134LID       0x222   /* also 9122D */
        !           142: #define        RD7912PID       0x209
        !           143: #define RD7914CTID     0x20A
        !           144: #define        RD7914PID       0x20B
        !           145: #define        RD7958AID       0x22B
        !           146: #define RD7957AID      0x22A
        !           147: #define        RD7933HID       0x212
        !           148: #define        RD7936HID       0x213   /* just guessing -- as of yet unknown */
        !           149: #define        RD7937HID       0x214
        !           150: #define RD7957BID      0x22C   /* another guess based on 7958B */
        !           151: #define RD7958BID      0x22D
        !           152: #define RD7959BID      0x22E   /* another guess based on 7958B */
        !           153: 
        !           154: #define        NRD7945ABPT     (32 >> (DEV_BSHIFT-8))
        !           155: #define        NRD7945ATRK     7
        !           156: #define        NRD9134DBPT     (32 >> (DEV_BSHIFT-8))
        !           157: #define        NRD9134DTRK     6
        !           158: #define        NRD9122SBPT     (16 >> (DEV_BSHIFT-8))
        !           159: #define        NRD9122STRK     2
        !           160: #define        NRD7912PBPT     (64 >> (DEV_BSHIFT-8))
        !           161: #define        NRD7912PTRK     7
        !           162: #define        NRD7914PBPT     (64 >> (DEV_BSHIFT-8))
        !           163: #define        NRD7914PTRK     7
        !           164: #define        NRD7933HBPT     (92 >> (DEV_BSHIFT-8))
        !           165: #define        NRD7933HTRK     13
        !           166: #define        NRD9134LBPT     (32 >> (DEV_BSHIFT-8))
        !           167: #define        NRD9134LTRK     5
        !           168: 
        !           169: /*
        !           170:  * Several HP drives have an odd number of 256 byte sectors per track.
        !           171:  * This makes it rather difficult to break them into 512 and 1024 byte blocks.
        !           172:  * So...we just do like HPUX and don't bother to respect hardware track/head
        !           173:  * boundries -- we just mold the disk so that we use the entire capacity.
        !           174:  * HPUX also sometimes doen't abide by cylinder boundries, we attempt to
        !           175:  * whenever possible.
        !           176:  *
        !           177:  * DISK                REAL (256 BPS)          HPUX (1024 BPS)         BSD (512 BPS)
        !           178:  *             SPT x HD x CYL          SPT x HD x CYL          SPT x HD x CYL
        !           179:  * -----       ---------------         ---------------         --------------
        !           180:  * 7936:       123 x  7 x 1396         25 x  7 x 1716          123 x  7 x  698
        !           181:  * 7937:       123 x 13 x 1396         25 x 16 x 1395          123 x 13 x  698
        !           182:  *
        !           183:  * 7957A:       63 x  5 x 1013         11 x  7 x 1036           22 x  7 x 1036
        !           184:  * 7958A:       63 x  8 x 1013         21 x  6 x 1013           36 x  7 x 1013
        !           185:  *
        !           186:  * 7957B:       63 x  4 x 1269          9 x  7 x 1269           18 x  7 x 1269
        !           187:  * 7958B:       63 x  6 x 1572         21 x  9 x  786           42 x  9 x  786
        !           188:  * 7959B:       63 x 12 x 1572         21 x  9 x 1572           42 x  9 x 1572
        !           189:  */
        !           190: #if DEV_BSIZE == 512
        !           191: #      define  NRD7936HBPT     123
        !           192: #      define  NRD7936HTRK     7
        !           193: #      define  NRD7937HBPT     123
        !           194: #      define  NRD7937HTRK     13
        !           195: #      define  NRD7957ABPT     22
        !           196: #      define  NRD7957ATRK     7
        !           197: #      define  NRD7958ABPT     36
        !           198: #      define  NRD7958ATRK     7
        !           199: #      define  NRD7957BBPT     18
        !           200: #      define  NRD7957BTRK     7
        !           201: #      define  NRD7958BBPT     42
        !           202: #      define  NRD7958BTRK     9
        !           203: #      define  NRD7959BBPT     42
        !           204: #      define  NRD7959BTRK     9
        !           205: #endif
        !           206: #if DEV_BSIZE == 1024
        !           207: #      define  NRD7957ABPT     11
        !           208: #      define  NRD7957ATRK     7
        !           209: #      define  NRD7958ABPT     21
        !           210: #      define  NRD7958ATRK     6
        !           211: #      define  NRD7957BBPT     9
        !           212: #      define  NRD7957BTRK     7
        !           213: #      define  NRD7958BBPT     21
        !           214: #      define  NRD7958BTRK     9
        !           215: #      define  NRD7959BBPT     21
        !           216: #      define  NRD7959BTRK     9
        !           217: #endif
        !           218: 
        !           219: /* controller "unit" number */
        !           220: #define        RDCTLR          15
        !           221: 
        !           222: /* convert 512 byte count into DEV_BSIZE count */
        !           223: #define RDSZ(x)                ((x) >> (DEV_BSHIFT-9))
        !           224: 
        !           225: /* convert block number into sector number and back */
        !           226: #define        RDBTOS(x)       ((x) << (DEV_BSHIFT-8))
        !           227: #define RDSTOB(x)      ((x) >> (DEV_BSHIFT-8))
        !           228: 
        !           229: /* extract cyl/head/sect info from three-vector address */
        !           230: #define RDCYL(tva)     ((u_long)(tva).cu_cyhd >> 8)
        !           231: #define RDHEAD(tva)    ((tva).cu_cyhd & 0xFF)
        !           232: #define RDSECT(tva)    ((tva).cu_sect)
        !           233: 
        !           234: #define        REF_MASK        0x0
        !           235: #define        FEF_MASK        0x0
        !           236: #define        AEF_MASK        0x0
        !           237: #define        IEF_MASK        0xF970
        !           238: 
        !           239: #define FEF_CU         0x4000  /* cross-unit */
        !           240: #define FEF_DR         0x0080  /* diagnostic result */
        !           241: #define FEF_IMR                0x0008  /* internal maintenance release */
        !           242: #define        FEF_PF          0x0002  /* power fail */
        !           243: #define        FEF_REXMT       0x0001  /* retransmit */
        !           244: #define AEF_UD         0x0040  /* unrecoverable data */
        !           245: #define IEF_RRMASK     0xe000  /* request release bits */
        !           246: #define IEF_MD         0x0020  /* marginal data */
        !           247: #define IEF_RD         0x0010  /* recoverable data */
        !           248: 
        !           249: #define        C_READ          0x00
        !           250: #define        C_RAM           0x00    /* single vector (i.e. sector number) */
        !           251: #define        C_WRITE         0x02
        !           252: #define        C_CLEAR         0x08
        !           253: #define        C_STATUS        0x0d
        !           254: #define        C_SADDR         0x10
        !           255: #define        C_SLEN          0x18
        !           256: #define        C_SUNIT(x)      (0x20 | (x))
        !           257: #define C_SVOL(x)      (0x40 | (x))
        !           258: #define        C_NOP           0x34
        !           259: #define C_DESC         0x35
        !           260: #define        C_SREL          0x3b
        !           261: #define        C_SSM           0x3e
        !           262: #define        C_SRAM          0x48
        !           263: #define        C_REL           0x140
        !           264: 
        !           265: #define        C_CMD           0x05
        !           266: #define        C_EXEC          0x0e
        !           267: #define        C_QSTAT         0x10
        !           268: #define        C_TCMD          0x12

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.