Annotation of Net2/arch/amiga/dev/device.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1982, 1990 The Regents of the University of California.
        !             3:  * All rights reserved.
        !             4:  *
        !             5:  * Redistribution and use in source and binary forms, with or without
        !             6:  * modification, are permitted provided that the following conditions
        !             7:  * are met:
        !             8:  * 1. Redistributions of source code must retain the above copyright
        !             9:  *    notice, this list of conditions and the following disclaimer.
        !            10:  * 2. Redistributions in binary form must reproduce the above copyright
        !            11:  *    notice, this list of conditions and the following disclaimer in the
        !            12:  *    documentation and/or other materials provided with the distribution.
        !            13:  * 3. All advertising materials mentioning features or use of this software
        !            14:  *    must display the following acknowledgement:
        !            15:  *     This product includes software developed by the University of
        !            16:  *     California, Berkeley and its contributors.
        !            17:  * 4. Neither the name of the University nor the names of its contributors
        !            18:  *    may be used to endorse or promote products derived from this software
        !            19:  *    without specific prior written permission.
        !            20:  *
        !            21:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
        !            22:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            23:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            24:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
        !            25:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            26:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            27:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            28:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            29:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            30:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            31:  * SUCH DAMAGE.
        !            32:  *
        !            33:  *     @(#)device.h    7.3 (Berkeley) 5/7/91
        !            34:  */
        !            35: 
        !            36: struct driver {
        !            37:        int     (*d_init)       (void *);       /* amiga_device or amiga_ctrl */
        !            38:        char    *d_name;
        !            39:        int     (*d_start)      (int unit);
        !            40:        int     (*d_go)         (int unit, ...);
        !            41:        int     (*d_intr)       (int unit, int stat);
        !            42:        int     (*d_done)       (int unit);
        !            43: };
        !            44: 
        !            45: struct amiga_ctlr {
        !            46:        struct driver   *amiga_driver;
        !            47:        int             amiga_unit;
        !            48:        int             amiga_alive;
        !            49:        char            *amiga_addr;
        !            50:        int             amiga_flags;
        !            51:        int             amiga_ipl;
        !            52: };
        !            53: 
        !            54: struct amiga_device {
        !            55:        struct driver   *amiga_driver;
        !            56:        struct driver   *amiga_cdriver;
        !            57:        int             amiga_unit;
        !            58:        int             amiga_ctlr;
        !            59:        int             amiga_slave;
        !            60:        char            *amiga_addr;
        !            61:        int             amiga_dk;
        !            62:        int             amiga_flags;
        !            63:        int             amiga_alive;
        !            64:        int             amiga_ipl;
        !            65: };
        !            66: 
        !            67: struct devqueue {
        !            68:        struct  devqueue *dq_forw;
        !            69:        struct  devqueue *dq_back;
        !            70:        int     dq_ctlr;
        !            71:        int     dq_unit;
        !            72:        int     dq_slave;
        !            73:        struct  driver *dq_driver;
        !            74: };
        !            75: 
        !            76: #define        MAXCTLRS        16      /* Size of HW table (arbitrary) */
        !            77: #define        MAXSLAVES       8       /* Slaves per controller (SCSI limit) */
        !            78: 
        !            79: struct amiga_hw {
        !            80:        caddr_t hw_pa;          /* physical address of control space */
        !            81:        int     hw_size;        /* size of control space */
        !            82:        caddr_t hw_kva;         /* kernel virtual address of control space */
        !            83:        int     hw_manufacturer;
        !            84:        int     hw_product;     /* autoconfig� parameters */
        !            85:        int     hw_type;
        !            86: };
        !            87: 
        !            88: 
        !            89: /* some I know, some I defined.. PLEASE ADD!! */
        !            90: #define MANUF_BUILTIN          1
        !            91: #define PROD_BUILTIN_SCSI      1
        !            92: #define PROD_BUILTIN_FLOPPY    2
        !            93: #define PROD_BUILTIN_RS232     3
        !            94: #define PROD_BUILTIN_CLOCK     4
        !            95: #define PROD_BUILTIN_KEYBOARD  5
        !            96: #define PROD_BUILTIN_PPORT     6
        !            97: #define PROD_BUILTIN_DISPLAY   7
        !            98: #define PROD_BUILTIN_MOUSE     8
        !            99: 
        !           100: /* I think they have more than one manuf-id */
        !           101: #define MANUF_CBM_1            513
        !           102: #define PROD_CBM_1_A2088       1
        !           103: 
        !           104: #define MANUF_UNILOWELL                1030
        !           105: #define PROD_UNILOWELL_A2410   0
        !           106: 
        !           107: /* bus types */
        !           108: #define        B_MASK          0xE000
        !           109: #define        B_BUILTIN       0x2000
        !           110: #define B_ZORROII      0x4000
        !           111: #define B_ZORROIII     0x6000
        !           112: /* controller types */
        !           113: #define        C_MASK          0x8F
        !           114: #define C_FLAG         0x80
        !           115: #define        C_FLOPPY        0x81
        !           116: #define C_SCSI         0x82
        !           117: /* device types (controllers with no slaves) */
        !           118: #define D_MASK         0x8F
        !           119: #define        D_BITMAP        0x01
        !           120: #define        D_LAN           0x02
        !           121: #define        D_FPA           0x03
        !           122: #define        D_KEYBOARD      0x04
        !           123: #define        D_COMMSER       0x05
        !           124: #define        D_PPORT         0x06
        !           125: #define D_CLOCK                0x07
        !           126: #define        D_MISC          0x7F
        !           127: 
        !           128: #define HW_ISCTLR(hw)  ((hw)->hw_type & C_FLAG)
        !           129: #define HW_ISFLOPPY(hw)        (((hw)->hw_type & C_MASK) == C_FLOPPY)
        !           130: #define HW_ISSCSI(hw)  (((hw)->hw_type & C_MASK) == C_SCSI)
        !           131: #define HW_ISDEV(hw,d) (((hw)->hw_type & D_MASK) == (d))
        !           132: 
        !           133: #ifdef KERNEL
        !           134: extern struct amiga_hw sc_table[];
        !           135: extern struct amiga_ctlr amiga_cinit[];
        !           136: extern struct amiga_device amiga_dinit[];
        !           137: extern caddr_t sctova(), sctopa(), iomap();
        !           138: #endif

unix.superglobalmegacorp.com

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