aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatherine Sullivan <catherine.sullivan@intel.com>2014-06-03 21:23:20 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-06-24 21:19:04 -0400
commit1ac978af7caca1aa857802822602520a58a50018 (patch)
tree46d16ee66135f55f464e3ec826abffb58c72d406
parentc571ea05a03da856b1e9f8c0355128a7044d6a91 (diff)
i40e: Add ablitity to enable/disable link from set_link_restart_an
The ability is already there in the fw and this will make it easy to toggle link without calling set_phy_config when no other link settings need to change. Change-ID: I185567ae81776382ac145247e4eb1ee95f22382c Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c8
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c3
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_prototype.h3
3 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index a51bba634718..bbace40bd114 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -971,12 +971,14 @@ i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
971/** 971/**
972 * i40e_aq_set_link_restart_an 972 * i40e_aq_set_link_restart_an
973 * @hw: pointer to the hw struct 973 * @hw: pointer to the hw struct
974 * @enable_link: if true: enable link, if false: disable link
974 * @cmd_details: pointer to command details structure or NULL 975 * @cmd_details: pointer to command details structure or NULL
975 * 976 *
976 * Sets up the link and restarts the Auto-Negotiation over the link. 977 * Sets up the link and restarts the Auto-Negotiation over the link.
977 **/ 978 **/
978i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, 979i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,
979 struct i40e_asq_cmd_details *cmd_details) 980 bool enable_link,
981 struct i40e_asq_cmd_details *cmd_details)
980{ 982{
981 struct i40e_aq_desc desc; 983 struct i40e_aq_desc desc;
982 struct i40e_aqc_set_link_restart_an *cmd = 984 struct i40e_aqc_set_link_restart_an *cmd =
@@ -987,6 +989,10 @@ i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,
987 i40e_aqc_opc_set_link_restart_an); 989 i40e_aqc_opc_set_link_restart_an);
988 990
989 cmd->command = I40E_AQ_PHY_RESTART_AN; 991 cmd->command = I40E_AQ_PHY_RESTART_AN;
992 if (enable_link)
993 cmd->command |= I40E_AQ_PHY_LINK_ENABLE;
994 else
995 cmd->command &= ~I40E_AQ_PHY_LINK_ENABLE;
990 996
991 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); 997 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
992 998
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 7da37581bc02..df89b6c3db41 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1027,9 +1027,10 @@ static int i40e_nway_reset(struct net_device *netdev)
1027 struct i40e_netdev_priv *np = netdev_priv(netdev); 1027 struct i40e_netdev_priv *np = netdev_priv(netdev);
1028 struct i40e_pf *pf = np->vsi->back; 1028 struct i40e_pf *pf = np->vsi->back;
1029 struct i40e_hw *hw = &pf->hw; 1029 struct i40e_hw *hw = &pf->hw;
1030 bool link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
1030 i40e_status ret = 0; 1031 i40e_status ret = 0;
1031 1032
1032 ret = i40e_aq_set_link_restart_an(hw, NULL); 1033 ret = i40e_aq_set_link_restart_an(hw, link_up, NULL);
1033 if (ret) { 1034 if (ret) {
1034 netdev_info(netdev, "link restart failed, aq_err=%d\n", 1035 netdev_info(netdev, "link restart failed, aq_err=%d\n",
1035 pf->hw.aq.asq_last_status); 1036 pf->hw.aq.asq_last_status);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index a430699c41d5..3300b996a467 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -77,7 +77,8 @@ i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
77i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw, 77i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
78 struct i40e_asq_cmd_details *cmd_details); 78 struct i40e_asq_cmd_details *cmd_details);
79i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, 79i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,
80 struct i40e_asq_cmd_details *cmd_details); 80 bool enable_link,
81 struct i40e_asq_cmd_details *cmd_details);
81i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, 82i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
82 bool enable_lse, struct i40e_link_status *link, 83 bool enable_lse, struct i40e_link_status *link,
83 struct i40e_asq_cmd_details *cmd_details); 84 struct i40e_asq_cmd_details *cmd_details);