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

1.1     ! root        1: /* ethinit.c - ethinit */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <network.h>
        !             6: #include <qbus.h>
        !             7: 
        !             8: /*------------------------------------------------------------------------
        !             9:  *  ethinit  -  initialize ethernet I/O device and buffers
        !            10:  *------------------------------------------------------------------------
        !            11:  */
        !            12: ethinit(devptr)
        !            13:        struct  devsw   *devptr;
        !            14: {
        !            15:        struct  etblk   *etptr;
        !            16:        struct  dqregs  *dqptr;
        !            17:        struct  dcmd    *dcmptr;
        !            18:        short   *iptr;
        !            19:        int     i;
        !            20:        struct  dqsetup setup;
        !            21: 
        !            22:        etptr = &eth[devptr->dvminor];
        !            23:        devptr->dvioblk = (char *) etptr;
        !            24:        iosetvec(devptr->dvnum, etptr, etptr);
        !            25:        etptr->eioaddr = dqptr = (struct dqregs *) devptr->dvcsr;
        !            26:        etptr->etdev = devptr;
        !            27:        etptr->etrsem = screate(1);
        !            28:        etptr->etwsem = screate(1);
        !            29:        etptr->etrpid = 0;
        !            30: 
        !            31:        /* establish read and write buffer descriptor lists */
        !            32: 
        !            33:        dcmptr = &etptr->ercmd[1];
        !            34:        dcmptr->dc_flag = DC_NUSED;
        !            35:        dcmptr->dc_bufh = DC_ENDL;
        !            36:        dcmptr->dc_buf = (short) NULL;
        !            37: 
        !            38:        dcmptr = &etptr->ewcmd[1];
        !            39:        dcmptr->dc_flag = DC_NUSED;
        !            40:        dcmptr->dc_bufh = DC_ENDL;
        !            41:        dcmptr->dc_buf = (short) NULL;
        !            42:        dcmptr->dc_st1 = dcmptr->dc_st2 = DC_INIT;
        !            43: 
        !            44:        /* extract physical ethernet address */
        !            45: 
        !            46:        for (iptr=(short *)dqptr ,i=0 ; i<EPADLEN ; i++)
        !            47:                etptr->etpaddr[i] = LOWBYTE & *iptr++;
        !            48: 
        !            49:        ethstrt(etptr, &setup);
        !            50:        return(OK);
        !            51: }
        !            52: 
        !            53: #ifdef Neth
        !            54: struct etblk   eth[Neth];
        !            55: #endif

unix.superglobalmegacorp.com

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