diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-07-09 05:07:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-09 19:48:35 -0400 |
commit | ff458f6f1e464ee5239bcf37af4028c01d0ccf45 (patch) | |
tree | e0597ddb6c55d1ff482410d128ada9595af2b9fe | |
parent | 21621e93f24b5f8de8262ace269a5f692a826bed (diff) |
arc_emac: Use net_device_stats from struct net_device
Instead of using a private copy of struct net_device_stats in struct
arc_emac_priv, use stats from struct net_device.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/arc/emac.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/arc/emac_main.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/ethernet/arc/emac.h b/drivers/net/ethernet/arc/emac.h index 53f85bf71526..8e7c1a101af7 100644 --- a/drivers/net/ethernet/arc/emac.h +++ b/drivers/net/ethernet/arc/emac.h | |||
@@ -110,7 +110,6 @@ struct buffer_state { | |||
110 | * @bus: Pointer to the current MII bus. | 110 | * @bus: Pointer to the current MII bus. |
111 | * @regs: Base address of EMAC memory-mapped control registers. | 111 | * @regs: Base address of EMAC memory-mapped control registers. |
112 | * @napi: Structure for NAPI. | 112 | * @napi: Structure for NAPI. |
113 | * @stats: Network device statistics. | ||
114 | * @rxbd: Pointer to Rx BD ring. | 113 | * @rxbd: Pointer to Rx BD ring. |
115 | * @txbd: Pointer to Tx BD ring. | 114 | * @txbd: Pointer to Tx BD ring. |
116 | * @rxbd_dma: DMA handle for Rx BD ring. | 115 | * @rxbd_dma: DMA handle for Rx BD ring. |
@@ -135,7 +134,6 @@ struct arc_emac_priv { | |||
135 | struct clk *clk; | 134 | struct clk *clk; |
136 | 135 | ||
137 | struct napi_struct napi; | 136 | struct napi_struct napi; |
138 | struct net_device_stats stats; | ||
139 | 137 | ||
140 | struct arc_emac_bd *rxbd; | 138 | struct arc_emac_bd *rxbd; |
141 | struct arc_emac_bd *txbd; | 139 | struct arc_emac_bd *txbd; |
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c index 18e2faccebb0..6cfcd3826df0 100644 --- a/drivers/net/ethernet/arc/emac_main.c +++ b/drivers/net/ethernet/arc/emac_main.c | |||
@@ -140,7 +140,7 @@ static const struct ethtool_ops arc_emac_ethtool_ops = { | |||
140 | static void arc_emac_tx_clean(struct net_device *ndev) | 140 | static void arc_emac_tx_clean(struct net_device *ndev) |
141 | { | 141 | { |
142 | struct arc_emac_priv *priv = netdev_priv(ndev); | 142 | struct arc_emac_priv *priv = netdev_priv(ndev); |
143 | struct net_device_stats *stats = &priv->stats; | 143 | struct net_device_stats *stats = &ndev->stats; |
144 | unsigned int i; | 144 | unsigned int i; |
145 | 145 | ||
146 | for (i = 0; i < TX_BD_NUM; i++) { | 146 | for (i = 0; i < TX_BD_NUM; i++) { |
@@ -202,7 +202,7 @@ static int arc_emac_rx(struct net_device *ndev, int budget) | |||
202 | 202 | ||
203 | for (work_done = 0; work_done < budget; work_done++) { | 203 | for (work_done = 0; work_done < budget; work_done++) { |
204 | unsigned int *last_rx_bd = &priv->last_rx_bd; | 204 | unsigned int *last_rx_bd = &priv->last_rx_bd; |
205 | struct net_device_stats *stats = &priv->stats; | 205 | struct net_device_stats *stats = &ndev->stats; |
206 | struct buffer_state *rx_buff = &priv->rx_buff[*last_rx_bd]; | 206 | struct buffer_state *rx_buff = &priv->rx_buff[*last_rx_bd]; |
207 | struct arc_emac_bd *rxbd = &priv->rxbd[*last_rx_bd]; | 207 | struct arc_emac_bd *rxbd = &priv->rxbd[*last_rx_bd]; |
208 | unsigned int pktlen, info = le32_to_cpu(rxbd->info); | 208 | unsigned int pktlen, info = le32_to_cpu(rxbd->info); |
@@ -318,7 +318,7 @@ static irqreturn_t arc_emac_intr(int irq, void *dev_instance) | |||
318 | { | 318 | { |
319 | struct net_device *ndev = dev_instance; | 319 | struct net_device *ndev = dev_instance; |
320 | struct arc_emac_priv *priv = netdev_priv(ndev); | 320 | struct arc_emac_priv *priv = netdev_priv(ndev); |
321 | struct net_device_stats *stats = &priv->stats; | 321 | struct net_device_stats *stats = &ndev->stats; |
322 | unsigned int status; | 322 | unsigned int status; |
323 | 323 | ||
324 | status = arc_reg_get(priv, R_STATUS); | 324 | status = arc_reg_get(priv, R_STATUS); |
@@ -529,7 +529,7 @@ static int arc_emac_stop(struct net_device *ndev) | |||
529 | static struct net_device_stats *arc_emac_stats(struct net_device *ndev) | 529 | static struct net_device_stats *arc_emac_stats(struct net_device *ndev) |
530 | { | 530 | { |
531 | struct arc_emac_priv *priv = netdev_priv(ndev); | 531 | struct arc_emac_priv *priv = netdev_priv(ndev); |
532 | struct net_device_stats *stats = &priv->stats; | 532 | struct net_device_stats *stats = &ndev->stats; |
533 | unsigned long miss, rxerr; | 533 | unsigned long miss, rxerr; |
534 | u8 rxcrc, rxfram, rxoflow; | 534 | u8 rxcrc, rxfram, rxoflow; |
535 | 535 | ||
@@ -565,7 +565,7 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) | |||
565 | { | 565 | { |
566 | struct arc_emac_priv *priv = netdev_priv(ndev); | 566 | struct arc_emac_priv *priv = netdev_priv(ndev); |
567 | unsigned int len, *txbd_curr = &priv->txbd_curr; | 567 | unsigned int len, *txbd_curr = &priv->txbd_curr; |
568 | struct net_device_stats *stats = &priv->stats; | 568 | struct net_device_stats *stats = &ndev->stats; |
569 | __le32 *info = &priv->txbd[*txbd_curr].info; | 569 | __le32 *info = &priv->txbd[*txbd_curr].info; |
570 | dma_addr_t addr; | 570 | dma_addr_t addr; |
571 | 571 | ||