[PATCH] rx/tx_bytes counting for epic100 in 2.2.0pre1

nunca (nailz@vivid.net)
Tue, 29 Dec 1998 16:49:44 -0500


I've hacked up a quick patch to so that /proc/net/dev byte counting
works for the epic100 ethernet driver. I see some other cards don't
seem to have support for this stat but since I don't own them, I would
not feel safe modifying the drivers.
Nolan

--- linux/drivers/net/epic100.c.orig Thu Dec 24 16:10:38 1998
+++ linux/drivers/net/epic100.c Tue Dec 29 16:16:54 1998
@@ -884,6 +884,9 @@
ep->tx_ring[entry].bufaddr = virt_to_bus(skb->data);
ep->tx_ring[entry].buflength = skb->len;

+ /* tx_bytes counting -- Nolan Leake */
+ ep->stats.tx_bytes += ep->tx_ring[entry].txlength;
+
if (ep->cur_tx - ep->dirty_tx < TX_RING_SIZE/2) {/* Typical path */
flag = 0x10; /* No interrupt */
clear_bit(0, (void*)&dev->tbusy);
@@ -1112,6 +1115,8 @@
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
ep->stats.rx_packets++;
+ /* rx_bytes counting -- Nolan Leake */
+ ep->stats.rx_bytes += pkt_len;
}
work_done++;
entry = (++ep->cur_rx) % RX_RING_SIZE;

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