Annotation of xinu/sys/ethinter.c, revision 1.1

1.1     ! root        1: /* ethinter.c - ethinter */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <proc.h>
        !             6: #include <network.h>
        !             7: #include <qbus.h>
        !             8: 
        !             9: /*------------------------------------------------------------------------
        !            10:  *  ethinter - ethernet interrupt processing procedure
        !            11:  *------------------------------------------------------------------------
        !            12:  */
        !            13: INTPROC        ethinter(etptr)
        !            14:        struct  etblk   *etptr;
        !            15: {
        !            16:        struct  dqregs  *dqptr;
        !            17:        register struct dcmd    *dcmptr;
        !            18:        short   csr;
        !            19:        int     pid;
        !            20: 
        !            21:        dqptr = etptr->eioaddr;
        !            22:        dqptr->d_csr = csr = dqptr->d_csr;      /* clear RINT, XINT */
        !            23: 
        !            24:        /* check BOTH receive and xmit completion */
        !            25: 
        !            26:        if (csr & DQ_RINT) {
        !            27:                dcmptr = etptr->ercmd;
        !            28:                if ( (dcmptr->dc_st1 & DC_LUSE) != DC_ERRU) {
        !            29:                        pid = etptr->etrpid;
        !            30:                        etptr->etrpid = BADPID;
        !            31:                        send(pid, OK);
        !            32:                } else {        /* error, so retry operation */
        !            33:                        dcmptr->dc_st1 = dcmptr->dc_st2 = DC_INIT;
        !            34:                        dcmptr->dc_flag = DC_NUSED;
        !            35:                        dqptr->d_rcmd = (short) dcmptr;
        !            36:                        dqptr->d_rcmdh = hiQ2low(dcmptr);
        !            37:                }
        !            38:        }
        !            39:        if (csr & DQ_XINT) {
        !            40:                dcmptr = etptr->ewcmd;
        !            41:                if ( (dcmptr->dc_st1 & DC_LUSE) != DC_ERRU) {
        !            42:                        if (etptr->etsetup == DC_NORM) {
        !            43:                                etptr->etlen = 0;
        !            44:                                freebuf( lowQ2hi(dcmptr->dc_bufh) |
        !            45:                                                        dcmptr->dc_buf );
        !            46:                                signal(etptr->etwsem);
        !            47:                        }
        !            48:                } else if (etptr->etwtry-- > 0) { /* retry on error */
        !            49:                        while (! (dqptr->d_csr & DQ_XLI) )
        !            50:                                ;
        !            51:                        dcmptr->dc_st1 = dcmptr->dc_st2 = DC_INIT;
        !            52:                        dcmptr->dc_flag = DC_NUSED;
        !            53:                        dqptr->d_wcmd = (short) dcmptr;
        !            54:                        dqptr->d_wcmdh = hiQ2low(dcmptr);
        !            55:                } else {
        !            56:                        if (etptr->etsetup == DC_NORM) {
        !            57:                                freebuf( lowQ2hi(dcmptr->dc_bufh) |
        !            58:                                                        dcmptr->dc_buf);
        !            59:                                signal(etptr->etwsem);
        !            60:                        }
        !            61:                }
        !            62:        }
        !            63: }

unix.superglobalmegacorp.com

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