From 8de132d37d67fe3a96a3c10d5cdb639ac2b8b0df Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 24 Oct 1998 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1998-10-24 --- pc/ether82557.c | 17 ++++++++++++----- pc/etherelnk3.c | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pc/ether82557.c b/pc/ether82557.c index 93cd260f6a76d7d80e610afcf263c1158bccffd0..f036722b55dc496c861e3c6b5f34c6e0e64a937c 100644 --- a/pc/ether82557.c +++ b/pc/ether82557.c @@ -226,7 +226,8 @@ static uchar configdata[24] = { 0x00, /* adaptive IFS */ 0x00, 0x00, /* Rx DMA maximum byte count */ - 0x80, /* Tx DMA maximum byte count */ +// 0x80, /* Tx DMA maximum byte count */ + 0x00, /* Tx DMA maximum byte count */ 0x32, /* !late SCB, CNA interrupts */ 0x03, /* discard short Rx frames */ 0x00, /* 503/MII */ @@ -343,12 +344,12 @@ watchdog(void* arg) pexit("disabled", 0); } + ilock(&ctlr->cblock); if(ctlr->tick++){ - ilock(&ctlr->cblock); ctlr->action = CbMAS; txstart(ether); - iunlock(&ctlr->cblock); } + iunlock(&ctlr->cblock); } } @@ -674,8 +675,11 @@ interrupt(Ureg*, void* arg) * If the watchdog timer for the receiver lockup errata is running, * let it know the receiver is active. */ - if(status & (StatFR|StatRNR)) + if(status & (StatFR|StatRNR)){ + ilock(&ctlr->cblock); ctlr->tick = 0; + iunlock(&ctlr->cblock); + } if(status & StatFR){ receive(ether); @@ -765,7 +769,7 @@ ctlrinit(Ctlr* ctlr) ctlr->cbq = 0; memmove(ctlr->configdata, configdata, sizeof(configdata)); - ctlr->threshold = 8; + ctlr->threshold = 80; ctlr->tick = 0; iunlock(&ctlr->cblock); @@ -1128,6 +1132,9 @@ reset(Ether* ether) miiw(ctlr, phyaddr, 0x00, bmcr); } + if(bmcr & 0x2000) + ether->mbps = 100; + ctlr->configdata[8] = 1; ctlr->configdata[15] &= ~0x80; } diff --git a/pc/etherelnk3.c b/pc/etherelnk3.c index 853a398f46e392c067fb9475cd88011ccff4b347..79c12d923232ab8acbbe2b941566d44d0136f981 100644 --- a/pc/etherelnk3.c +++ b/pc/etherelnk3.c @@ -753,6 +753,7 @@ txstart905(Ether* ether) stalled = 1; } + coherence(); ctlr->dnhead->np = PADDR(&pd->np); ctlr->dnhead->control &= ~dnIndicate; ctlr->dnhead = pd; @@ -828,6 +829,7 @@ receive905(Ether* ether) etheriq(ether, pd->bp, 1); pd->bp = bp; pd->addr = PADDR(bp->rp); + coherence(); } pd->control = 0;