[BACK]Return to hdreg.h CVS log [TXT][DIR] Up to [local] / sys / arch / hp300 / dev

Annotation of sys/arch/hp300/dev/hdreg.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: hdreg.h,v 1.6 2007/05/25 20:32:29 krw Exp $   */
                      2: /*     $NetBSD: rdreg.h,v 1.7 1996/02/09 18:00:37 scottr Exp $ */
                      3:
                      4: /*
                      5:  * Copyright (c) 1988 University of Utah.
                      6:  * Copyright (c) 1982, 1990, 1993
                      7:  *     The Regents of the University of California.  All rights reserved.
                      8:  *
                      9:  * This code is derived from software contributed to Berkeley by
                     10:  * the Systems Programming Group of the University of Utah Computer
                     11:  * Science Department.
                     12:  *
                     13:  * Redistribution and use in source and binary forms, with or without
                     14:  * modification, are permitted provided that the following conditions
                     15:  * are met:
                     16:  * 1. Redistributions of source code must retain the above copyright
                     17:  *    notice, this list of conditions and the following disclaimer.
                     18:  * 2. Redistributions in binary form must reproduce the above copyright
                     19:  *    notice, this list of conditions and the following disclaimer in the
                     20:  *    documentation and/or other materials provided with the distribution.
                     21:  * 3. Neither the name of the University nor the names of its contributors
                     22:  *    may be used to endorse or promote products derived from this software
                     23:  *    without specific prior written permission.
                     24:  *
                     25:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     26:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     27:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     28:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     29:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     30:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     31:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     32:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     33:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     34:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     35:  * SUCH DAMAGE.
                     36:  *
                     37:  * from: Utah $Hdr: rdreg.h 1.2 90/10/12$
                     38:  *
                     39:  *     @(#)rdreg.h     8.1 (Berkeley) 6/10/93
                     40:  */
                     41:
                     42: struct hd_iocmd {
                     43:        char    c_pad;
                     44:        char    c_unit;
                     45:        char    c_volume;
                     46:        char    c_saddr;
                     47:        short   c_hiaddr;
                     48:        long    c_addr;
                     49:        char    c_nop2;
                     50:        char    c_slen;
                     51:        long    c_len;
                     52:        char    c_cmd;
                     53:        char    c_pad2;
                     54: };
                     55:
                     56: struct hd_rscmd {
                     57:        char    c_unit;
                     58:        char    c_sram;
                     59:        char    c_ram;
                     60:        char    c_cmd;
                     61: };
                     62:
                     63: struct hd_stat {
                     64:        char    c_vu;
                     65:        char    c_pend;
                     66:        short   c_ref;
                     67:        short   c_fef;
                     68:        short   c_aef;
                     69:        short   c_ief;
                     70:        union {
                     71:                char cu_raw[10];
                     72:                struct {
                     73:                        short   cu_msw;
                     74:                        long    cu_lsl;
                     75:                } cu_sva;
                     76:                struct {
                     77:                        long    cu_cyhd;
                     78:                        short   cu_sect;
                     79:                } cu_tva;
                     80:        } c_pf;
                     81: };
                     82: #define c_raw  c_pf.cu_raw
                     83: #define c_blk  c_pf.cu_sva.cu_lsl      /* for now */
                     84: #define c_tva  c_pf.cu_tva
                     85:
                     86: struct hd_ssmcmd {
                     87:        char    c_unit;
                     88:        char    c_cmd;
                     89:        short   c_refm;
                     90:        short   c_fefm;
                     91:        short   c_aefm;
                     92:        short   c_iefm;
                     93: };
                     94:
                     95: struct hd_srcmd {
                     96:        char    c_unit;
                     97:        char    c_nop;
                     98:        char    c_cmd;
                     99:        char    c_param;
                    100: };
                    101:
                    102: struct hd_clearcmd {
                    103:        char    c_unit;
                    104:        char    c_cmd;
                    105: };
                    106:
                    107: /* HW ids */
                    108: #define        HD7946AID       0x220   /* also 7945A */
                    109: #define        HD9134DID       0x221   /* also 9122S */
                    110: #define        HD9134LID       0x222   /* also 9122D */
                    111: #define        HD7912PID       0x209
                    112: #define HD7914CTID     0x20A
                    113: #define        HD7914PID       0x20B
                    114: #define        HD7958AID       0x22B
                    115: #define HD7957AID      0x22A
                    116: #define        HD7933HID       0x212
                    117: #define        HD7936HID       0x213   /* just guessing -- as of yet unknown */
                    118: #define        HD7937HID       0x214
                    119: #define HD7957BID      0x22C   /* another guess based on 7958B */
                    120: #define HD7958BID      0x22D
                    121: #define HD7959BID      0x22E   /* another guess based on 7958B */
                    122: #define HD2200AID      0x22F
                    123: #define HD2203AID      0x230   /* yet another guess */
                    124:
                    125: /* SW ids -- indices into hdidentinfo, order is arbitrary */
                    126: #define        HD7945A         0
                    127: #define        HD9134D         1
                    128: #define        HD9122S         2
                    129: #define        HD7912P         3
                    130: #define        HD7914P         4
                    131: #define        HD7958A         5
                    132: #define HD7957A                6
                    133: #define        HD7933H         7
                    134: #define        HD9134L         8
                    135: #define        HD7936H         9
                    136: #define        HD7937H         10
                    137: #define HD7914CT       11
                    138: #define HD7946A                12
                    139: #define HD9122D                13
                    140: #define HD7957B                14
                    141: #define HD7958B                15
                    142: #define HD7959B                16
                    143:
                    144: #define        NHD7945ABPT     16
                    145: #define        NHD7945ATRK     7
                    146: #define        NHD9134DBPT     16
                    147: #define        NHD9134DTRK     6
                    148: #define        NHD9122SBPT     8
                    149: #define        NHD9122STRK     2
                    150: #define        NHD7912PBPT     32
                    151: #define        NHD7912PTRK     7
                    152: #define        NHD7914PBPT     32
                    153: #define        NHD7914PTRK     7
                    154: #define        NHD7933HBPT     46
                    155: #define        NHD7933HTRK     13
                    156: #define        NHD9134LBPT     16
                    157: #define        NHD9134LTRK     5
                    158:
                    159: /*
                    160:  * Several HP drives have an odd number of 256 byte sectors per track.
                    161:  * This makes it rather difficult to break them into 512 and 1024 byte blocks.
                    162:  * So...we just do like HPUX and don't bother to respect hardware track/head
                    163:  * boundaries -- we just mold the disk so that we use the entire capacity.
                    164:  * HPUX also sometimes doen't abide by cylinder boundaries, we attempt to
                    165:  * whenever possible.
                    166:  *
                    167:  * DISK                REAL (256 BPS)          HPUX (1024 BPS)         BSD (512 BPS)
                    168:  *             SPT x HD x CYL          SPT x HD x CYL          SPT x HD x CYL
                    169:  * -----       ---------------         ---------------         --------------
                    170:  * 7936:       123 x  7 x 1396          25 x  7 x 1716         123 x  7 x  698
                    171:  * 7937:       123 x 13 x 1396          25 x 16 x 1395         123 x 13 x  698
                    172:  *
                    173:  * 7957A:       63 x  5 x 1013          11 x  7 x 1036          22 x  7 x 1036
                    174:  * 7958A:       63 x  8 x 1013          21 x  6 x 1013          36 x  7 x 1013
                    175:  *
                    176:  * 7957B:       63 x  4 x 1269           9 x  7 x 1269          18 x  7 x 1269
                    177:  * 7958B:       63 x  6 x 1572          21 x  9 x  786          42 x  9 x  786
                    178:  * 7959B:       63 x 12 x 1572          21 x  9 x 1572          42 x  9 x 1572
                    179:  *
                    180:  * 2200A:      113 x  8 x 1449         113 x  2 x 1449         113 x  4 x 1449
                    181:  * 2203A:      113 x 16 x 1449         113 x  4 x 1449         113 x  8 x 1449
                    182:  */
                    183: #define        NHD7936HBPT     123
                    184: #define        NHD7936HTRK     7
                    185: #define        NHD7937HBPT     123
                    186: #define        NHD7937HTRK     13
                    187: #define        NHD7957ABPT     22
                    188: #define        NHD7957ATRK     7
                    189: #define        NHD7958ABPT     36
                    190: #define        NHD7958ATRK     7
                    191: #define        NHD7957BBPT     18
                    192: #define        NHD7957BTRK     7
                    193: #define        NHD7958BBPT     42
                    194: #define        NHD7958BTRK     9
                    195: #define        NHD7959BBPT     42
                    196: #define        NHD7959BTRK     9
                    197: #define        NHD2200ABPT     113
                    198: #define        NHD2200ATRK     4
                    199: #define        NHD2203ABPT     113
                    200: #define        NHD2203ATRK     8
                    201:
                    202: /* controller "unit" number */
                    203: #define        HDCTLR          15
                    204:
                    205: /* convert 512 byte count into DEV_BSIZE count */
                    206: #define HDSZ(x)                ((x) >> (DEV_BSHIFT-9))
                    207:
                    208: /* convert block number into sector number and back */
                    209: #define        HDBTOS(x)       ((x) << (DEV_BSHIFT-8))
                    210: #define HDSTOB(x)      ((x) >> (DEV_BSHIFT-8))
                    211:
                    212: /* extract cyl/head/sect info from three-vector address */
                    213: #define HDCYL(tva)     ((u_long)(tva).cu_cyhd >> 8)
                    214: #define HDHEAD(tva)    ((tva).cu_cyhd & 0xFF)
                    215: #define HDSECT(tva)    ((tva).cu_sect)
                    216:
                    217: #define        REF_MASK        0x0
                    218: #define        FEF_MASK        0x0
                    219: #define        AEF_MASK        0x0
                    220: #define        IEF_MASK        0xF970
                    221:
                    222: #define FEF_CU         0x4000  /* cross-unit */
                    223: #define FEF_DR         0x0080  /* diagnostic result */
                    224: #define FEF_IMR                0x0008  /* internal maintenance release */
                    225: #define        FEF_PF          0x0002  /* power fail */
                    226: #define        FEF_REXMT       0x0001  /* retransmit */
                    227: #define AEF_UD         0x0040  /* unrecoverable data */
                    228: #define IEF_RRMASK     0xe000  /* request release bits */
                    229: #define IEF_MD         0x0020  /* marginal data */
                    230: #define IEF_RD         0x0010  /* recoverable data */
                    231:
                    232: #define        C_READ          0x00
                    233: #define        C_RAM           0x00    /* single vector (i.e. sector number) */
                    234: #define        C_WRITE         0x02
                    235: #define        C_CLEAR         0x08
                    236: #define        C_STATUS        0x0d
                    237: #define        C_SADDR         0x10
                    238: #define        C_SLEN          0x18
                    239: #define        C_SUNIT(x)      (0x20 | (x))
                    240: #define C_SVOL(x)      (0x40 | (x))
                    241: #define        C_NOP           0x34
                    242: #define C_DESC         0x35
                    243: #define        C_SREL          0x3b
                    244: #define        C_SSM           0x3e
                    245: #define        C_SRAM          0x48
                    246: #define C_REL          0xc0
                    247:
                    248: #define        C_CMD           0x05
                    249: #define        C_EXEC          0x0e
                    250: #define        C_QSTAT         0x10
                    251: #define        C_TCMD          0x12

CVSweb