aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_hw.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index 498cca92126..cbb27f2df00 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -758,6 +758,43 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu)
758 return rc; 758 return rc;
759} 759}
760 760
761
762u32 qlcnic_fix_features(struct net_device *netdev, u32 features)
763{
764 struct qlcnic_adapter *adapter = netdev_priv(netdev);
765
766 if ((adapter->flags & QLCNIC_ESWITCH_ENABLED)) {
767 u32 changed = features ^ netdev->features;
768 features ^= changed & (NETIF_F_ALL_CSUM | NETIF_F_RXCSUM);
769 }
770
771 if (!(features & NETIF_F_RXCSUM))
772 features &= ~NETIF_F_LRO;
773
774 return features;
775}
776
777
778int qlcnic_set_features(struct net_device *netdev, u32 features)
779{
780 struct qlcnic_adapter *adapter = netdev_priv(netdev);
781 u32 changed = netdev->features ^ features;
782 int hw_lro = (features & NETIF_F_LRO) ? QLCNIC_LRO_ENABLED : 0;
783
784 if (!(changed & NETIF_F_LRO))
785 return 0;
786
787 netdev->features = features ^ NETIF_F_LRO;
788
789 if (qlcnic_config_hw_lro(adapter, hw_lro))
790 return -EIO;
791
792 if ((hw_lro == 0) && qlcnic_send_lro_cleanup(adapter))
793 return -EIO;
794
795 return 0;
796}
797
761/* 798/*
762 * Changes the CRB window to the specified window. 799 * Changes the CRB window to the specified window.
763 */ 800 */