Patch: eepro100-speedo-debug-1
From: Dragan Stancevic <visitor@valinux.com>
Debugging tweaks for eepro100 driver:
* Add ioctl to adjust speedo_debug.
* Print diagnostic when Tx ring fills up.
* Adjust debugging level of interrupt diagnostics.
* Eliminate compilation warning.
Index: linux/drivers/net/eepro100.c
--- linux/drivers/net/eepro100.c:1.4 Wed Sep 6 12:54:42 2000
+++ linux/drivers/net/eepro100.c Thu Sep 28 01:07:37 2000
@@ -1,5 +1,3 @@
-#define USE_IO
-
/* drivers/net/eepro100.c: An Intel i82557-559 Ethernet driver for Linux. */
/*
NOTICE: this version of the driver is supposed to work with 2.2 kernels.
@@ -39,6 +37,11 @@
Honor PortReset timing specification.
*/
+/*
+ * This might fix initialization problems. --Dragan
+ */
+#define USE_IO 1
+
static const char *version =
"eepro100.c:v1.09j-t 9/29/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/eepro100.html\n"
"eepro100.c: $Revision: 1.20.2.10 $ 2000/05/31 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others\n";
@@ -1147,8 +1150,6 @@
static void speedo_show_state(struct net_device *dev)
{
struct speedo_private *sp = (struct speedo_private *)dev->priv;
- long ioaddr = dev->base_addr;
- int phy_num = sp->phy[0] & 0x1f;
int i;
/* Print a few items for debugging. */
@@ -1175,12 +1176,17 @@
(unsigned)sp->rx_ringp[i]->status : 0);
#if 0
+ {
+ long ioaddr = dev->base_addr;
+ int phy_num = sp->phy[0] & 0x1f;
+
for (i = 0; i < 16; i++) {
/* FIXME: what does it mean? --SAW */
if (i == 6) i = 21;
printk(KERN_DEBUG "%s: PHY index %d register %d is %4.4x.\n",
dev->name, phy_num, i, mdio_read(ioaddr, phy_num, i));
}
+ }
#endif
}
@@ -1508,7 +1514,7 @@
FCP and ER interrupts --Dragan */
outw(status & 0xfc00, ioaddr + SCBStatus);
- if (speedo_debug > 4)
+ if (speedo_debug > 3)
printk(KERN_DEBUG "%s: interrupt status=%#4.4x.\n",
dev->name, status);
@@ -1931,6 +1937,11 @@
mdio_write(ioaddr, data[0], data[1], data[2]);
end_bh_atomic();
return 0;
+ case SIOCDEVPRIVATE+5:
+ speedo_debug = *(int *)rq->ifr_data;
+ printk(KERN_DEBUG "%s: set debug level to [%d].\n",
+ dev->name, speedo_debug);
+ return 0;
default:
return -EOPNOTSUPP;
}
@@ -1970,6 +1981,10 @@
/* The Tx ring is full -- don't add anything! Hope the mode will be
* set again later. */
sp->rx_mode = -1;
+ if(speedo_debug < 2)
+ printk(KERN_DEBUG "%s: The Tx ring is full -- don't add anything!\n"
+ "sp->cur_tx[%d], sp->dirty_tx[%d], TX_RING_SIZE[%d], TX_MULTICAST_SIZE[%d]\n",
+ dev->name, sp->cur_tx, sp->dirty_tx, TX_RING_SIZE, TX_MULTICAST_SIZE);
return;
}
-- Chip Salzenberg - a.k.a. - <chip@valinux.com> "I wanted to play hopscotch with the impenetrable mystery of existence, but he stepped in a wormhole and had to go in early." // MST3K - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:10 EST