olympic: convert to internal network device stats
authorStephen Hemminger <shemminger@linux-foundation.org>
Fri, 9 Jan 2009 13:01:23 +0000 (13:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Jan 2009 22:02:29 +0000 (14:02 -0800)
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tokenring/olympic.c
drivers/net/tokenring/olympic.h

index ecb5c7c969105ff6d79622f17f50a47c6ea3bd3e..71fed1e202238a36c320647d4d55c3ee158a116c 100644 (file)
@@ -187,7 +187,6 @@ static int olympic_close(struct net_device *dev);
 static void olympic_set_rx_mode(struct net_device *dev);
 static void olympic_freemem(struct net_device *dev) ;  
 static irqreturn_t olympic_interrupt(int irq, void *dev_id);
-static struct net_device_stats * olympic_get_stats(struct net_device *dev);
 static int olympic_set_mac_address(struct net_device *dev, void *addr) ; 
 static void olympic_arb_cmd(struct net_device *dev);
 static int olympic_change_mtu(struct net_device *dev, int mtu);
@@ -259,7 +258,6 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
        dev->stop=&olympic_close;
        dev->do_ioctl=NULL;
        dev->set_multicast_list=&olympic_set_rx_mode;
-       dev->get_stats=&olympic_get_stats ;
        dev->set_mac_address=&olympic_set_mac_address ;  
        SET_NETDEV_DEV(dev, &pdev->dev);
 
@@ -785,7 +783,7 @@ static void olympic_rx(struct net_device *dev)
                                } 
                                olympic_priv->rx_ring_last_received += i ; 
                                olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; 
-                               olympic_priv->olympic_stats.rx_errors++;         
+                               dev->stats.rx_errors++;
                        } else {        
                        
                                if (buffer_cnt == 1) {
@@ -796,7 +794,7 @@ static void olympic_rx(struct net_device *dev)
 
                                if (skb == NULL) {
                                        printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n",dev->name) ;
-                                       olympic_priv->olympic_stats.rx_dropped++ ; 
+                                       dev->stats.rx_dropped++;
                                        /* Update counters even though we don't transfer the frame */
                                        olympic_priv->rx_ring_last_received += i ; 
                                        olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ;  
@@ -862,8 +860,8 @@ static void olympic_rx(struct net_device *dev)
                                                skb->protocol = tr_type_trans(skb,dev);
                                                netif_rx(skb) ; 
                                        } 
-                                       olympic_priv->olympic_stats.rx_packets++ ; 
-                                       olympic_priv->olympic_stats.rx_bytes += length ; 
+                                       dev->stats.rx_packets++ ;
+                                       dev->stats.rx_bytes += length ;
                                } /* if skb == null */
                        } /* If status & 0x3b */
 
@@ -971,8 +969,8 @@ static irqreturn_t olympic_interrupt(int irq, void *dev_id)
                                olympic_priv->tx_ring_last_status++;
                                olympic_priv->tx_ring_last_status &= (OLYMPIC_TX_RING_SIZE-1);
                                olympic_priv->free_tx_ring_entries++;
-                               olympic_priv->olympic_stats.tx_bytes += olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len;
-                               olympic_priv->olympic_stats.tx_packets++ ; 
+                               dev->stats.tx_bytes += olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len;
+                               dev->stats.tx_packets++ ;
                                pci_unmap_single(olympic_priv->pdev, 
                                        le32_to_cpu(olympic_priv->olympic_tx_ring[olympic_priv->tx_ring_last_status].buffer), 
                                        olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len,PCI_DMA_TODEVICE);
@@ -1344,13 +1342,6 @@ static void olympic_srb_bh(struct net_device *dev)
 
 } 
 
-static struct net_device_stats * olympic_get_stats(struct net_device *dev)
-{
-       struct olympic_private *olympic_priv ;
-       olympic_priv=netdev_priv(dev);
-       return (struct net_device_stats *) &olympic_priv->olympic_stats; 
-}
-
 static int olympic_set_mac_address (struct net_device *dev, void *addr) 
 {
        struct sockaddr *saddr = addr ; 
index 10fbba08978f4592666d92c6f4f55369589de825..30631bae4c9481e6676911e20659c285c74c2ec1 100644 (file)
@@ -275,7 +275,6 @@ struct olympic_private {
        struct sk_buff *tx_ring_skb[OLYMPIC_TX_RING_SIZE], *rx_ring_skb[OLYMPIC_RX_RING_SIZE];  
        int tx_ring_free, tx_ring_last_status, rx_ring_last_received,rx_status_last_received, free_tx_ring_entries;
 
-       struct net_device_stats olympic_stats ;
        u16 olympic_lan_status ;
        u8 olympic_ring_speed ;
        u16 pkt_buf_sz ;