Why no stats.tx_bytes / stats.rx_bytes

Eric S. Johnson esj@cs.fiu.edu
Wed Nov 4 12:46:18 1998


This is what I did to my eepro100.c. Its basicly modeled off of 
what I saw in the tulip driver. Patches against the driver distributed with
2.1.126. 

Did I get this right? I am not 100% positive that tx_buf_size0 is the right
thing. But it looked like it might be....

E

*** eepro100.c.orig     Tue Oct 20 20:04:29 1998
--- eepro100.c  Tue Nov  3 17:23:09 1998
***************
*** 1109,1116 ****
--- 1109,1119 ----
                                        break;                  /* It still 
hasn
't been processed. */
                                /* Free the original skb. */
                                if (sp->tx_skbuff[entry]) {
                                        sp->stats.tx_packets++; /* Count only 
us
er packets. */
+ #if LINUX_VERSION_CODE > 0x20127
+                                       sp->stats.tx_bytes += sp->
tx_ring[entry]
.tx_buf_size0 & 0x7ff;
+ #endif
                                        dev_free_skb(sp->tx_skbuff[entry]);
                                        sp->tx_skbuff[entry] = 0;
                                } else if ((sp->tx_ring[entry].status&0x70000) 
=
= CmdNOp << 16)
                                        sp->mc_setup_busy = 0;
***************
*** 1227,1234 ****
--- 1230,1240 ----
                        }
                        skb->protocol = eth_type_trans(skb, dev);
                        netif_rx(skb);
                        sp->stats.rx_packets++;
+ #if LINUX_VERSION_CODE > 0x20127
+                       sp->stats.rx_bytes += pkt_len;
+ #endif
                }
                entry = (++sp->cur_rx) % RX_RING_SIZE;
        }