prism54: convert to internal net_device_stats
authorStephen Hemminger <shemminger@vyatta.com>
Fri, 20 Mar 2009 19:36:35 +0000 (19:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Mar 2009 05:51:23 +0000 (22:51 -0700)
Also, make ethtool_ops const as it should be, and get rid
of useless cast.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/prism54/islpci_dev.c
drivers/net/wireless/prism54/islpci_dev.h
drivers/net/wireless/prism54/islpci_eth.c

index 6e7d71c..166ed95 100644 (file)
@@ -43,7 +43,6 @@
 
 static int prism54_bring_down(islpci_private *);
 static int islpci_alloc_memory(islpci_private *);
-static struct net_device_stats *islpci_statistics(struct net_device *);
 
 /* Temporary dummy MAC address to use until firmware is loaded.
  * The idea there is that some tools (such as nameif) may query
@@ -614,18 +613,6 @@ islpci_reset(islpci_private *priv, int reload_firmware)
        return rc;
 }
 
-static struct net_device_stats *
-islpci_statistics(struct net_device *ndev)
-{
-       islpci_private *priv = netdev_priv(ndev);
-
-#if VERBOSE > SHOW_ERROR_MESSAGES
-       DEBUG(SHOW_FUNCTION_CALLS, "islpci_statistics\n");
-#endif
-
-       return &priv->statistics;
-}
-
 /******************************************************************************
     Network device configuration functions
 ******************************************************************************/
@@ -811,7 +798,6 @@ static const struct ethtool_ops islpci_ethtool_ops = {
 static const struct net_device_ops islpci_netdev_ops = {
        .ndo_open               = islpci_open,
        .ndo_stop               = islpci_close,
-       .ndo_get_stats          = islpci_statistics,
        .ndo_do_ioctl           = prism54_ioctl,
        .ndo_start_xmit         = islpci_eth_transmit,
        .ndo_tx_timeout         = islpci_eth_tx_timeout,
index 8e55a5f..c4d0f19 100644 (file)
@@ -158,9 +158,6 @@ typedef struct {
        dma_addr_t pci_map_tx_address[ISL38XX_CB_TX_QSIZE];
        dma_addr_t pci_map_rx_address[ISL38XX_CB_RX_QSIZE];
 
-       /* driver network interface members */
-       struct net_device_stats statistics;
-
        /* wait for a reset interrupt */
        wait_queue_head_t reset_done;
 
index 88895bd..ef3ef45 100644 (file)
@@ -231,8 +231,8 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 
        /* set the transmission time */
        ndev->trans_start = jiffies;
-       priv->statistics.tx_packets++;
-       priv->statistics.tx_bytes += skb->len;
+       ndev->stats.tx_packets++;
+       ndev->stats.tx_bytes += skb->len;
 
        /* trigger the device */
        islpci_trigger(priv);
@@ -243,7 +243,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
        return 0;
 
       drop_free:
-       priv->statistics.tx_dropped++;
+       ndev->stats.tx_dropped++;
        spin_unlock_irqrestore(&priv->slock, flags);
        dev_kfree_skb(skb);
        return err;
@@ -408,8 +408,8 @@ islpci_eth_receive(islpci_private *priv)
                skb->protocol = eth_type_trans(skb, ndev);
        }
        skb->ip_summed = CHECKSUM_NONE;
-       priv->statistics.rx_packets++;
-       priv->statistics.rx_bytes += size;
+       ndev->stats.rx_packets++;
+       ndev->stats.rx_bytes += size;
 
        /* deliver the skb to the network layer */
 #ifdef ISLPCI_ETH_DEBUG
@@ -497,10 +497,9 @@ void
 islpci_eth_tx_timeout(struct net_device *ndev)
 {
        islpci_private *priv = netdev_priv(ndev);
-       struct net_device_stats *statistics = &priv->statistics;
 
        /* increment the transmit error counter */
-       statistics->tx_errors++;
+       ndev->stats.tx_errors++;
 
        if (!priv->reset_task_pending) {
                printk(KERN_WARNING