aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2012-09-19 23:33:56 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-10-30 01:31:59 -0400
commitec74a4715549ed4823df7ad4ecc81a8416b7f6bd (patch)
tree817b80836c9a1cebca2f9e908a902c53379b6814
parentb3343a2a2c95b3b7ed4f6596e860c4276ba46217 (diff)
ixgbe: clean up the condition for turning on/off the laser
This patch simplifies the check for calling en/disable_tx_laser() function pointer. The pointer is only set on parts that can use it. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 97bab45ed95f..ceab142bcf8a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4087,11 +4087,8 @@ static void ixgbe_up_complete(struct ixgbe_adapter *adapter)
4087 else 4087 else
4088 ixgbe_configure_msi_and_legacy(adapter); 4088 ixgbe_configure_msi_and_legacy(adapter);
4089 4089
4090 /* enable the optics for both mult-speed fiber and 82599 SFP+ fiber */ 4090 /* enable the optics for 82599 SFP+ fiber */
4091 if (hw->mac.ops.enable_tx_laser && 4091 if (hw->mac.ops.enable_tx_laser)
4092 ((hw->phy.multispeed_fiber) ||
4093 ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
4094 (hw->mac.type == ixgbe_mac_82599EB))))
4095 hw->mac.ops.enable_tx_laser(hw); 4092 hw->mac.ops.enable_tx_laser(hw);
4096 4093
4097 clear_bit(__IXGBE_DOWN, &adapter->state); 4094 clear_bit(__IXGBE_DOWN, &adapter->state);
@@ -4413,11 +4410,8 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
4413 if (!pci_channel_offline(adapter->pdev)) 4410 if (!pci_channel_offline(adapter->pdev))
4414 ixgbe_reset(adapter); 4411 ixgbe_reset(adapter);
4415 4412
4416 /* power down the optics for multispeed fiber and 82599 SFP+ fiber */ 4413 /* power down the optics for 82599 SFP+ fiber */
4417 if (hw->mac.ops.disable_tx_laser && 4414 if (hw->mac.ops.disable_tx_laser)
4418 ((hw->phy.multispeed_fiber) ||
4419 ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
4420 (hw->mac.type == ixgbe_mac_82599EB))))
4421 hw->mac.ops.disable_tx_laser(hw); 4415 hw->mac.ops.disable_tx_laser(hw);
4422 4416
4423 ixgbe_clean_all_tx_rings(adapter); 4417 ixgbe_clean_all_tx_rings(adapter);
@@ -5050,14 +5044,8 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
5050 if (wufc) { 5044 if (wufc) {
5051 ixgbe_set_rx_mode(netdev); 5045 ixgbe_set_rx_mode(netdev);
5052 5046
5053 /* 5047 /* enable the optics for 82599 SFP+ fiber as we can WoL */
5054 * enable the optics for both mult-speed fiber and 5048 if (hw->mac.ops.enable_tx_laser)
5055 * 82599 SFP+ fiber as we can WoL.
5056 */
5057 if (hw->mac.ops.enable_tx_laser &&
5058 (hw->phy.multispeed_fiber ||
5059 (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber &&
5060 hw->mac.type == ixgbe_mac_82599EB)))
5061 hw->mac.ops.enable_tx_laser(hw); 5049 hw->mac.ops.enable_tx_laser(hw);
5062 5050
5063 /* turn on all-multi mode if wake on multicast is enabled */ 5051 /* turn on all-multi mode if wake on multicast is enabled */
@@ -7468,11 +7456,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7468 if (err) 7456 if (err)
7469 goto err_register; 7457 goto err_register;
7470 7458
7471 /* power down the optics for multispeed fiber and 82599 SFP+ fiber */ 7459 /* power down the optics for 82599 SFP+ fiber */
7472 if (hw->mac.ops.disable_tx_laser && 7460 if (hw->mac.ops.disable_tx_laser)
7473 ((hw->phy.multispeed_fiber) ||
7474 ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
7475 (hw->mac.type == ixgbe_mac_82599EB))))
7476 hw->mac.ops.disable_tx_laser(hw); 7461 hw->mac.ops.disable_tx_laser(hw);
7477 7462
7478 /* carrier off reporting is important to ethtool even BEFORE open */ 7463 /* carrier off reporting is important to ethtool even BEFORE open */