[BACK]Return to mscpreg.h CVS log [TXT][DIR] Up to [local] / sys / arch / vax / mscp

Annotation of sys/arch/vax/mscp/mscpreg.h, Revision 1.1

1.1     ! nbrk        1: /*     $OpenBSD: mscpreg.h,v 1.5 2003/06/02 23:27:57 millert Exp $     */
        !             2: /*     $NetBSD: mscpreg.h,v 1.4 1999/05/29 19:12:53 ragge Exp $        */
        !             3: /*
        !             4:  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
        !             5:  * Copyright (c) 1988 Regents of the University of California.
        !             6:  * All rights reserved.
        !             7:  *
        !             8:  * This code is derived from software contributed to Berkeley by
        !             9:  * Chris Torek.
        !            10:  *
        !            11:  * Redistribution and use in source and binary forms, with or without
        !            12:  * modification, are permitted provided that the following conditions
        !            13:  * are met:
        !            14:  * 1. Redistributions of source code must retain the above copyright
        !            15:  *    notice, this list of conditions and the following disclaimer.
        !            16:  * 2. Redistributions in binary form must reproduce the above copyright
        !            17:  *    notice, this list of conditions and the following disclaimer in the
        !            18:  *    documentation and/or other materials provided with the distribution.
        !            19:  * 3. Neither the name of the University nor the names of its contributors
        !            20:  *    may be used to endorse or promote products derived from this software
        !            21:  *    without specific prior written permission.
        !            22:  *
        !            23:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
        !            24:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            25:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            26:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
        !            27:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            28:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            29:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            30:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            31:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            32:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            33:  * SUCH DAMAGE.
        !            34:  *
        !            35:  *     @(#)udareg.h    7.3 (Berkeley) 5/8/91
        !            36:  */
        !            37:
        !            38: /*
        !            39:  * NRSPL2 and NCMDL2 control the number of response and command
        !            40:  * packets respectively.  They may be any value from 0 to 7, though
        !            41:  * setting them higher than 5 is unlikely to be of any value.
        !            42:  * If you get warnings about your command ring being too small,
        !            43:  * try increasing the values by one.
        !            44:  */
        !            45: #ifndef NRSP
        !            46: #define NRSPL2 5
        !            47: #define NCMDL2 5
        !            48: #define NRSP   (1 << NRSPL2)
        !            49: #define NCMD   (1 << NCMDL2)
        !            50: #endif
        !            51:
        !            52: /*
        !            53:  * Communication area definition. This seems to be the same for
        !            54:  * all types of MSCP controllers.
        !            55:  */
        !            56:
        !            57: struct mscp_ca {
        !            58:        short   ca_xxx1;        /* unused */
        !            59:        char    ca_xxx2;        /* unused */
        !            60:        char    ca_bdp;         /* BDP to purge */
        !            61:        short   ca_cmdint;      /* command ring transition flag */
        !            62:        short   ca_rspint;      /* response ring transition flag */
        !            63:        long    ca_rspdsc[NRSP];/* response descriptors */
        !            64:        long    ca_cmddsc[NCMD];/* command descriptors */
        !            65: };
        !            66:
        !            67: /*
        !            68:  * Simplified routines (e.g., uddump) reprogram the UDA50 for one command
        !            69:  * and one response at a time; uda1ca is like udaca except that it provides
        !            70:  * exactly one command and response descriptor.
        !            71:  */
        !            72: struct mscp_1ca {
        !            73:        short   ca_xxx1;
        !            74:        char    ca_xxx2;
        !            75:        char    ca_bdp;
        !            76:        short   ca_cmdint;
        !            77:        short   ca_rspint;
        !            78:        long    ca_rspdsc;
        !            79:        long    ca_cmddsc;
        !            80: };
        !            81:
        !            82: /*
        !            83:  * Combined communications area and MSCP packet pools, per controller.
        !            84:  * NRSP and NCMD must be defined before this struct is used.
        !            85:  */
        !            86:
        !            87: struct mscp_pack {
        !            88:        struct  mscp_ca mp_ca;          /* communications area */
        !            89:        struct  mscp mp_rsp[NRSP];      /* response packets */
        !            90:        struct  mscp mp_cmd[NCMD];      /* command packets */
        !            91: };
        !            92:
        !            93: /*
        !            94:  * Bits in UDA status register during initialisation
        !            95:  */
        !            96: #define MP_ERR         0x8000  /* error */
        !            97: #define MP_STEP4       0x4000  /* step 4 has started */
        !            98: #define MP_STEP3       0x2000  /* step 3 has started */
        !            99: #define MP_STEP2       0x1000  /* step 2 has started */
        !           100: #define MP_STEP1       0x0800  /* step 1 has started */
        !           101: #define MP_NV          0x0400  /* no host settable interrupt vector */
        !           102: #define MP_QB          0x0200  /* controller supports Q22 bus */
        !           103: #define MP_DI          0x0100  /* controller implements diagnostics */
        !           104: #define MP_IE          0x0080  /* interrupt enable */
        !           105: #define MP_NCNRMASK    0x003f  /* in STEP1, bits 0-2=NCMDL2, 3-5=NRSPL2 */
        !           106: #define MP_IVECMASK    0x007f  /* in STEP2, bits 0-6 are interruptvec / 4 */
        !           107: #define MP_PI          0x0001  /* host requests adapter purge interrupts */
        !           108: #define MP_GO          0x0001  /* Go command to ctlr */
        !           109:
        !           110: #define ALLSTEPS       (MP_ERR | MP_STEP4 | MP_STEP3 | MP_STEP2 | MP_STEP1)
        !           111:
        !           112: #define STEP0MASK      (ALLSTEPS | MP_NV)
        !           113:
        !           114: #define STEP1MASK      (ALLSTEPS | MP_IE | MP_NCNRMASK)
        !           115: #define STEP1GOOD      (MP_STEP2 | MP_IE | (NCMDL2 << 3) | NRSPL2)
        !           116:
        !           117: #define STEP2MASK      (ALLSTEPS | MP_IE | MP_IVECMASK)
        !           118: #define STEP2GOOD(iv)  (MP_STEP3 | MP_IE | (iv))
        !           119:
        !           120: #define STEP3MASK      ALLSTEPS
        !           121: #define STEP3GOOD      MP_STEP4
        !           122:

CVSweb