aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-04-10 00:49:55 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-12 17:50:43 -0400
commitd1423c7ab847e72a63e0e3512a1a7f3bce55ae01 (patch)
treebca91dad73b831f28d7ba4279a0a7666f7bffde0
parentf5d640371dacda100a32a30e8013f957aff26ce1 (diff)
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>
-rw-r--r--drivers/net/ps3_gelic_net.c26
-rw-r--r--drivers/net/ps3_gelic_net.h3
-rw-r--r--drivers/net/ps3_gelic_wireless.c4
3 files changed, 5 insertions, 28 deletions
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index ffdf7349ef7a..4383ed21813e 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -951,7 +951,7 @@ static void gelic_net_pass_skb_up(struct gelic_descr *descr,
951 skb->protocol = eth_type_trans(skb, netdev); 951 skb->protocol = eth_type_trans(skb, netdev);
952 952
953 /* checksum offload */ 953 /* checksum offload */
954 if (card->rx_csum) { 954 if (netdev->features & NETIF_F_RXCSUM) {
955 if ((data_status & GELIC_DESCR_DATA_STATUS_CHK_MASK) && 955 if ((data_status & GELIC_DESCR_DATA_STATUS_CHK_MASK) &&
956 (!(data_error & GELIC_DESCR_DATA_ERROR_CHK_MASK))) 956 (!(data_error & GELIC_DESCR_DATA_ERROR_CHK_MASK)))
957 skb->ip_summed = CHECKSUM_UNNECESSARY; 957 skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -1312,21 +1312,6 @@ static int gelic_ether_set_settings(struct net_device *netdev,
1312 return 0; 1312 return 0;
1313} 1313}
1314 1314
1315u32 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
1322int 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
1330static void gelic_net_get_wol(struct net_device *netdev, 1315static void gelic_net_get_wol(struct net_device *netdev,
1331 struct ethtool_wolinfo *wol) 1316 struct ethtool_wolinfo *wol)
1332{ 1317{
@@ -1411,10 +1396,6 @@ static const struct ethtool_ops gelic_ether_ethtool_ops = {
1411 .get_settings = gelic_ether_get_settings, 1396 .get_settings = gelic_ether_get_settings,
1412 .set_settings = gelic_ether_set_settings, 1397 .set_settings = gelic_ether_set_settings,
1413 .get_link = ethtool_op_get_link, 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 .get_wol = gelic_net_get_wol, 1399 .get_wol = gelic_net_get_wol,
1419 .set_wol = gelic_net_set_wol, 1400 .set_wol = gelic_net_set_wol,
1420}; 1401};
@@ -1512,7 +1493,11 @@ int __devinit gelic_net_setup_netdev(struct net_device *netdev,
1512 int status; 1493 int status;
1513 u64 v1, v2; 1494 u64 v1, v2;
1514 1495
1496 netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
1497
1515 netdev->features = NETIF_F_IP_CSUM; 1498 netdev->features = NETIF_F_IP_CSUM;
1499 if (GELIC_CARD_RX_CSUM_DEFAULT)
1500 netdev->features |= NETIF_F_RXCSUM;
1516 1501
1517 status = lv1_net_control(bus_id(card), dev_id(card), 1502 status = lv1_net_control(bus_id(card), dev_id(card),
1518 GELIC_LV1_GET_MAC_ADDRESS, 1503 GELIC_LV1_GET_MAC_ADDRESS,
@@ -1756,7 +1741,6 @@ static int __devinit ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
1756 /* setup card structure */ 1741 /* setup card structure */
1757 card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT | 1742 card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT |
1758 GELIC_CARD_PORT_STATUS_CHANGED; 1743 GELIC_CARD_PORT_STATUS_CHANGED;
1759 card->rx_csum = GELIC_CARD_RX_CSUM_DEFAULT;
1760 1744
1761 1745
1762 if (gelic_card_init_chain(card, &card->tx_chain, 1746 if (gelic_card_init_chain(card, &card->tx_chain,
diff --git a/drivers/net/ps3_gelic_net.h b/drivers/net/ps3_gelic_net.h
index fadadf9097a3..d9a55b93898b 100644
--- a/drivers/net/ps3_gelic_net.h
+++ b/drivers/net/ps3_gelic_net.h
@@ -290,7 +290,6 @@ struct gelic_card {
290 struct gelic_descr_chain tx_chain; 290 struct gelic_descr_chain tx_chain;
291 struct gelic_descr_chain rx_chain; 291 struct gelic_descr_chain rx_chain;
292 int rx_dma_restart_required; 292 int rx_dma_restart_required;
293 int rx_csum;
294 /* 293 /*
295 * tx_lock guards tx descriptor list and 294 * tx_lock guards tx descriptor list and
296 * tx_dma_progress. 295 * tx_dma_progress.
@@ -377,8 +376,6 @@ extern int gelic_net_setup_netdev(struct net_device *netdev,
377/* shared ethtool ops */ 376/* shared ethtool ops */
378extern void gelic_net_get_drvinfo(struct net_device *netdev, 377extern void gelic_net_get_drvinfo(struct net_device *netdev,
379 struct ethtool_drvinfo *info); 378 struct ethtool_drvinfo *info);
380extern u32 gelic_net_get_rx_csum(struct net_device *netdev);
381extern int gelic_net_set_rx_csum(struct net_device *netdev, u32 data);
382extern void gelic_net_poll_controller(struct net_device *netdev); 379extern void gelic_net_poll_controller(struct net_device *netdev);
383 380
384#endif /* _GELIC_NET_H */ 381#endif /* _GELIC_NET_H */
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index b5ae29d20f2e..2e62938c0f82 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2581,10 +2581,6 @@ static const struct net_device_ops gelic_wl_netdevice_ops = {
2581static const struct ethtool_ops gelic_wl_ethtool_ops = { 2581static const struct ethtool_ops gelic_wl_ethtool_ops = {
2582 .get_drvinfo = gelic_net_get_drvinfo, 2582 .get_drvinfo = gelic_net_get_drvinfo,
2583 .get_link = gelic_wl_get_link, 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
2590static void __devinit gelic_wl_setup_netdev_ops(struct net_device *netdev) 2586static void __devinit gelic_wl_setup_netdev_ops(struct net_device *netdev)