patch-2.1.31 linux/drivers/net/bpqether.c

Next file: linux/drivers/net/cs89x0.c
Previous file: linux/drivers/net/atp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.30/linux/drivers/net/bpqether.c linux/drivers/net/bpqether.c
@@ -241,13 +241,14 @@
 		return 0;
 	}
 
-	((struct bpqdev *)dev->priv)->stats.rx_packets++;
-
 	len = skb->data[0] + skb->data[1] * 256 - 5;
 
 	skb_pull(skb, 2);	/* Remove the length bytes */
 	skb_trim(skb, len);	/* Set the length of the data */
 
+	((struct bpqdev *)dev->priv)->stats.rx_packets++;
+	((struct bpqdev *)dev->priv)->stats.rx_bytes+=len;
+
 	ptr = skb_push(skb, 1);
 	*ptr = 0;
 
@@ -314,7 +315,6 @@
 	*ptr++ = (size + 5) / 256;
 
 	bpq = (struct bpqdev *)dev->priv;
-	bpq->stats.tx_packets++;
 
 	if ((dev = bpq_get_ether_dev(dev)) == NULL) {
 		bpq->stats.tx_dropped++;
@@ -324,7 +324,9 @@
 
 	skb->dev = dev;
 	dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0);
-
+	bpq->stats.tx_packets++;
+	bpq->stats.tx_bytes+=skb->len;
+  
 	dev_queue_xmit(skb);
 
 	return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov