aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tehuti.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tehuti.c')
-rw-r--r--drivers/net/tehuti.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 737df6032bbc..8b3dc1eb4015 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -92,7 +92,7 @@ static void bdx_rx_free(struct bdx_priv *priv);
92static void bdx_tx_free(struct bdx_priv *priv); 92static void bdx_tx_free(struct bdx_priv *priv);
93 93
94/* Definitions needed by bdx_probe */ 94/* Definitions needed by bdx_probe */
95static void bdx_ethtool_ops(struct net_device *netdev); 95static void bdx_set_ethtool_ops(struct net_device *netdev);
96 96
97/************************************************************************* 97/*************************************************************************
98 * Print Info * 98 * Print Info *
@@ -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,15 +1294,16 @@ 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->protocol = eth_type_trans(skb, ndev);
1307 skb->protocol = eth_type_trans(skb, priv->ndev);
1308 1301
1309 /* Non-IP packets aren't checksum-offloaded */ 1302 /* Non-IP packets aren't checksum-offloaded */
1310 if (GET_RXD_PKT_ID(rxd_val1) == 0) 1303 if (GET_RXD_PKT_ID(rxd_val1) == 0)
1311 skb->ip_summed = CHECKSUM_NONE; 1304 skb_checksum_none_assert(skb);
1305 else
1306 skb->ip_summed = CHECKSUM_UNNECESSARY;
1312 1307
1313 NETIF_RX_MUX(priv, rxd_val1, rxd_vlan, skb); 1308 NETIF_RX_MUX(priv, rxd_val1, rxd_vlan, skb);
1314 1309
@@ -1316,7 +1311,7 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
1316 break; 1311 break;
1317 } 1312 }
1318 1313
1319 priv->net_stats.rx_packets += done; 1314 ndev->stats.rx_packets += done;
1320 1315
1321 /* FIXME: do smth to minimize pci accesses */ 1316 /* FIXME: do smth to minimize pci accesses */
1322 WRITE_REG(priv, f->m.reg_RPTR, f->m.rptr & TXF_WPTR_WR_PTR); 1317 WRITE_REG(priv, f->m.reg_RPTR, f->m.rptr & TXF_WPTR_WR_PTR);
@@ -1712,8 +1707,8 @@ static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb,
1712#ifdef BDX_LLTX 1707#ifdef BDX_LLTX
1713 ndev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */ 1708 ndev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
1714#endif 1709#endif
1715 priv->net_stats.tx_packets++; 1710 ndev->stats.tx_packets++;
1716 priv->net_stats.tx_bytes += skb->len; 1711 ndev->stats.tx_bytes += skb->len;
1717 1712
1718 if (priv->tx_level < BDX_MIN_TX_LEVEL) { 1713 if (priv->tx_level < BDX_MIN_TX_LEVEL) {
1719 DBG("%s: %s: TX Q STOP level %d\n", 1714 DBG("%s: %s: TX Q STOP level %d\n",
@@ -1888,7 +1883,6 @@ static const struct net_device_ops bdx_netdev_ops = {
1888 .ndo_validate_addr = eth_validate_addr, 1883 .ndo_validate_addr = eth_validate_addr,
1889 .ndo_do_ioctl = bdx_ioctl, 1884 .ndo_do_ioctl = bdx_ioctl,
1890 .ndo_set_multicast_list = bdx_setmulti, 1885 .ndo_set_multicast_list = bdx_setmulti,
1891 .ndo_get_stats = bdx_get_stats,
1892 .ndo_change_mtu = bdx_change_mtu, 1886 .ndo_change_mtu = bdx_change_mtu,
1893 .ndo_set_mac_address = bdx_set_mac, 1887 .ndo_set_mac_address = bdx_set_mac,
1894 .ndo_vlan_rx_register = bdx_vlan_rx_register, 1888 .ndo_vlan_rx_register = bdx_vlan_rx_register,
@@ -2012,7 +2006,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2012 ndev->netdev_ops = &bdx_netdev_ops; 2006 ndev->netdev_ops = &bdx_netdev_ops;
2013 ndev->tx_queue_len = BDX_NDEV_TXQ_LEN; 2007 ndev->tx_queue_len = BDX_NDEV_TXQ_LEN;
2014 2008
2015 bdx_ethtool_ops(ndev); /* ethtool interface */ 2009 bdx_set_ethtool_ops(ndev); /* ethtool interface */
2016 2010
2017 /* these fields are used for info purposes only 2011 /* these fields are used for info purposes only
2018 * so we can have them same for all ports of the board */ 2012 * so we can have them same for all ports of the board */
@@ -2417,10 +2411,10 @@ static void bdx_get_ethtool_stats(struct net_device *netdev,
2417} 2411}
2418 2412
2419/* 2413/*
2420 * bdx_ethtool_ops - ethtool interface implementation 2414 * bdx_set_ethtool_ops - ethtool interface implementation
2421 * @netdev 2415 * @netdev
2422 */ 2416 */
2423static void bdx_ethtool_ops(struct net_device *netdev) 2417static void bdx_set_ethtool_ops(struct net_device *netdev)
2424{ 2418{
2425 static const struct ethtool_ops bdx_ethtool_ops = { 2419 static const struct ethtool_ops bdx_ethtool_ops = {
2426 .get_settings = bdx_get_settings, 2420 .get_settings = bdx_get_settings,