Commit 6456fffb authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

prism54: convert to internal net_device_stats

Also, make ethtool_ops const as it should be, and get rid
of useless cast.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6685254f
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
static int prism54_bring_down(islpci_private *); static int prism54_bring_down(islpci_private *);
static int islpci_alloc_memory(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. /* Temporary dummy MAC address to use until firmware is loaded.
* The idea there is that some tools (such as nameif) may query * The idea there is that some tools (such as nameif) may query
...@@ -614,18 +613,6 @@ islpci_reset(islpci_private *priv, int reload_firmware) ...@@ -614,18 +613,6 @@ islpci_reset(islpci_private *priv, int reload_firmware)
return rc; 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 Network device configuration functions
******************************************************************************/ ******************************************************************************/
...@@ -811,7 +798,6 @@ static const struct ethtool_ops islpci_ethtool_ops = { ...@@ -811,7 +798,6 @@ static const struct ethtool_ops islpci_ethtool_ops = {
static const struct net_device_ops islpci_netdev_ops = { static const struct net_device_ops islpci_netdev_ops = {
.ndo_open = islpci_open, .ndo_open = islpci_open,
.ndo_stop = islpci_close, .ndo_stop = islpci_close,
.ndo_get_stats = islpci_statistics,
.ndo_do_ioctl = prism54_ioctl, .ndo_do_ioctl = prism54_ioctl,
.ndo_start_xmit = islpci_eth_transmit, .ndo_start_xmit = islpci_eth_transmit,
.ndo_tx_timeout = islpci_eth_tx_timeout, .ndo_tx_timeout = islpci_eth_tx_timeout,
......
...@@ -158,9 +158,6 @@ typedef struct { ...@@ -158,9 +158,6 @@ typedef struct {
dma_addr_t pci_map_tx_address[ISL38XX_CB_TX_QSIZE]; dma_addr_t pci_map_tx_address[ISL38XX_CB_TX_QSIZE];
dma_addr_t pci_map_rx_address[ISL38XX_CB_RX_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 for a reset interrupt */
wait_queue_head_t reset_done; wait_queue_head_t reset_done;
......
...@@ -231,8 +231,8 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -231,8 +231,8 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
/* set the transmission time */ /* set the transmission time */
ndev->trans_start = jiffies; ndev->trans_start = jiffies;
priv->statistics.tx_packets++; ndev->stats.tx_packets++;
priv->statistics.tx_bytes += skb->len; ndev->stats.tx_bytes += skb->len;
/* trigger the device */ /* trigger the device */
islpci_trigger(priv); islpci_trigger(priv);
...@@ -243,7 +243,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -243,7 +243,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
return 0; return 0;
drop_free: drop_free:
priv->statistics.tx_dropped++; ndev->stats.tx_dropped++;
spin_unlock_irqrestore(&priv->slock, flags); spin_unlock_irqrestore(&priv->slock, flags);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return err; return err;
...@@ -408,8 +408,8 @@ islpci_eth_receive(islpci_private *priv) ...@@ -408,8 +408,8 @@ islpci_eth_receive(islpci_private *priv)
skb->protocol = eth_type_trans(skb, ndev); skb->protocol = eth_type_trans(skb, ndev);
} }
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
priv->statistics.rx_packets++; ndev->stats.rx_packets++;
priv->statistics.rx_bytes += size; ndev->stats.rx_bytes += size;
/* deliver the skb to the network layer */ /* deliver the skb to the network layer */
#ifdef ISLPCI_ETH_DEBUG #ifdef ISLPCI_ETH_DEBUG
...@@ -497,10 +497,9 @@ void ...@@ -497,10 +497,9 @@ void
islpci_eth_tx_timeout(struct net_device *ndev) islpci_eth_tx_timeout(struct net_device *ndev)
{ {
islpci_private *priv = netdev_priv(ndev); islpci_private *priv = netdev_priv(ndev);
struct net_device_stats *statistics = &priv->statistics;
/* increment the transmit error counter */ /* increment the transmit error counter */
statistics->tx_errors++; ndev->stats.tx_errors++;
if (!priv->reset_task_pending) { if (!priv->reset_task_pending) {
printk(KERN_WARNING printk(KERN_WARNING
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment