aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-04-05 10:00:02 -0400
committerBen Hutchings <bhutchings@solarflare.com>2011-04-05 10:00:02 -0400
commitabfe903980161b11f3594e3dcbab8b5c5a67168b (patch)
tree4bfde1e260cdfe855cfa0e94718ecb1747bac3b4 /drivers/net/sfc/ethtool.c
parentf82d9a67fbcdfd8af6be7a7c9e381864ec9a271a (diff)
sfc: Implement generic features interface
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r--drivers/net/sfc/ethtool.c78
1 files changed, 0 insertions, 78 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 807178ef65ad..0d5543972574 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -518,72 +518,6 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
518 } 518 }
519} 519}
520 520
521static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable)
522{
523 struct efx_nic *efx __attribute__ ((unused)) = netdev_priv(net_dev);
524 u32 features;
525
526 features = NETIF_F_TSO;
527 if (efx->type->offload_features & NETIF_F_V6_CSUM)
528 features |= NETIF_F_TSO6;
529
530 if (enable)
531 net_dev->features |= features;
532 else
533 net_dev->features &= ~features;
534
535 return 0;
536}
537
538static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable)
539{
540 struct efx_nic *efx = netdev_priv(net_dev);
541 u32 features = efx->type->offload_features & NETIF_F_ALL_CSUM;
542
543 if (enable)
544 net_dev->features |= features;
545 else
546 net_dev->features &= ~features;
547
548 return 0;
549}
550
551static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable)
552{
553 struct efx_nic *efx = netdev_priv(net_dev);
554
555 /* No way to stop the hardware doing the checks; we just
556 * ignore the result.
557 */
558 efx->rx_checksum_enabled = !!enable;
559
560 return 0;
561}
562
563static u32 efx_ethtool_get_rx_csum(struct net_device *net_dev)
564{
565 struct efx_nic *efx = netdev_priv(net_dev);
566
567 return efx->rx_checksum_enabled;
568}
569
570static int efx_ethtool_set_flags(struct net_device *net_dev, u32 data)
571{
572 struct efx_nic *efx = netdev_priv(net_dev);
573 u32 supported = (efx->type->offload_features &
574 (ETH_FLAG_RXHASH | ETH_FLAG_NTUPLE));
575 int rc;
576
577 rc = ethtool_op_set_flags(net_dev, data, supported);
578 if (rc)
579 return rc;
580
581 if (!(data & ETH_FLAG_NTUPLE))
582 efx_filter_clear_rx(efx, EFX_FILTER_PRI_MANUAL);
583
584 return 0;
585}
586
587static void efx_ethtool_self_test(struct net_device *net_dev, 521static void efx_ethtool_self_test(struct net_device *net_dev,
588 struct ethtool_test *test, u64 *data) 522 struct ethtool_test *test, u64 *data)
589{ 523{
@@ -1070,18 +1004,6 @@ const struct ethtool_ops efx_ethtool_ops = {
1070 .set_ringparam = efx_ethtool_set_ringparam, 1004 .set_ringparam = efx_ethtool_set_ringparam,
1071 .get_pauseparam = efx_ethtool_get_pauseparam, 1005 .get_pauseparam = efx_ethtool_get_pauseparam,
1072 .set_pauseparam = efx_ethtool_set_pauseparam, 1006 .set_pauseparam = efx_ethtool_set_pauseparam,
1073 .get_rx_csum = efx_ethtool_get_rx_csum,
1074 .set_rx_csum = efx_ethtool_set_rx_csum,
1075 .get_tx_csum = ethtool_op_get_tx_csum,
1076 /* Need to enable/disable IPv6 too */
1077 .set_tx_csum = efx_ethtool_set_tx_csum,
1078 .get_sg = ethtool_op_get_sg,
1079 .set_sg = ethtool_op_set_sg,
1080 .get_tso = ethtool_op_get_tso,
1081 /* Need to enable/disable TSO-IPv6 too */
1082 .set_tso = efx_ethtool_set_tso,
1083 .get_flags = ethtool_op_get_flags,
1084 .set_flags = efx_ethtool_set_flags,
1085 .get_sset_count = efx_ethtool_get_sset_count, 1007 .get_sset_count = efx_ethtool_get_sset_count,
1086 .self_test = efx_ethtool_self_test, 1008 .self_test = efx_ethtool_self_test,
1087 .get_strings = efx_ethtool_get_strings, 1009 .get_strings = efx_ethtool_get_strings,