aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2009-01-09 08:01:21 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 17:02:27 -0500
commit37423fff4f02fcf6867971dfd678e99a34efeab3 (patch)
treec0a98ef1c8272bb99aa7c3ff639448b62c589a0c /drivers/net/tokenring
parentc86d87402966dc3f1996d17ef6bc2b676b46bb60 (diff)
lanstreamer: convert to internal network stats
Use internal network_device_stats to keep track of statistics. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r--drivers/net/tokenring/lanstreamer.c19
-rw-r--r--drivers/net/tokenring/lanstreamer.h1
2 files changed, 5 insertions, 15 deletions
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 239c75217b12..ecfa564489c4 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -207,7 +207,6 @@ static int streamer_xmit(struct sk_buff *skb, struct net_device *dev);
207static int streamer_close(struct net_device *dev); 207static int streamer_close(struct net_device *dev);
208static void streamer_set_rx_mode(struct net_device *dev); 208static void streamer_set_rx_mode(struct net_device *dev);
209static irqreturn_t streamer_interrupt(int irq, void *dev_id); 209static irqreturn_t streamer_interrupt(int irq, void *dev_id);
210static struct net_device_stats *streamer_get_stats(struct net_device *dev);
211static int streamer_set_mac_address(struct net_device *dev, void *addr); 210static int streamer_set_mac_address(struct net_device *dev, void *addr);
212static void streamer_arb_cmd(struct net_device *dev); 211static void streamer_arb_cmd(struct net_device *dev);
213static int streamer_change_mtu(struct net_device *dev, int mtu); 212static int streamer_change_mtu(struct net_device *dev, int mtu);
@@ -331,7 +330,6 @@ static int __devinit streamer_init_one(struct pci_dev *pdev,
331 dev->do_ioctl = NULL; 330 dev->do_ioctl = NULL;
332#endif 331#endif
333 dev->set_multicast_list = &streamer_set_rx_mode; 332 dev->set_multicast_list = &streamer_set_rx_mode;
334 dev->get_stats = &streamer_get_stats;
335 dev->set_mac_address = &streamer_set_mac_address; 333 dev->set_mac_address = &streamer_set_mac_address;
336 dev->irq = pdev->irq; 334 dev->irq = pdev->irq;
337 dev->base_addr=pio_start; 335 dev->base_addr=pio_start;
@@ -937,7 +935,7 @@ static void streamer_rx(struct net_device *dev)
937 if (skb == NULL) 935 if (skb == NULL)
938 { 936 {
939 printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n", dev->name); 937 printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n", dev->name);
940 streamer_priv->streamer_stats.rx_dropped++; 938 dev->stats.rx_dropped++;
941 } else { /* we allocated an skb OK */ 939 } else { /* we allocated an skb OK */
942 if (buffer_cnt == 1) { 940 if (buffer_cnt == 1) {
943 /* release the DMA mapping */ 941 /* release the DMA mapping */
@@ -1009,8 +1007,8 @@ static void streamer_rx(struct net_device *dev)
1009 /* send up to the protocol */ 1007 /* send up to the protocol */
1010 netif_rx(skb); 1008 netif_rx(skb);
1011 } 1009 }
1012 streamer_priv->streamer_stats.rx_packets++; 1010 dev->stats.rx_packets++;
1013 streamer_priv->streamer_stats.rx_bytes += length; 1011 dev->stats.rx_bytes += length;
1014 } /* if skb == null */ 1012 } /* if skb == null */
1015 } /* end received without errors */ 1013 } /* end received without errors */
1016 1014
@@ -1053,8 +1051,8 @@ static irqreturn_t streamer_interrupt(int irq, void *dev_id)
1053 while(streamer_priv->streamer_tx_ring[(streamer_priv->tx_ring_last_status + 1) & (STREAMER_TX_RING_SIZE - 1)].status) { 1051 while(streamer_priv->streamer_tx_ring[(streamer_priv->tx_ring_last_status + 1) & (STREAMER_TX_RING_SIZE - 1)].status) {
1054 streamer_priv->tx_ring_last_status = (streamer_priv->tx_ring_last_status + 1) & (STREAMER_TX_RING_SIZE - 1); 1052 streamer_priv->tx_ring_last_status = (streamer_priv->tx_ring_last_status + 1) & (STREAMER_TX_RING_SIZE - 1);
1055 streamer_priv->free_tx_ring_entries++; 1053 streamer_priv->free_tx_ring_entries++;
1056 streamer_priv->streamer_stats.tx_bytes += streamer_priv->tx_ring_skb[streamer_priv->tx_ring_last_status]->len; 1054 dev->stats.tx_bytes += streamer_priv->tx_ring_skb[streamer_priv->tx_ring_last_status]->len;
1057 streamer_priv->streamer_stats.tx_packets++; 1055 dev->stats.tx_packets++;
1058 dev_kfree_skb_irq(streamer_priv->tx_ring_skb[streamer_priv->tx_ring_last_status]); 1056 dev_kfree_skb_irq(streamer_priv->tx_ring_skb[streamer_priv->tx_ring_last_status]);
1059 streamer_priv->streamer_tx_ring[streamer_priv->tx_ring_last_status].buffer = 0xdeadbeef; 1057 streamer_priv->streamer_tx_ring[streamer_priv->tx_ring_last_status].buffer = 0xdeadbeef;
1060 streamer_priv->streamer_tx_ring[streamer_priv->tx_ring_last_status].status = 0; 1058 streamer_priv->streamer_tx_ring[streamer_priv->tx_ring_last_status].status = 0;
@@ -1484,13 +1482,6 @@ static void streamer_srb_bh(struct net_device *dev)
1484 } /* switch srb[0] */ 1482 } /* switch srb[0] */
1485} 1483}
1486 1484
1487static struct net_device_stats *streamer_get_stats(struct net_device *dev)
1488{
1489 struct streamer_private *streamer_priv;
1490 streamer_priv = netdev_priv(dev);
1491 return (struct net_device_stats *) &streamer_priv->streamer_stats;
1492}
1493
1494static int streamer_set_mac_address(struct net_device *dev, void *addr) 1485static int streamer_set_mac_address(struct net_device *dev, void *addr)
1495{ 1486{
1496 struct sockaddr *saddr = addr; 1487 struct sockaddr *saddr = addr;
diff --git a/drivers/net/tokenring/lanstreamer.h b/drivers/net/tokenring/lanstreamer.h
index 13ccee6449c1..3c58d6a3fbc9 100644
--- a/drivers/net/tokenring/lanstreamer.h
+++ b/drivers/net/tokenring/lanstreamer.h
@@ -299,7 +299,6 @@ struct streamer_private {
299 int tx_ring_free, tx_ring_last_status, rx_ring_last_received, 299 int tx_ring_free, tx_ring_last_status, rx_ring_last_received,
300 free_tx_ring_entries; 300 free_tx_ring_entries;
301 301
302 struct net_device_stats streamer_stats;
303 __u16 streamer_lan_status; 302 __u16 streamer_lan_status;
304 __u8 streamer_ring_speed; 303 __u8 streamer_ring_speed;
305 __u16 pkt_buf_sz; 304 __u16 pkt_buf_sz;