summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatvejchikov Ilya <matvejchikov@gmail.com>2011-08-03 22:12:15 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-03 22:12:15 -0400
commitf3f70bf6ac256b2c016e4f4561769f63dfb7c8f2 (patch)
treedf50139760d26623db996e2af0f4eb893c2e05f1
parent0d1d5875ef6c7903ab86ae3ecdbc78a5ca2e44ee (diff)
slip: cleanup statistics generation
Remove unused tx_compressed, tx_compressed and tx_misses fields from the slip structure. Also, make some device stats generation cleanups. Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/slip.c29
-rw-r--r--drivers/net/slip.h9
2 files changed, 14 insertions, 24 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index f11b3f3df24f..cbe8865e322a 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -562,34 +562,33 @@ static struct rtnl_link_stats64 *
562sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) 562sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
563{ 563{
564 struct net_device_stats *devstats = &dev->stats; 564 struct net_device_stats *devstats = &dev->stats;
565 unsigned long c_rx_dropped = 0;
566#ifdef SL_INCLUDE_CSLIP 565#ifdef SL_INCLUDE_CSLIP
567 unsigned long c_rx_fifo_errors = 0;
568 unsigned long c_tx_fifo_errors = 0;
569 unsigned long c_collisions = 0;
570 struct slip *sl = netdev_priv(dev); 566 struct slip *sl = netdev_priv(dev);
571 struct slcompress *comp = sl->slcomp; 567 struct slcompress *comp = sl->slcomp;
572
573 if (comp) {
574 c_rx_fifo_errors = comp->sls_i_compressed;
575 c_rx_dropped = comp->sls_i_tossed;
576 c_tx_fifo_errors = comp->sls_o_compressed;
577 c_collisions = comp->sls_o_misses;
578 }
579 stats->rx_fifo_errors = sl->rx_compressed + c_rx_fifo_errors;
580 stats->tx_fifo_errors = sl->tx_compressed + c_tx_fifo_errors;
581 stats->collisions = sl->tx_misses + c_collisions;
582#endif 568#endif
583 stats->rx_packets = devstats->rx_packets; 569 stats->rx_packets = devstats->rx_packets;
584 stats->tx_packets = devstats->tx_packets; 570 stats->tx_packets = devstats->tx_packets;
585 stats->rx_bytes = devstats->rx_bytes; 571 stats->rx_bytes = devstats->rx_bytes;
586 stats->tx_bytes = devstats->tx_bytes; 572 stats->tx_bytes = devstats->tx_bytes;
587 stats->rx_dropped = devstats->rx_dropped + c_rx_dropped; 573 stats->rx_dropped = devstats->rx_dropped;
588 stats->tx_dropped = devstats->tx_dropped; 574 stats->tx_dropped = devstats->tx_dropped;
589 stats->tx_errors = devstats->tx_errors; 575 stats->tx_errors = devstats->tx_errors;
590 stats->rx_errors = devstats->rx_errors; 576 stats->rx_errors = devstats->rx_errors;
591 stats->rx_over_errors = devstats->rx_over_errors; 577 stats->rx_over_errors = devstats->rx_over_errors;
592 578
579#ifdef SL_INCLUDE_CSLIP
580 if (comp) {
581 /* Generic compressed statistics */
582 stats->rx_compressed = comp->sls_i_compressed;
583 stats->tx_compressed = comp->sls_o_compressed;
584
585 /* Are we really still needs this? */
586 stats->rx_fifo_errors += comp->sls_i_compressed;
587 stats->rx_dropped += comp->sls_i_tossed;
588 stats->tx_fifo_errors += comp->sls_o_compressed;
589 stats->collisions += comp->sls_o_misses;
590 }
591#endif
593 return stats; 592 return stats;
594} 593}
595 594
diff --git a/drivers/net/slip.h b/drivers/net/slip.h
index aa0764ce2342..67673cf1266b 100644
--- a/drivers/net/slip.h
+++ b/drivers/net/slip.h
@@ -65,15 +65,6 @@ struct slip {
65 unsigned char *xbuff; /* transmitter buffer */ 65 unsigned char *xbuff; /* transmitter buffer */
66 unsigned char *xhead; /* pointer to next byte to XMIT */ 66 unsigned char *xhead; /* pointer to next byte to XMIT */
67 int xleft; /* bytes left in XMIT queue */ 67 int xleft; /* bytes left in XMIT queue */
68
69 /* SLIP interface statistics. */
70#ifdef SL_INCLUDE_CSLIP
71 unsigned long tx_compressed;
72 unsigned long rx_compressed;
73 unsigned long tx_misses;
74#endif
75 /* Detailed SLIP statistics. */
76
77 int mtu; /* Our mtu (to spot changes!) */ 68 int mtu; /* Our mtu (to spot changes!) */
78 int buffsize; /* Max buffers sizes */ 69 int buffsize; /* Max buffers sizes */
79 70