File:  [XINU] / xinu / sys / ethwrite.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:04 2018 UTC (8 years, 2 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* ethwrite.c - ethwrite */

#include <conf.h>
#include <kernel.h>
#include <proc.h>
#include <network.h>

/*------------------------------------------------------------------------
 *  ethwrite - write a single packet to the ethernet
 *------------------------------------------------------------------------
 */

ethwrite(devptr, buff, len)
struct	devsw	*devptr;
struct	epacket	*buff;
int	len;
{
	struct	etblk	*etptr;
	PStype	ps;

	if (len > EMAXPAK)
		return(SYSERR);
	if (len < EMINPAK)
		len = EMINPAK;
	etptr = (struct etblk *) devptr->dvioblk;
	blkcopy(buff->ep_hdr.e_src, etptr->etpaddr, EPADLEN);
	disable(ps);
	wait(etptr->etwsem);
	ethwstrt(etptr, buff, etptr->etlen = len, DC_NORM);
	restore(ps);
	return(OK);
}

unix.superglobalmegacorp.com

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