aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000e/ethtool.c')
-rw-r--r--drivers/net/e1000e/ethtool.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 5b4cf9076bac..a31d280ffb6d 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -2020,6 +2020,31 @@ static void e1000_get_strings(struct net_device *netdev, u32 stringset,
2020 } 2020 }
2021} 2021}
2022 2022
2023static int e1000e_set_flags(struct net_device *netdev, u32 data)
2024{
2025 struct e1000_adapter *adapter = netdev_priv(netdev);
2026 bool need_reset = false;
2027 int rc;
2028
2029 need_reset = (data & ETH_FLAG_RXVLAN) !=
2030 (netdev->features & NETIF_F_HW_VLAN_RX);
2031
2032 rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_RXVLAN |
2033 ETH_FLAG_TXVLAN);
2034
2035 if (rc)
2036 return rc;
2037
2038 if (need_reset) {
2039 if (netif_running(netdev))
2040 e1000e_reinit_locked(adapter);
2041 else
2042 e1000e_reset(adapter);
2043 }
2044
2045 return 0;
2046}
2047
2023static const struct ethtool_ops e1000_ethtool_ops = { 2048static const struct ethtool_ops e1000_ethtool_ops = {
2024 .get_settings = e1000_get_settings, 2049 .get_settings = e1000_get_settings,
2025 .set_settings = e1000_set_settings, 2050 .set_settings = e1000_set_settings,
@@ -2055,6 +2080,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
2055 .get_coalesce = e1000_get_coalesce, 2080 .get_coalesce = e1000_get_coalesce,
2056 .set_coalesce = e1000_set_coalesce, 2081 .set_coalesce = e1000_set_coalesce,
2057 .get_flags = ethtool_op_get_flags, 2082 .get_flags = ethtool_op_get_flags,
2083 .set_flags = e1000e_set_flags,
2058}; 2084};
2059 2085
2060void e1000e_set_ethtool_ops(struct net_device *netdev) 2086void e1000e_set_ethtool_ops(struct net_device *netdev)