From eda2b7a986785d5125530b26f1fdc0b4b2258665 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 25 Oct 1997 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1997-10-25 --- pc/etherelnk3.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/pc/etherelnk3.c b/pc/etherelnk3.c index 9e0b87b3373e07f2a7bced0762f447f10dd7572f..b151e5c10d01ba369c8ce13724bfd7eb8bcfebc9 100644 --- a/pc/etherelnk3.c +++ b/pc/etherelnk3.c @@ -401,8 +401,7 @@ typedef struct { Pd* upr; Pd* uphead; - Lock dnlock; /* full-busmaster -based transmission */ - int ndn; + int ndn; /* full-busmaster -based transmission */ void* dnbase; Pd* dnr; Pd* dnhead; @@ -456,7 +455,6 @@ init905(Ctlr* ctlr) } ctlr->uphead = ctlr->upr; - ilock(&ctlr->dnlock); ctlr->dnbase = malloc((ctlr->ndn+1)*sizeof(Pd)); ctlr->dnr = (Pd*)ROUNDUP((ulong)ctlr->dnbase, 8); @@ -468,7 +466,6 @@ init905(Ctlr* ctlr) ctlr->dnhead = ctlr->dnr; ctlr->dntail = ctlr->dnr; ctlr->dnq = 0; - iunlock(&ctlr->dnlock); } static Block* @@ -702,7 +699,6 @@ txstart905(Ether* ether) ctlr = ether->ctlr; port = ether->port; - ilock(&ctlr->dnlock); COMMAND(port, Stall, dnStall); while(STATUS(port) & commandInProgress) ; @@ -757,7 +753,6 @@ txstart905(Ether* ether) outl(port+DnListPtr, PADDR(&ctlr->dnhead->np)); COMMAND(port, Stall, dnUnStall); - iunlock(&ctlr->dnlock); } static void @@ -769,16 +764,15 @@ transmit(Ether* ether) port = ether->port; ctlr = ether->ctlr; - if(ctlr->dnenabled){ + ilock(&ctlr->wlock); + if(ctlr->dnenabled) txstart905(ether); - return; + else{ + w = (STATUS(port)>>13) & 0x07; + COMMAND(port, SelectRegisterWindow, Wop); + txstart(ether); + COMMAND(port, SelectRegisterWindow, w); } - - ilock(&ctlr->wlock); - w = (STATUS(port)>>13) & 0x07; - COMMAND(port, SelectRegisterWindow, Wop); - txstart(ether); - COMMAND(port, SelectRegisterWindow, w); iunlock(&ctlr->wlock); } @@ -1298,7 +1292,7 @@ tcm5XXeisa(void) * Check if this is an EISA machine. * If not, nothing to do. */ - if(strncmp((char*)(KZERO|0xFFFD9), "EISA", 4)) + if(strncmp((char*)KADDR(0xFFFD9), "EISA", 4)) return; /*