Tx-timeout patch

Michel Mueller sirius@krypton.imp.com
Mon Feb 8 17:15:42 1999


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1583546091-599990229-918511595=:1945
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.LNX.3.96.990208230721.1945F@krypton.imp.com>


Here is a patch for the Tx-timeout problem.

The timeout accured because the Tx-PDMA engine was restarted even if it 
was still running (the Docuementation does not say what happens if you
do so). So I changed the following line in hamachi_start_xmit to take care
of the actual state of the TxPDMA engine and the timeout errors are gone.
I also put the Tx-Intrrupt-patch from Peter Monta in this patch.


I had a look at the new driver from Eric Kasten and I think there is a
problem with the tx_full flag.
In Eric's driver, the tx_full flag is only cleared when hamachi_start_xmit
is called. But hamachi_start_xmit should not be called by the kernel when 
tx_full is set. So the Driver stalls as soon as the Tx-queue is full.
Tx_full must be cleared from within the interrupt driver,
or am I overlooking something ?

I hope this patch helps making the driver more Stable.

	Michel Mueller


old:	writew(0x0001, dev->base_addr + TxCmd);
new:    status=readw(dev->base_addr + TxStatus);
 	if( !( status & 0x0001) || (status & 0x0002))
 		writew(1, dev->base_addr + TxCmd);
 	






---1583546091-599990229-918511595=:1945
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="tx-timeout.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.990208230635.1945D@krypton.imp.com>
Content-Description: 

LS0tIGhhbWFjaGkuYy5vcmlnCU1vbiBGZWIgIDggMjI6NTM6MDUgMTk5OQ0K
KysrIGhhbWFjaGkuYwlNb24gRmViICA4IDIyOjUyOjQ1IDE5OTkNCkBAIC0x
OCw3ICsxOCw3IEBADQogKi8NCiANCiBzdGF0aWMgY29uc3QgY2hhciAqdmVy
c2lvbiA9DQotImhhbWFjaGkuYzp2MC4wNyA4LzE3Lzk4ICBXcml0dGVuIGJ5
IERvbmFsZCBCZWNrZXJcbiINCisia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Y2tldHMJPSByZWFkbChpb2FkZHIgKyAw
eDAwMCk7DQorCS8qIGhtcC0+c3RhdHMudHhfcGFja2V0cwk9IHJlYWRsKGlv
YWRkciArIDB4MDAwKTsgKi8NCiAjaWYgTElOVVhfVkVSU0lPTl9DT0RFID49
IDB4MjAxMTkNCiAJaG1wLT5zdGF0cy5yeF9ieXRlcyA9IHJlYWRsKGlvYWRk
ciArIDB4MzMwKTsgLyogVG90YWwgVW5pK0JyZCtNdWx0aSAqLw0KIAlobXAt
PnN0YXRzLnR4X2J5dGVzID0gcmVhZGwoaW9hZGRyICsgMHgzQjApOyAvKiBU
b3RhbCBVbmkrQnJkK011bHRpICovDQo=
---1583546091-599990229-918511595=:1945--
 | To unsubscribe, send mail to Majordomo@cesdis.gsfc.nasa.gov, and within the
 |  body of the mail, include only the text:
 |   unsubscribe this-list-name youraddress@wherever.org
 | You will be unsubscribed as speedily as possible.