Skip to contentSkip to conversation

cs89x0 collect tx_bytes statistics.

PATCH Ian Campbell 1 participant 1 message Jul 27, 2005 2 messages not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1119948144.10852.10.camel@icampbell-debian

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 10 lines · Andrew Morton
Quoted 3 lines · Ian Campbell

The cs89x0 driver does not collect tx_bytes statistics which breaks traffic monitoring on my firewall.

The patch looks odd. It records the length of the current outgoing frame in the device-global netdev structure and then, at tx interupt time it adds that value into the stats field.

Why not just do:

I finally got a hold of the device I needed to test this and it works fine, not that anyone would have expected differently...

%patch

drivers/net/cs89x0.c +1 -0
Index: 2.6/drivers/net/cs89x0.c
===================================================================
@@ -1450,6 +1450,7 @@
 	/* Write the contents of the packet */
 	outsw(dev->base_addr + TX_FRAME_PORT,skb->data,(skb->len+1) >>1);
 	spin_unlock_irq(&lp->lock);
+	lp->stats.tx_bytes += skb->len;
 	dev->trans_start = jiffies;
 	dev_kfree_skb (skb);
 
Signature · 7 lines
Ian Campbell
Current Noise: Enslaved - Return to Yggdrasill

Dentist, n.:
	A Prestidigitator who, putting metal in one's mouth, pulls
	coins out of one's pockets.
		-- Ambrose Bierce, "The Devil's Dictionary"