diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2010-12-02 22:31:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-03 12:36:45 -0500 |
commit | c6ecf39a10ceec3e97096e2a8d3eadcecd593422 (patch) | |
tree | 995ed9963bbec2026f71010727a4e1cbe904d415 /drivers/net/ixgbe | |
parent | e4d849b8113b0cf7b6ebfa9ee4c47bd514ea49d3 (diff) |
ixgbe: fix link behavior for SFP+ when driver is brought down
We have had several requests to have ifconfig down command disable
the SFP+ laser and thus make link go down. Likewise on ifconfig up
the laser would be enabled and link would come up. This patch enables
that behavior.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 12 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 26 |
2 files changed, 27 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index e34643eef162..8fa76785b45c 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -65,9 +65,9 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); | |||
65 | static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | 65 | static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) |
66 | { | 66 | { |
67 | struct ixgbe_mac_info *mac = &hw->mac; | 67 | struct ixgbe_mac_info *mac = &hw->mac; |
68 | if (hw->phy.multispeed_fiber) { | 68 | |
69 | /* Set up dual speed SFP+ support */ | 69 | /* enable the laser control functions for SFP+ fiber */ |
70 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; | 70 | if (mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) { |
71 | mac->ops.disable_tx_laser = | 71 | mac->ops.disable_tx_laser = |
72 | &ixgbe_disable_tx_laser_multispeed_fiber; | 72 | &ixgbe_disable_tx_laser_multispeed_fiber; |
73 | mac->ops.enable_tx_laser = | 73 | mac->ops.enable_tx_laser = |
@@ -77,6 +77,12 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | |||
77 | mac->ops.disable_tx_laser = NULL; | 77 | mac->ops.disable_tx_laser = NULL; |
78 | mac->ops.enable_tx_laser = NULL; | 78 | mac->ops.enable_tx_laser = NULL; |
79 | mac->ops.flap_tx_laser = NULL; | 79 | mac->ops.flap_tx_laser = NULL; |
80 | } | ||
81 | |||
82 | if (hw->phy.multispeed_fiber) { | ||
83 | /* Set up dual speed SFP+ support */ | ||
84 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; | ||
85 | } else { | ||
80 | if ((mac->ops.get_media_type(hw) == | 86 | if ((mac->ops.get_media_type(hw) == |
81 | ixgbe_media_type_backplane) && | 87 | ixgbe_media_type_backplane) && |
82 | (hw->phy.smart_speed == ixgbe_smart_speed_auto || | 88 | (hw->phy.smart_speed == ixgbe_smart_speed_auto || |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 494cb57b700d..5861ece70207 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3793,8 +3793,11 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
3793 | else | 3793 | else |
3794 | ixgbe_configure_msi_and_legacy(adapter); | 3794 | ixgbe_configure_msi_and_legacy(adapter); |
3795 | 3795 | ||
3796 | /* enable the optics */ | 3796 | /* enable the optics for both mult-speed fiber and 82599 SFP+ fiber */ |
3797 | if (hw->phy.multispeed_fiber && hw->mac.ops.enable_tx_laser) | 3797 | if (hw->mac.ops.enable_tx_laser && |
3798 | ((hw->phy.multispeed_fiber) || | ||
3799 | ((hw->phy.type == ixgbe_media_type_fiber) && | ||
3800 | (hw->mac.type == ixgbe_mac_82599EB)))) | ||
3798 | hw->mac.ops.enable_tx_laser(hw); | 3801 | hw->mac.ops.enable_tx_laser(hw); |
3799 | 3802 | ||
3800 | clear_bit(__IXGBE_DOWN, &adapter->state); | 3803 | clear_bit(__IXGBE_DOWN, &adapter->state); |
@@ -4106,15 +4109,19 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
4106 | break; | 4109 | break; |
4107 | } | 4110 | } |
4108 | 4111 | ||
4109 | /* power down the optics */ | ||
4110 | if (hw->phy.multispeed_fiber && hw->mac.ops.disable_tx_laser) | ||
4111 | hw->mac.ops.disable_tx_laser(hw); | ||
4112 | |||
4113 | /* clear n-tuple filters that are cached */ | 4112 | /* clear n-tuple filters that are cached */ |
4114 | ethtool_ntuple_flush(netdev); | 4113 | ethtool_ntuple_flush(netdev); |
4115 | 4114 | ||
4116 | if (!pci_channel_offline(adapter->pdev)) | 4115 | if (!pci_channel_offline(adapter->pdev)) |
4117 | ixgbe_reset(adapter); | 4116 | ixgbe_reset(adapter); |
4117 | |||
4118 | /* power down the optics for multispeed fiber and 82599 SFP+ fiber */ | ||
4119 | if (hw->mac.ops.disable_tx_laser && | ||
4120 | ((hw->phy.multispeed_fiber) || | ||
4121 | ((hw->phy.type == ixgbe_media_type_fiber) && | ||
4122 | (hw->mac.type == ixgbe_mac_82599EB)))) | ||
4123 | hw->mac.ops.disable_tx_laser(hw); | ||
4124 | |||
4118 | ixgbe_clean_all_tx_rings(adapter); | 4125 | ixgbe_clean_all_tx_rings(adapter); |
4119 | ixgbe_clean_all_rx_rings(adapter); | 4126 | ixgbe_clean_all_rx_rings(adapter); |
4120 | 4127 | ||
@@ -7197,8 +7204,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
7197 | goto err_eeprom; | 7204 | goto err_eeprom; |
7198 | } | 7205 | } |
7199 | 7206 | ||
7200 | /* power down the optics */ | 7207 | /* power down the optics for multispeed fiber and 82599 SFP+ fiber */ |
7201 | if (hw->phy.multispeed_fiber && hw->mac.ops.disable_tx_laser) | 7208 | if (hw->mac.ops.disable_tx_laser && |
7209 | ((hw->phy.multispeed_fiber) || | ||
7210 | ((hw->phy.type == ixgbe_media_type_fiber) && | ||
7211 | (hw->mac.type == ixgbe_mac_82599EB)))) | ||
7202 | hw->mac.ops.disable_tx_laser(hw); | 7212 | hw->mac.ops.disable_tx_laser(hw); |
7203 | 7213 | ||
7204 | init_timer(&adapter->watchdog_timer); | 7214 | init_timer(&adapter->watchdog_timer); |