ue_wstrt.c,v

来自「TCP-IP红宝书源代码」· C,V 代码 · 共 99 行

C,V
99
字号
head	1.2;
access;
symbols;
locks
	dls:1.2; strict;
comment	@ * @;


1.2
date	97.09.21.19.26.10;	author dls;	state Dist;
branches;
next	1.1;

1.1
date	94.08.04.20.19.17;	author dls;	state Orig;
branches;
next	;


desc
@@


1.2
log
@pre-3e code
@
text
@/* ue_wstrt.c - ue_wstrt */

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

/*------------------------------------------------------------------------
 * ue_wstrt - start output on an SMC Ultra Ethernet device
 *------------------------------------------------------------------------
 */
int
ue_wstrt(pud)
struct utdev	*pud;
{
	STATWORD	ps;
	unsigned char	*xmbuf;		/* transmit buffer address	*/
	unsigned int	xmaddr;		/* transmit buf addr to card	*/
	unsigned int	csr;
	struct ep	*pep;
	int		len, isbcast;

	disable(ps);
	if (pud->ud_xpending) {
		restore(ps);
		return OK;
	}
	pud->ud_xpending++;
	pep = (struct ep *)deq(pud->ud_outq);
	if (pep == 0) {
		pud->ud_xpending--;
		restore(ps);
		return OK;
	}
	isbcast = blkequ(pep->ep_dst, pud->ud_bcast, EP_ALEN);
	len = pep->ep_len;
	/* this version supports one packet per interrupt only */

	xmaddr = pud->ud_xmaddr;
	xmbuf = (unsigned char *) (pud->ud_iomem + xmaddr * UE_BUFSIZE);
	pud->ud_wretry = EP_RETRY;
	blkcopy(xmbuf, &pep->ep_eh, pep->ep_len);
	csr = pud->ud_pdev->dvcsr;
	uewr(csr, W_TSTARTH, xmaddr);
	uewr(csr, W_TCNTH, (len >> 8) & 0xff);
	uewr(csr, W_TCNTL, len & 0xff);
	uewr(csr, CMD, uerd(csr, CMD) | CMD_TXP);
	restore(ps);
	freebuf(pep);
	if (isbcast)
		nif[pud->ud_ifnum].ni_onucast++;
	else
		nif[pud->ud_ifnum].ni_oucast++;
	nif[pud->ud_ifnum].ni_ooctets += len;
}
@


1.1
log
@Initial revision
@
text
@a7 2
static count = 0;

d39 1
a39 1
	xmaddr = UE_NRX*6;
@

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?