From c37e9aade19915cabf6371282213f565b10bd416 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 25 Sep 1996 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1996-09-25 --- pc/etherelnk3.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pc/etherelnk3.c b/pc/etherelnk3.c index b08a1b5486f4cb5681879ce6e5d792772229a9f8..72876c01e3e7d0c4793c023d3ef9d68b786e8d42 100644 --- a/pc/etherelnk3.c +++ b/pc/etherelnk3.c @@ -328,6 +328,7 @@ typedef struct { int xcvr; /* transceiver type */ int rxstatus9; /* old-style RxStatus register */ + int ts; /* threshold shift */ } Ctlr; static Block* @@ -501,7 +502,7 @@ transmit(Ether* ether) } else if(ctlr->txbusy == 0){ ctlr->txbusy = 1; - COMMAND(port, SetTxAvailableThresh, len); + COMMAND(port, SetTxAvailableThresh, len>>ctlr->ts); return; } } @@ -724,7 +725,7 @@ interrupt(Ureg*, void* arg) COMMAND(port, TxReset, 0); while(STATUS(port) & commandInProgress) ; - COMMAND(port, SetTxStartThresh, ctlr->txthreshold); + COMMAND(port, SetTxStartThresh, ctlr->txthreshold>>ctlr->ts); } COMMAND(port, TxEnable, 0); ether->oerrs++; @@ -1200,6 +1201,8 @@ etherelnk3reset(Ether* ether) ctlr->busmaster = busmaster; ctlr->xcvr = xcvr; ctlr->rxstatus9 = rxstatus9; + if(rxearly >= 2048) + ctlr->ts = 2; COMMAND(port, StatisticsEnable, 0); @@ -1217,8 +1220,8 @@ etherelnk3reset(Ether* ether) * interrupts happen. */ ctlr->txthreshold = ETHERMINTU; - COMMAND(port, SetTxStartThresh, ETHERMINTU); - COMMAND(port, SetRxEarlyThresh, rxearly); + COMMAND(port, SetTxStartThresh, ETHERMINTU>>ctlr->ts); + COMMAND(port, SetRxEarlyThresh, rxearly>>ctlr->ts); iunlock(&ctlr->wlock);