diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2017-04-07 04:17:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-07 10:03:33 -0400 |
commit | e807bcc7b98b1f9f293c2b587de1c36f258b12bf (patch) | |
tree | f6913c64a48850dff66c60a498cbcdc9d24be4bc /drivers/net/ethernet/sun/sunhme.c | |
parent | 0ffa9373a06c65e32a05d35656b2260857d1e5ce (diff) |
net: sunhme: Use net_device_stats from struct net_device
Instead of using a private copy of struct net_device_stats in struct
happy_meal, use stats from struct net_device.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun/sunhme.c')
-rw-r--r-- | drivers/net/ethernet/sun/sunhme.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 53ff66ef53ac..a6cc9a2d41c1 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c | |||
@@ -933,7 +933,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) | |||
933 | /* hp->happy_lock must be held */ | 933 | /* hp->happy_lock must be held */ |
934 | static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) | 934 | static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) |
935 | { | 935 | { |
936 | struct net_device_stats *stats = &hp->net_stats; | 936 | struct net_device_stats *stats = &hp->dev->stats; |
937 | 937 | ||
938 | stats->rx_crc_errors += hme_read32(hp, bregs + BMAC_RCRCECTR); | 938 | stats->rx_crc_errors += hme_read32(hp, bregs + BMAC_RCRCECTR); |
939 | hme_write32(hp, bregs + BMAC_RCRCECTR, 0); | 939 | hme_write32(hp, bregs + BMAC_RCRCECTR, 0); |
@@ -1947,7 +1947,7 @@ static void happy_meal_tx(struct happy_meal *hp) | |||
1947 | break; | 1947 | break; |
1948 | } | 1948 | } |
1949 | hp->tx_skbs[elem] = NULL; | 1949 | hp->tx_skbs[elem] = NULL; |
1950 | hp->net_stats.tx_bytes += skb->len; | 1950 | dev->stats.tx_bytes += skb->len; |
1951 | 1951 | ||
1952 | for (frag = 0; frag <= skb_shinfo(skb)->nr_frags; frag++) { | 1952 | for (frag = 0; frag <= skb_shinfo(skb)->nr_frags; frag++) { |
1953 | dma_addr = hme_read_desc32(hp, &this->tx_addr); | 1953 | dma_addr = hme_read_desc32(hp, &this->tx_addr); |
@@ -1964,7 +1964,7 @@ static void happy_meal_tx(struct happy_meal *hp) | |||
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | dev_kfree_skb_irq(skb); | 1966 | dev_kfree_skb_irq(skb); |
1967 | hp->net_stats.tx_packets++; | 1967 | dev->stats.tx_packets++; |
1968 | } | 1968 | } |
1969 | hp->tx_old = elem; | 1969 | hp->tx_old = elem; |
1970 | TXD((">")); | 1970 | TXD((">")); |
@@ -2009,17 +2009,17 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) | |||
2009 | /* Check for errors. */ | 2009 | /* Check for errors. */ |
2010 | if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { | 2010 | if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { |
2011 | RXD(("ERR(%08x)]", flags)); | 2011 | RXD(("ERR(%08x)]", flags)); |
2012 | hp->net_stats.rx_errors++; | 2012 | dev->stats.rx_errors++; |
2013 | if (len < ETH_ZLEN) | 2013 | if (len < ETH_ZLEN) |
2014 | hp->net_stats.rx_length_errors++; | 2014 | dev->stats.rx_length_errors++; |
2015 | if (len & (RXFLAG_OVERFLOW >> 16)) { | 2015 | if (len & (RXFLAG_OVERFLOW >> 16)) { |
2016 | hp->net_stats.rx_over_errors++; | 2016 | dev->stats.rx_over_errors++; |
2017 | hp->net_stats.rx_fifo_errors++; | 2017 | dev->stats.rx_fifo_errors++; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | /* Return it to the Happy meal. */ | 2020 | /* Return it to the Happy meal. */ |
2021 | drop_it: | 2021 | drop_it: |
2022 | hp->net_stats.rx_dropped++; | 2022 | dev->stats.rx_dropped++; |
2023 | hme_write_rxd(hp, this, | 2023 | hme_write_rxd(hp, this, |
2024 | (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)), | 2024 | (RXFLAG_OWN|((RX_BUF_ALLOC_SIZE-RX_OFFSET)<<16)), |
2025 | dma_addr); | 2025 | dma_addr); |
@@ -2084,8 +2084,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) | |||
2084 | skb->protocol = eth_type_trans(skb, dev); | 2084 | skb->protocol = eth_type_trans(skb, dev); |
2085 | netif_rx(skb); | 2085 | netif_rx(skb); |
2086 | 2086 | ||
2087 | hp->net_stats.rx_packets++; | 2087 | dev->stats.rx_packets++; |
2088 | hp->net_stats.rx_bytes += len; | 2088 | dev->stats.rx_bytes += len; |
2089 | next: | 2089 | next: |
2090 | elem = NEXT_RX(elem); | 2090 | elem = NEXT_RX(elem); |
2091 | this = &rxbase[elem]; | 2091 | this = &rxbase[elem]; |
@@ -2396,7 +2396,7 @@ static struct net_device_stats *happy_meal_get_stats(struct net_device *dev) | |||
2396 | happy_meal_get_counters(hp, hp->bigmacregs); | 2396 | happy_meal_get_counters(hp, hp->bigmacregs); |
2397 | spin_unlock_irq(&hp->happy_lock); | 2397 | spin_unlock_irq(&hp->happy_lock); |
2398 | 2398 | ||
2399 | return &hp->net_stats; | 2399 | return &dev->stats; |
2400 | } | 2400 | } |
2401 | 2401 | ||
2402 | static void happy_meal_set_multicast(struct net_device *dev) | 2402 | static void happy_meal_set_multicast(struct net_device *dev) |