aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_ethtool.c
diff options
context:
space:
mode:
authorRajesh Borundia <rajesh.borundia@qlogic.com>2010-08-19 01:08:26 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 19:52:39 -0400
commit0325d69b2a1feb72f11413dbfcc1705ccfc203c1 (patch)
tree55b3d39f86ac2db38bae43209d0ce6111b3abd39 /drivers/net/qlcnic/qlcnic_ethtool.c
parent4e8acb011f0e9e86e29b53ff051e699ba0c5726d (diff)
qlcnic: configure offload setting on eswitch
Device is not capable of enabling/disabling offload setting per port in case of Nic Partition.So offload settings needs to be enabled/disabled per eswitch and it will affect all the function on that eswitch. Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_ethtool.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index e38fc3d96d43..2805f88aaf7c 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -804,6 +804,20 @@ qlcnic_get_ethtool_stats(struct net_device *dev,
804 } 804 }
805} 805}
806 806
807static int qlcnic_set_tx_csum(struct net_device *dev, u32 data)
808{
809 struct qlcnic_adapter *adapter = netdev_priv(dev);
810
811 if ((adapter->flags & QLCNIC_ESWITCH_ENABLED))
812 return -EOPNOTSUPP;
813 if (data)
814 dev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
815 else
816 dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
817
818 return 0;
819
820}
807static u32 qlcnic_get_tx_csum(struct net_device *dev) 821static u32 qlcnic_get_tx_csum(struct net_device *dev)
808{ 822{
809 return dev->features & NETIF_F_IP_CSUM; 823 return dev->features & NETIF_F_IP_CSUM;
@@ -819,6 +833,8 @@ static int qlcnic_set_rx_csum(struct net_device *dev, u32 data)
819{ 833{
820 struct qlcnic_adapter *adapter = netdev_priv(dev); 834 struct qlcnic_adapter *adapter = netdev_priv(dev);
821 835
836 if ((adapter->flags & QLCNIC_ESWITCH_ENABLED))
837 return -EOPNOTSUPP;
822 if (!!data) { 838 if (!!data) {
823 adapter->rx_csum = !!data; 839 adapter->rx_csum = !!data;
824 return 0; 840 return 0;
@@ -1070,7 +1086,7 @@ const struct ethtool_ops qlcnic_ethtool_ops = {
1070 .get_pauseparam = qlcnic_get_pauseparam, 1086 .get_pauseparam = qlcnic_get_pauseparam,
1071 .set_pauseparam = qlcnic_set_pauseparam, 1087 .set_pauseparam = qlcnic_set_pauseparam,
1072 .get_tx_csum = qlcnic_get_tx_csum, 1088 .get_tx_csum = qlcnic_get_tx_csum,
1073 .set_tx_csum = ethtool_op_set_tx_csum, 1089 .set_tx_csum = qlcnic_set_tx_csum,
1074 .set_sg = ethtool_op_set_sg, 1090 .set_sg = ethtool_op_set_sg,
1075 .get_tso = qlcnic_get_tso, 1091 .get_tso = qlcnic_get_tso,
1076 .set_tso = qlcnic_set_tso, 1092 .set_tso = qlcnic_set_tso,