Annotation of coherent/b/STREAMS/conf_79/mdev.h, revision 1.1

1.1     ! root        1: #ifndef        MDEV_H
        !             2: #define        MDEV_H
        !             3: 
        !             4: /*
        !             5:  *-IMPORTS:
        !             6:  *     <sys/compat.h>
        !             7:  *             CONST
        !             8:  *             EXTERN_C_BEGIN
        !             9:  *             EXTERN_C_END
        !            10:  *             PROTO ()
        !            11:  */
        !            12: 
        !            13: #include <sys/compat.h>
        !            14: 
        !            15: #ifndef        SYMBOL_T
        !            16: #define        SYMBOL_T
        !            17: typedef        struct symbol   symbol_t;
        !            18: #endif
        !            19: 
        !            20: #ifndef        SDEV_T
        !            21: #define        SDEV_T
        !            22: typedef        struct sdevice  sdev_t;
        !            23: #endif
        !            24: 
        !            25: #ifndef        MDEV_T
        !            26: #define        MDEV_T
        !            27: typedef        struct mdevice  mdev_t;
        !            28: #endif
        !            29: 
        !            30: #ifndef        MDLIST_T
        !            31: #define        MDLIST_T
        !            32: typedef struct mdlist  mdlist_t;
        !            33: #endif
        !            34: 
        !            35: 
        !            36: enum {
        !            37:        MD_DISABLED,
        !            38:        MD_INSTALLABLE,
        !            39:        MD_ENABLED
        !            40: };
        !            41: 
        !            42: 
        !            43: /*
        !            44:  * Structure of the data gathered by the mkdev routines.
        !            45:  */
        !            46: 
        !            47: typedef        unsigned int    maj_t;
        !            48: typedef        unsigned int    min_t;
        !            49: 
        !            50: struct mdevice {
        !            51:        mdev_t        * md_next;        /* global list of all entries */
        !            52:        mdev_t        * md_link1;       /* for sorts */
        !            53:        mdev_t        * md_link2;       /* for sorts */
        !            54:        mdev_t        * md_link3;       /* for sorts */
        !            55: 
        !            56:        sdev_t        * md_sdevices;    /* thread of "sdevice" entries */
        !            57:        int             md_configure;   /* See MD_... constants */
        !            58:        int             md_interrupt;   /* has an enabled interrupt */
        !            59: 
        !            60:        symbol_t      * md_devname;     /* internal module/device name */
        !            61:        symbol_t      * md_functions;   /* present driver entry points */
        !            62:        symbol_t      * md_flags;       /* driver characteristics */
        !            63:        symbol_t      * md_prefix;      /* driver prefix */
        !            64:        maj_t           md_blk_maj [2]; /* block major number low, high */
        !            65:        maj_t           md_chr_maj [2]; /* character major number low, high */
        !            66:        min_t           md_minor_min;   /* minor number minimum */
        !            67:        min_t           md_minor_max;   /* minor number maximum */
        !            68: 
        !            69:        /*
        !            70:         * The following fields are not used in the Coherent system as yet
        !            71:         * but are defined by mdevice (4) so we read them.
        !            72:         */
        !            73: 
        !            74:        int             md_dma_chan;    /* DMA channel number */
        !            75:        int             md_cpu_id;      /* processor-id */
        !            76: };
        !            77: 
        !            78: 
        !            79: /*
        !            80:  * Structure of a list of "mdevice" entries.
        !            81:  */
        !            82: 
        !            83: struct mdlist {
        !            84:        mdev_t        * mdl_first;      /* first mdevice in list */
        !            85:        mdev_t        * mdl_last;       /* last mdevice in list */
        !            86:        int             mdl_count;      /* count of mdevices */
        !            87: };
        !            88: 
        !            89: 
        !            90: /*
        !            91:  * Types suitable for use as selection and comparison predicates for the
        !            92:  * mdev_sort () function.
        !            93:  */
        !            94: 
        !            95: typedef        int  (* msel_t)         PROTO ((mdev_t * _mdevp));
        !            96: typedef int  (*        mcmp_t)         PROTO ((mdev_t * _left, mdev_t * _right));
        !            97: 
        !            98: 
        !            99: /*
        !           100:  * For Coherent, the first 32 major numbers are reserved for the use of the
        !           101:  * old-style Coherent device-driver system.
        !           102:  */
        !           103: 
        !           104: enum { MAJOR_RESERVED = 32,
        !           105:        MAX_DEVNAME = 8,
        !           106:        MAX_PREFIX = 4
        !           107: };
        !           108: 
        !           109: 
        !           110: #define        MDEV_OPEN               'o'
        !           111: #define        MDEV_CLOSE              'c'
        !           112: #define        MDEV_READ               'r'
        !           113: #define        MDEV_WRITE              'w'
        !           114: #define        MDEV_IOCTL              'i'
        !           115: #define        MDEV_STARTUP            's'
        !           116: #define        MDEV_EXIT               'x'
        !           117: #define        MDEV_INIT               'I'
        !           118: #define        MDEV_HALT               'h'
        !           119: #define        MDEV_CHPOLL             'p'
        !           120: 
        !           121: #define        MDEV_MMAP               'M'     /* not defined in SVR4 mdevice (4) */
        !           122: #define        MDEV_SIZE               'z'     /* not defined in SVR4 mdevice (4) */
        !           123: 
        !           124: #define        MDEV_FUNCS              "ocrwisxIhpMz"
        !           125: 
        !           126: 
        !           127: #define        MDEV_INSTALLABLE        'i'
        !           128: #define        MDEV_CHAR               'c'
        !           129: #define        MDEV_BLOCK              'b'
        !           130: #define        MDEV_STREAM             'S'
        !           131: #define        MDEV_DDI_DDK            'f'
        !           132: #define        MDEV_TTY                't'
        !           133: #define        MDEV_ONE_SDEVICE        'o'
        !           134: #define        MDEV_REQUIRED           'r'
        !           135: #define        MDEV_SAME_MAJORS        'u'
        !           136: #define        MDEV_HARDWARE           'H'
        !           137: #define        MDEV_NO_INT             'G'
        !           138: #define        MDEV_SHARE_DMA          'D'
        !           139: #define        MDEV_MULTIPLE_MAJORS    'M'
        !           140: #define        MDEV_ALLOW_IOA_OVERLAP  'O'
        !           141: 
        !           142: #define        MDEV_FLAGS              "icbSftoruHGDMO"
        !           143: 
        !           144: 
        !           145: EXTERN_C_BEGIN
        !           146: 
        !           147: mdev_t       * find_mdev       PROTO ((symbol_t * _sym));
        !           148: mdev_t       * mdevices        PROTO ((void));
        !           149: int            mdev_func       PROTO ((mdev_t * _mdevp, char _func));
        !           150: int            mdev_flag       PROTO ((mdev_t * _mdevp, char _flag));
        !           151: void           read_mdev_file  PROTO ((CONST char * _name));
        !           152: void           mdev_sort       PROTO ((mdlist_t * _mlistp, msel_t _selpred,
        !           153:                                        mcmp_t _cmppred, size_t ptroff));
        !           154: 
        !           155: EXTERN_C_END
        !           156: 
        !           157: #endif /* ! defined (MDEV_H) */

unix.superglobalmegacorp.com

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