ethwstrt.c,v
来自「TCP-IP红宝书源代码」· C,V 代码 · 共 79 行
C,V
79 行
head 1.1;
access;
symbols;
locks
dls:1.1; strict;
comment @ * @;
1.1
date 94.01.07.03.10.26; author dls; state Old;
branches;
next ;
desc
@@
1.1
log
@Initial revision
@
text
@/* ethwstrt.c - ethwstrt */
#include <conf.h>
#include <kernel.h>
#include <proc.h>
#include <network.h>
extern int udpouttmp;
/*------------------------------------------------------------------------
* ethwstrt - start an ethernet write operation on the LANCE
*------------------------------------------------------------------------
*/
int
ethwstrt(pet)
struct etblk *pet;
{
struct le_device *le;
struct le_md *pmdxmit;
STATWORD ps;
struct ep *pep;
int len;
Bool bcast;
disable(ps);
if (pet->etxpending) {
restore(ps);
return OK;
}
pet->etxpending++;
pep = (struct ep *)deq(pet->etoutq);
if (pep == 0) {
pet->etxpending--;
restore(ps);
return OK;
}
bcast = blkequ(pep->ep_dst, pet->etbcast, EP_ALEN);
len = pep->ep_len;
le = pet->etle;
pmdxmit = eth->etbrt[0].pmd;
pet->etwtry = EP_RETRY;
blkcopy(eth->etbrt[0].buf, &pep->ep_eh, pep->ep_len);
pmdxmit->lmd_bcnt = -pep->ep_len;
pmdxmit->lmd_mcnt = 0;
pmdxmit->lmd_flags = LMD_OWN | LMD_STP | LMD_ENP;
le->le_csr = LE_TDMD | LE_INEA;
restore(ps);
freebuf(pep);
if (bcast)
nif[pet->etintf].ni_onucast++;
else
nif[pet->etintf].ni_oucast++;
nif[pet->etintf].ni_ooctets += len;
}
@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?