[patch] Cirrus Logic CS89x0 bug fixes

Will Lockhart (will.lockhart@bigfoot.com)
Thu, 5 Aug 1999 16:51:54 +0100 (BST)


Couple of patches for the Crystal Semi (now Cirrus Logic) ethernet
chipset. A couple of the constants in the header file are wrong
(obvious by inspection from the data sheet, available at
http://www.cirrus.com/ftp/pubs/8900a.pdf). The net result of this is
that although the driver detects transmit underrun and attempts to
disable pipelined transmit, it never actually manages to turn it off
completely.

Also, the code that handles transmit underrun doesn't treat the
condition as it should i.e. transmit complete but failed, so when it
happens you had to wait for the upper layers to time out before the
frame gets retransmitted.

Both of these are probably only issues on machines with slow and/or
broken buses, so I doubt anybody has actually been affected by either
problem.

Oh, and fixed a couple of spelling mistakes, and bumped the minor
version number by 1.

Patches against 2.2.10.

--- /homes/wjl/linux/linux/drivers/net/cs89x0.c Tue Jun 8 00:19:58 1999
+++ drivers/net/cs89x0.c Thu Aug 5 16:30:29 1999
@@ -30,7 +30,7 @@
*/

static char *version =
-"cs89x0.c:v1.02 11/26/96 Russell Nelson <nelson@crynwr.com>\n";
+"cs89x0.c:v1.03 11/26/96 Russell Nelson <nelson@crynwr.com>\n";

/* ======================= configure the driver here ======================= */

@@ -306,7 +306,7 @@
else if (get_eeprom_data(dev, START_EEPROM_DATA,CHKSUM_LEN,eeprom_buff) < 0) {
printk("\ncs89x0: EEPROM read failed, relying on command line.\n");
} else if (get_eeprom_cksum(START_EEPROM_DATA,CHKSUM_LEN,eeprom_buff) < 0) {
- printk("\ncs89x0: EEPROM checksum bad, relyong on command line\n");
+ printk("\ncs89x0: EEPROM checksum bad, relying on command line\n");
} else {
/* get transmission control word but keep the autonegotiation bits */
if (!lp->auto_neg_cnf) lp->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
@@ -843,6 +843,13 @@
lp->send_underrun++;
if (lp->send_underrun == 3) lp->send_cmd = TX_AFTER_381;
else if (lp->send_underrun == 6) lp->send_cmd = TX_AFTER_ALL;
+ /* transmit cycle is done, although
+ frame wasn't transmitted - this
+ avoids having to wait for the upper
+ layers to timeout on us, in the
+ event of a tx underrun */
+ dev->tbusy = 0;
+ mark_bh(NET_BH); /* Inform upper layers. */
}
break;
case ISQ_RX_MISS_EVENT:

--- /homes/wjl/linux/linux/drivers/net/cs89x0.h Sun Feb 2 13:18:36 1997
+++ drivers/net/cs89x0.h Thu Aug 5 16:19:06 1999
@@ -319,8 +319,8 @@
#define TX_FRAME_PORT RX_FRAME_PORT
#define TX_CMD_PORT 0x0004
#define TX_NOW 0x0000 /* Tx packet after 5 bytes copied */
-#define TX_AFTER_381 0x0020 /* Tx packet after 381 bytes copied */
-#define TX_AFTER_ALL 0x0060 /* Tx packet after all bytes copied */
+#define TX_AFTER_381 0x0040 /* Tx packet after 381 bytes copied */
+#define TX_AFTER_ALL 0x00c0 /* Tx packet after all bytes copied */
#define TX_LEN_PORT 0x0006
#define ISQ_PORT 0x0008
#define ADD_PORT 0x000A

Will

-- 
Will Lockhart, System Developer, Axiom (Cambridge) Ltd.
http://www.mvhi.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/