Commit d1423c7ab847e72a63e0e3512a1a7f3bce55ae01

Authored by Michał Mirosław
Committed by David S. Miller
1 parent f5d640371d

net: ps3_gelic: convert to hw_features

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 3 changed files with 5 additions and 28 deletions Side-by-side Diff

drivers/net/ps3_gelic_net.c
... ... @@ -951,7 +951,7 @@
951 951 skb->protocol = eth_type_trans(skb, netdev);
952 952  
953 953 /* checksum offload */
954   - if (card->rx_csum) {
  954 + if (netdev->features & NETIF_F_RXCSUM) {
955 955 if ((data_status & GELIC_DESCR_DATA_STATUS_CHK_MASK) &&
956 956 (!(data_error & GELIC_DESCR_DATA_ERROR_CHK_MASK)))
957 957 skb->ip_summed = CHECKSUM_UNNECESSARY;
... ... @@ -1312,21 +1312,6 @@
1312 1312 return 0;
1313 1313 }
1314 1314  
1315   -u32 gelic_net_get_rx_csum(struct net_device *netdev)
1316   -{
1317   - struct gelic_card *card = netdev_card(netdev);
1318   -
1319   - return card->rx_csum;
1320   -}
1321   -
1322   -int gelic_net_set_rx_csum(struct net_device *netdev, u32 data)
1323   -{
1324   - struct gelic_card *card = netdev_card(netdev);
1325   -
1326   - card->rx_csum = data;
1327   - return 0;
1328   -}
1329   -
1330 1315 static void gelic_net_get_wol(struct net_device *netdev,
1331 1316 struct ethtool_wolinfo *wol)
1332 1317 {
... ... @@ -1411,10 +1396,6 @@
1411 1396 .get_settings = gelic_ether_get_settings,
1412 1397 .set_settings = gelic_ether_set_settings,
1413 1398 .get_link = ethtool_op_get_link,
1414   - .get_tx_csum = ethtool_op_get_tx_csum,
1415   - .set_tx_csum = ethtool_op_set_tx_csum,
1416   - .get_rx_csum = gelic_net_get_rx_csum,
1417   - .set_rx_csum = gelic_net_set_rx_csum,
1418 1399 .get_wol = gelic_net_get_wol,
1419 1400 .set_wol = gelic_net_set_wol,
1420 1401 };
1421 1402  
... ... @@ -1512,7 +1493,11 @@
1512 1493 int status;
1513 1494 u64 v1, v2;
1514 1495  
  1496 + netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
  1497 +
1515 1498 netdev->features = NETIF_F_IP_CSUM;
  1499 + if (GELIC_CARD_RX_CSUM_DEFAULT)
  1500 + netdev->features |= NETIF_F_RXCSUM;
1516 1501  
1517 1502 status = lv1_net_control(bus_id(card), dev_id(card),
1518 1503 GELIC_LV1_GET_MAC_ADDRESS,
... ... @@ -1756,7 +1741,6 @@
1756 1741 /* setup card structure */
1757 1742 card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT |
1758 1743 GELIC_CARD_PORT_STATUS_CHANGED;
1759   - card->rx_csum = GELIC_CARD_RX_CSUM_DEFAULT;
1760 1744  
1761 1745  
1762 1746 if (gelic_card_init_chain(card, &card->tx_chain,
drivers/net/ps3_gelic_net.h
... ... @@ -290,7 +290,6 @@
290 290 struct gelic_descr_chain tx_chain;
291 291 struct gelic_descr_chain rx_chain;
292 292 int rx_dma_restart_required;
293   - int rx_csum;
294 293 /*
295 294 * tx_lock guards tx descriptor list and
296 295 * tx_dma_progress.
... ... @@ -377,8 +376,6 @@
377 376 /* shared ethtool ops */
378 377 extern void gelic_net_get_drvinfo(struct net_device *netdev,
379 378 struct ethtool_drvinfo *info);
380   -extern u32 gelic_net_get_rx_csum(struct net_device *netdev);
381   -extern int gelic_net_set_rx_csum(struct net_device *netdev, u32 data);
382 379 extern void gelic_net_poll_controller(struct net_device *netdev);
383 380  
384 381 #endif /* _GELIC_NET_H */
drivers/net/ps3_gelic_wireless.c
... ... @@ -2581,10 +2581,6 @@
2581 2581 static const struct ethtool_ops gelic_wl_ethtool_ops = {
2582 2582 .get_drvinfo = gelic_net_get_drvinfo,
2583 2583 .get_link = gelic_wl_get_link,
2584   - .get_tx_csum = ethtool_op_get_tx_csum,
2585   - .set_tx_csum = ethtool_op_set_tx_csum,
2586   - .get_rx_csum = gelic_net_get_rx_csum,
2587   - .set_rx_csum = gelic_net_set_rx_csum,
2588 2584 };
2589 2585  
2590 2586 static void __devinit gelic_wl_setup_netdev_ops(struct net_device *netdev)