diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2014-06-04 08:45:25 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-07-02 19:02:21 -0700 |
commit | a65997215be9f54dbc927b05fc8eb2fe55912d11 (patch) | |
tree | fef1c6866fb8c61363478ee039efcb64684aecac | |
parent | 8109e1232b3e5322415a9b5e09951617c5fae277 (diff) | |
download | op-kernel-dev-a65997215be9f54dbc927b05fc8eb2fe55912d11.zip op-kernel-dev-a65997215be9f54dbc927b05fc8eb2fe55912d11.tar.gz |
i40e: move nway reset
Just move nway reset up, will be used in the next patch.
Change-ID: Ice3b631fa2044debc5c4541b42872a48163f8452
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index b105e6f..6508a1b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -412,6 +412,25 @@ no_valid_phy_type: return 0; } +static int i40e_nway_reset(struct net_device *netdev) +{ + /* restart autonegotiation */ + struct i40e_netdev_priv *np = netdev_priv(netdev); + struct i40e_pf *pf = np->vsi->back; + struct i40e_hw *hw = &pf->hw; + bool link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP; + i40e_status ret = 0; + + ret = i40e_aq_set_link_restart_an(hw, link_up, NULL); + if (ret) { + netdev_info(netdev, "link restart failed, aq_err=%d\n", + pf->hw.aq.asq_last_status); + return -EIO; + } + + return 0; +} + /** * i40e_get_pauseparam - Get Flow Control status * Return tx/rx-pause status @@ -1125,25 +1144,6 @@ static int i40e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) return 0; } -static int i40e_nway_reset(struct net_device *netdev) -{ - /* restart autonegotiation */ - struct i40e_netdev_priv *np = netdev_priv(netdev); - struct i40e_pf *pf = np->vsi->back; - struct i40e_hw *hw = &pf->hw; - bool link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP; - i40e_status ret = 0; - - ret = i40e_aq_set_link_restart_an(hw, link_up, NULL); - if (ret) { - netdev_info(netdev, "link restart failed, aq_err=%d\n", - pf->hw.aq.asq_last_status); - return -EIO; - } - - return 0; -} - static int i40e_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state) { |