Commit 7138a0f5 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[SKY2]: use netdevice stats struct

Use builtin statistics structure from net device.
Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df3fe1f3
...@@ -1635,8 +1635,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) ...@@ -1635,8 +1635,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
printk(KERN_DEBUG "%s: tx done %u\n", printk(KERN_DEBUG "%s: tx done %u\n",
dev->name, idx); dev->name, idx);
sky2->net_stats.tx_packets++; dev->stats.tx_packets++;
sky2->net_stats.tx_bytes += re->skb->len; dev->stats.tx_bytes += re->skb->len;
dev_kfree_skb_any(re->skb); dev_kfree_skb_any(re->skb);
sky2->tx_next = RING_NEXT(idx, TX_RING_SIZE); sky2->tx_next = RING_NEXT(idx, TX_RING_SIZE);
...@@ -2204,16 +2204,16 @@ static struct sk_buff *sky2_receive(struct net_device *dev, ...@@ -2204,16 +2204,16 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
len_error: len_error:
/* Truncation of overlength packets /* Truncation of overlength packets
causes PHY length to not match MAC length */ causes PHY length to not match MAC length */
++sky2->net_stats.rx_length_errors; ++dev->stats.rx_length_errors;
if (netif_msg_rx_err(sky2) && net_ratelimit()) if (netif_msg_rx_err(sky2) && net_ratelimit())
pr_info(PFX "%s: rx length error: status %#x length %d\n", pr_info(PFX "%s: rx length error: status %#x length %d\n",
dev->name, status, length); dev->name, status, length);
goto resubmit; goto resubmit;
error: error:
++sky2->net_stats.rx_errors; ++dev->stats.rx_errors;
if (status & GMR_FS_RX_FF_OV) { if (status & GMR_FS_RX_FF_OV) {
sky2->net_stats.rx_over_errors++; dev->stats.rx_over_errors++;
goto resubmit; goto resubmit;
} }
...@@ -2222,11 +2222,11 @@ static struct sk_buff *sky2_receive(struct net_device *dev, ...@@ -2222,11 +2222,11 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
dev->name, status, length); dev->name, status, length);
if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE)) if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE))
sky2->net_stats.rx_length_errors++; dev->stats.rx_length_errors++;
if (status & GMR_FS_FRAGMENT) if (status & GMR_FS_FRAGMENT)
sky2->net_stats.rx_frame_errors++; dev->stats.rx_frame_errors++;
if (status & GMR_FS_CRC_ERR) if (status & GMR_FS_CRC_ERR)
sky2->net_stats.rx_crc_errors++; dev->stats.rx_crc_errors++;
goto resubmit; goto resubmit;
} }
...@@ -2271,7 +2271,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) ...@@ -2271,7 +2271,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
++rx[port]; ++rx[port];
skb = sky2_receive(dev, length, status); skb = sky2_receive(dev, length, status);
if (unlikely(!skb)) { if (unlikely(!skb)) {
sky2->net_stats.rx_dropped++; dev->stats.rx_dropped++;
break; break;
} }
...@@ -2286,8 +2286,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) ...@@ -2286,8 +2286,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
} }
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
sky2->net_stats.rx_packets++; dev->stats.rx_packets++;
sky2->net_stats.rx_bytes += skb->len; dev->stats.rx_bytes += skb->len;
dev->last_rx = jiffies; dev->last_rx = jiffies;
#ifdef SKY2_VLAN_TAG_USED #ifdef SKY2_VLAN_TAG_USED
...@@ -2478,12 +2478,12 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) ...@@ -2478,12 +2478,12 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port)
gma_read16(hw, port, GM_TX_IRQ_SRC); gma_read16(hw, port, GM_TX_IRQ_SRC);
if (status & GM_IS_RX_FF_OR) { if (status & GM_IS_RX_FF_OR) {
++sky2->net_stats.rx_fifo_errors; ++dev->stats.rx_fifo_errors;
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO);
} }
if (status & GM_IS_TX_FF_UR) { if (status & GM_IS_TX_FF_UR) {
++sky2->net_stats.tx_fifo_errors; ++dev->stats.tx_fifo_errors;
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU); sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU);
} }
} }
...@@ -3222,12 +3222,6 @@ static void sky2_get_strings(struct net_device *dev, u32 stringset, u8 * data) ...@@ -3222,12 +3222,6 @@ static void sky2_get_strings(struct net_device *dev, u32 stringset, u8 * data)
} }
} }
static struct net_device_stats *sky2_get_stats(struct net_device *dev)
{
struct sky2_port *sky2 = netdev_priv(dev);
return &sky2->net_stats;
}
static int sky2_set_mac_address(struct net_device *dev, void *p) static int sky2_set_mac_address(struct net_device *dev, void *p)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
...@@ -3977,7 +3971,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, ...@@ -3977,7 +3971,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
dev->stop = sky2_down; dev->stop = sky2_down;
dev->do_ioctl = sky2_ioctl; dev->do_ioctl = sky2_ioctl;
dev->hard_start_xmit = sky2_xmit_frame; dev->hard_start_xmit = sky2_xmit_frame;
dev->get_stats = sky2_get_stats;
dev->set_multicast_list = sky2_set_multicast; dev->set_multicast_list = sky2_set_multicast;
dev->set_mac_address = sky2_set_mac_address; dev->set_mac_address = sky2_set_mac_address;
dev->change_mtu = sky2_change_mtu; dev->change_mtu = sky2_change_mtu;
......
...@@ -2031,8 +2031,6 @@ struct sky2_port { ...@@ -2031,8 +2031,6 @@ struct sky2_port {
#ifdef CONFIG_SKY2_DEBUG #ifdef CONFIG_SKY2_DEBUG
struct dentry *debugfs; struct dentry *debugfs;
#endif #endif
struct net_device_stats net_stats;
}; };
struct sky2_hw { struct sky2_hw {
......
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