aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tehuti.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-08-18 18:11:25 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 20:19:05 -0400
commit0add79e3134a618c10acabe58834ac647075111a (patch)
treedeaceee3368a255a780e3435a3f751bb550c5f9e /drivers/net/tehuti.c
parent5dbfbc4027f819c3da92844f34f241524f99c9eb (diff)
tehuti: Use net_device_stats from struct net_device
struct net_device has its own struct net_device_stats member, so use this one instead of a private copy in the bdx_priv struct. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tehuti.c')
-rw-r--r--drivers/net/tehuti.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 737df6032bbc..d808f95a87ca 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -927,13 +927,6 @@ static void bdx_update_stats(struct bdx_priv *priv)
927 BDX_ASSERT((sizeof(struct bdx_stats) / sizeof(u64)) != i); 927 BDX_ASSERT((sizeof(struct bdx_stats) / sizeof(u64)) != i);
928} 928}
929 929
930static struct net_device_stats *bdx_get_stats(struct net_device *ndev)
931{
932 struct bdx_priv *priv = netdev_priv(ndev);
933 struct net_device_stats *net_stat = &priv->net_stats;
934 return net_stat;
935}
936
937static void print_rxdd(struct rxd_desc *rxdd, u32 rxd_val1, u16 len, 930static void print_rxdd(struct rxd_desc *rxdd, u32 rxd_val1, u16 len,
938 u16 rxd_vlan); 931 u16 rxd_vlan);
939static void print_rxfd(struct rxf_desc *rxfd); 932static void print_rxfd(struct rxf_desc *rxfd);
@@ -1220,6 +1213,7 @@ static void bdx_recycle_skb(struct bdx_priv *priv, struct rxd_desc *rxdd)
1220 1213
1221static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget) 1214static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
1222{ 1215{
1216 struct net_device *ndev = priv->ndev;
1223 struct sk_buff *skb, *skb2; 1217 struct sk_buff *skb, *skb2;
1224 struct rxd_desc *rxdd; 1218 struct rxd_desc *rxdd;
1225 struct rx_map *dm; 1219 struct rx_map *dm;
@@ -1273,7 +1267,7 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
1273 1267
1274 if (unlikely(GET_RXD_ERR(rxd_val1))) { 1268 if (unlikely(GET_RXD_ERR(rxd_val1))) {
1275 DBG("rxd_err = 0x%x\n", GET_RXD_ERR(rxd_val1)); 1269 DBG("rxd_err = 0x%x\n", GET_RXD_ERR(rxd_val1));
1276 priv->net_stats.rx_errors++; 1270 ndev->stats.rx_errors++;
1277 bdx_recycle_skb(priv, rxdd); 1271 bdx_recycle_skb(priv, rxdd);
1278 continue; 1272 continue;
1279 } 1273 }
@@ -1300,11 +1294,11 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
1300 bdx_rxdb_free_elem(db, rxdd->va_lo); 1294 bdx_rxdb_free_elem(db, rxdd->va_lo);
1301 } 1295 }
1302 1296
1303 priv->net_stats.rx_bytes += len; 1297 ndev->stats.rx_bytes += len;
1304 1298
1305 skb_put(skb, len); 1299 skb_put(skb, len);
1306 skb->ip_summed = CHECKSUM_UNNECESSARY; 1300 skb->ip_summed = CHECKSUM_UNNECESSARY;
1307 skb->protocol = eth_type_trans(skb, priv->ndev); 1301 skb->protocol = eth_type_trans(skb, ndev);
1308 1302
1309 /* Non-IP packets aren't checksum-offloaded */ 1303 /* Non-IP packets aren't checksum-offloaded */
1310 if (GET_RXD_PKT_ID(rxd_val1) == 0) 1304 if (GET_RXD_PKT_ID(rxd_val1) == 0)
@@ -1316,7 +1310,7 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
1316 break; 1310 break;
1317 } 1311 }
1318 1312
1319 priv->net_stats.rx_packets += done; 1313 ndev->stats.rx_packets += done;
1320 1314
1321 /* FIXME: do smth to minimize pci accesses */ 1315 /* FIXME: do smth to minimize pci accesses */
1322 WRITE_REG(priv, f->m.reg_RPTR, f->m.rptr & TXF_WPTR_WR_PTR); 1316 WRITE_REG(priv, f->m.reg_RPTR, f->m.rptr & TXF_WPTR_WR_PTR);
@@ -1712,8 +1706,8 @@ static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb,
1712#ifdef BDX_LLTX 1706#ifdef BDX_LLTX
1713 ndev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */ 1707 ndev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
1714#endif 1708#endif
1715 priv->net_stats.tx_packets++; 1709 ndev->stats.tx_packets++;
1716 priv->net_stats.tx_bytes += skb->len; 1710 ndev->stats.tx_bytes += skb->len;
1717 1711
1718 if (priv->tx_level < BDX_MIN_TX_LEVEL) { 1712 if (priv->tx_level < BDX_MIN_TX_LEVEL) {
1719 DBG("%s: %s: TX Q STOP level %d\n", 1713 DBG("%s: %s: TX Q STOP level %d\n",
@@ -1888,7 +1882,6 @@ static const struct net_device_ops bdx_netdev_ops = {
1888 .ndo_validate_addr = eth_validate_addr, 1882 .ndo_validate_addr = eth_validate_addr,
1889 .ndo_do_ioctl = bdx_ioctl, 1883 .ndo_do_ioctl = bdx_ioctl,
1890 .ndo_set_multicast_list = bdx_setmulti, 1884 .ndo_set_multicast_list = bdx_setmulti,
1891 .ndo_get_stats = bdx_get_stats,
1892 .ndo_change_mtu = bdx_change_mtu, 1885 .ndo_change_mtu = bdx_change_mtu,
1893 .ndo_set_mac_address = bdx_set_mac, 1886 .ndo_set_mac_address = bdx_set_mac,
1894 .ndo_vlan_rx_register = bdx_vlan_rx_register, 1887 .ndo_vlan_rx_register = bdx_vlan_rx_register,