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

1.1     ! root        1: /* ethwrite.c - ethwrite */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <proc.h>
        !             6: #include <network.h>
        !             7: 
        !             8: /*------------------------------------------------------------------------
        !             9:  *  ethwrite - write a single packet to the ethernet
        !            10:  *------------------------------------------------------------------------
        !            11:  */
        !            12: 
        !            13: ethwrite(devptr, buff, len)
        !            14: struct devsw   *devptr;
        !            15: struct epacket *buff;
        !            16: int    len;
        !            17: {
        !            18:        struct  etblk   *etptr;
        !            19:        PStype  ps;
        !            20: 
        !            21:        if (len > EMAXPAK)
        !            22:                return(SYSERR);
        !            23:        if (len < EMINPAK)
        !            24:                len = EMINPAK;
        !            25:        etptr = (struct etblk *) devptr->dvioblk;
        !            26:        blkcopy(buff->ep_hdr.e_src, etptr->etpaddr, EPADLEN);
        !            27:        disable(ps);
        !            28:        wait(etptr->etwsem);
        !            29:        ethwstrt(etptr, buff, etptr->etlen = len, DC_NORM);
        !            30:        restore(ps);
        !            31:        return(OK);
        !            32: }

unix.superglobalmegacorp.com

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