3c59x.c and /proc/net/dev

Torsten Blank (tb@itpdia19.physik.uni-karlsruhe.de)
12 Jan 1999 16:02:09 +0100


Is there a deeper reason, that the driver for 3COM905 network adapters
cannot count the bytes for the statistics in /proc/net/dev? I have
inserted 4 lines of code, found in '3c509.c', and now it works.
... at least i think so.

Torsten Blank

Here is my patch against the driver in linux-2.2.0-pre6:

--- 3c59x.c.orig Tue Jan 12 12:52:49 1999
+++ 3c59x.c Tue Jan 12 15:46:29 1999
@@ -1491,6 +1491,7 @@
outb(0x00, ioaddr + TxStatus); /* Pop the status stack. */
}
}
+ vp->stats.tx_bytes += skb->len;
return 0;
}

@@ -1550,6 +1551,7 @@
clear_bit(0, (void*)&dev->tbusy);
}
dev->trans_start = jiffies;
+ vp->stats.tx_bytes += skb->len;
return 0;
}
}
@@ -1734,6 +1736,7 @@
netif_rx(skb);
dev->last_rx = jiffies;
vp->stats.rx_packets++;
+ vp->stats.rx_bytes += skb->len;
/* Wait a limited time to go to next packet. */
for (i = 200; i >= 0; i--)
if ( ! (inw(ioaddr + EL3_STATUS) & CmdInProgress))
@@ -1785,6 +1788,7 @@
int pkt_len = rx_status & 0x1fff;
struct sk_buff *skb;

+ vp->stats.rx_bytes += pkt_len;
if (vortex_debug > 4)
printk(KERN_DEBUG "Receiving packet size %d status %4.4x.\n",
pkt_len, rx_status);

-
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/