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>
This commit is contained in:
parent
5c1bda0aa3
commit
5962bc21ce
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user