Annotation of researchv9/sys/sun3/zscom.h, revision 1.1.1.1

1.1       root        1: /*    @(#)zscom.h 1.1 86/02/03 SMI      */
                      2: 
                      3: /*
                      4:  * Copyright (c) 1984 by Sun Microsystems, Inc.
                      5:  */
                      6: 
                      7: /*
                      8:  * Support common to all users of Z8530 devices
                      9:  */
                     10: 
                     11: /*
                     12:  * Interrupt vectors - per protocol
                     13:  */
                     14: struct zsops {
                     15:        int     (*zsop_attach)();       /* attach protocol */
                     16:        int     (*zsop_txint)();        /* xmit buffer empty */
                     17:        int     (*zsop_xsint)();        /* external/status */
                     18:        int     (*zsop_rxint)();        /* receive char available */
                     19:        int     (*zsop_srint)();        /* special receive condition */
                     20:        int     (*zsop_softint)();      /* process software interrupt */
                     21: };
                     22: 
                     23: /*
                     24:  * Common data
                     25:  */
                     26: struct zscom {
                     27:        int     (*zs_vec[4])();         /* vector routines - must be first */
                     28:        struct zscc_device *zs_addr;    /* address of half of chip  - second */
                     29:        short   zs_unit;                /* which channel (0:NZSLINE) */
                     30:        caddr_t zs_priv;                /* protocol private data */
                     31:        struct zsops *zs_ops;           /* intr op vector */
                     32:        u_char  zs_wreg[16];            /* shadow of write registers */
                     33:        char    zs_flags;               /* random flags */
                     34: };
                     35: /* flags */
                     36: #define        ZS_NEEDSOFT     1
                     37: 
                     38: int zssoftpend;                                /* level 3 interrupt pending */
                     39: #define        ZSSETSOFT(zs)   {               \
                     40:        zs->zs_flags |= ZS_NEEDSOFT;    \
                     41:        if (!zssoftpend) {              \
                     42:                zssoftpend = 1;         \
                     43:                setzssoft();            \
                     44:        }                               \
                     45: }
                     46: 
                     47: /* 
                     48:  * Macros to access a port
                     49:  */
                     50: #define        ZREAD(n)        zszread(zs->zs_addr, n)
                     51: #define        ZWRITE(n,v)     zszwrite(zs->zs_addr, n, (int)(zs->zs_wreg[n] = v))
                     52: #define        ZBIS(n,v)       zszwrite(zs->zs_addr, n, (int)(zs->zs_wreg[n] |= v))
                     53: #define        ZBIC(n,v)       zszwrite(zs->zs_addr, n, (int)(zs->zs_wreg[n] &=~ v))
                     54: 
                     55: extern struct zsops *zs_proto[];

unix.superglobalmegacorp.com

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