aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2011-01-20 06:58:07 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-02-11 08:42:15 -0800
commit5962bc21ceaaba81e04fa1bb5671c65251805d3e (patch)
treeead360a95ba1767bd311957b50bd4f5bc45725b7 /drivers/net/e1000e
parent5c1bda0aa32e4614c32a45ce5662ed6914bae38a (diff)
downloadkernel_samsung_tuna-5962bc21ceaaba81e04fa1bb5671c65251805d3e.zip
kernel_samsung_tuna-5962bc21ceaaba81e04fa1bb5671c65251805d3e.tar.gz
kernel_samsung_tuna-5962bc21ceaaba81e04fa1bb5671c65251805d3e.tar.bz2
e1000e: return appropriate errors for 'ethtool -r'
...when invoked while interface is not up or when auto-negotiation is disabled as done by other drivers. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/ethtool.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 0c08599..65ef9b5 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1963,8 +1963,15 @@ static int e1000_set_coalesce(struct net_device *netdev,
static int e1000_nway_reset(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
- if (netif_running(netdev))
- e1000e_reinit_locked(adapter);
+
+ if (!netif_running(netdev))
+ return -EAGAIN;
+
+ if (!adapter->hw.mac.autoneg)
+ return -EINVAL;
+
+ e1000e_reinit_locked(adapter);
+
return 0;
}