aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDon Skidmore <donald.c.skidmore@intel.com>2013-02-20 22:00:04 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-04-18 01:03:09 -0400
commit0b2679d61c55f04f405cde11809a9f87e582527f (patch)
tree4cd306a3e597d6e209934449c0d77f84a175b2d9 /drivers/net/ethernet
parentb8e820015ec703b971e6a3e2354502ecdd905aee (diff)
ixgbe: fix MNG FW support when adapter not up
We were only turning the laser on when the adapter was up. This causes issues for those who wanted to access the MNG FW while the port was in a down state. This patch makes sure the laser is turned on in probe and remain up even after the port is brought down. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c48
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_type.h10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c1
5 files changed, 65 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index d0113fc97b6f..4a5bfb6b3af0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -1305,6 +1305,7 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
1305 .release_swfw_sync = &ixgbe_release_swfw_sync, 1305 .release_swfw_sync = &ixgbe_release_swfw_sync,
1306 .get_thermal_sensor_data = NULL, 1306 .get_thermal_sensor_data = NULL,
1307 .init_thermal_sensor_thresh = NULL, 1307 .init_thermal_sensor_thresh = NULL,
1308 .mng_fw_enabled = NULL,
1308}; 1309};
1309 1310
1310static struct ixgbe_eeprom_operations eeprom_ops_82598 = { 1311static struct ixgbe_eeprom_operations eeprom_ops_82598 = {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index 203a00c24330..b6289f11b764 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -59,12 +59,34 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
59 bool autoneg_wait_to_complete); 59 bool autoneg_wait_to_complete);
60static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); 60static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
61 61
62static bool ixgbe_mng_enabled(struct ixgbe_hw *hw)
63{
64 u32 fwsm, manc, factps;
65
66 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM);
67 if ((fwsm & IXGBE_FWSM_MODE_MASK) != IXGBE_FWSM_FW_MODE_PT)
68 return false;
69
70 manc = IXGBE_READ_REG(hw, IXGBE_MANC);
71 if (!(manc & IXGBE_MANC_RCV_TCO_EN))
72 return false;
73
74 factps = IXGBE_READ_REG(hw, IXGBE_FACTPS);
75 if (factps & IXGBE_FACTPS_MNGCG)
76 return false;
77
78 return true;
79}
80
62static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) 81static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
63{ 82{
64 struct ixgbe_mac_info *mac = &hw->mac; 83 struct ixgbe_mac_info *mac = &hw->mac;
65 84
66 /* enable the laser control functions for SFP+ fiber */ 85 /* enable the laser control functions for SFP+ fiber
67 if (mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) { 86 * and MNG not enabled
87 */
88 if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
89 !hw->mng_fw_enabled) {
68 mac->ops.disable_tx_laser = 90 mac->ops.disable_tx_laser =
69 &ixgbe_disable_tx_laser_multispeed_fiber; 91 &ixgbe_disable_tx_laser_multispeed_fiber;
70 mac->ops.enable_tx_laser = 92 mac->ops.enable_tx_laser =
@@ -563,7 +585,8 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
563 return status; 585 return status;
564 586
565 /* Flap the tx laser if it has not already been done */ 587 /* Flap the tx laser if it has not already been done */
566 hw->mac.ops.flap_tx_laser(hw); 588 if (hw->mac.ops.flap_tx_laser)
589 hw->mac.ops.flap_tx_laser(hw);
567 590
568 /* 591 /*
569 * Wait for the controller to acquire link. Per IEEE 802.3ap, 592 * Wait for the controller to acquire link. Per IEEE 802.3ap,
@@ -615,7 +638,8 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
615 return status; 638 return status;
616 639
617 /* Flap the tx laser if it has not already been done */ 640 /* Flap the tx laser if it has not already been done */
618 hw->mac.ops.flap_tx_laser(hw); 641 if (hw->mac.ops.flap_tx_laser)
642 hw->mac.ops.flap_tx_laser(hw);
619 643
620 /* Wait for the link partner to also set speed */ 644 /* Wait for the link partner to also set speed */
621 msleep(100); 645 msleep(100);
@@ -933,6 +957,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
933 ixgbe_link_speed link_speed; 957 ixgbe_link_speed link_speed;
934 s32 status; 958 s32 status;
935 u32 ctrl, i, autoc, autoc2; 959 u32 ctrl, i, autoc, autoc2;
960 u32 curr_lms;
936 bool link_up = false; 961 bool link_up = false;
937 962
938 /* Call adapter stop to disable tx/rx and clear interrupts */ 963 /* Call adapter stop to disable tx/rx and clear interrupts */
@@ -964,6 +989,9 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
964 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL) 989 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL)
965 hw->phy.ops.reset(hw); 990 hw->phy.ops.reset(hw);
966 991
992 /* remember AUTOC LMS from before we reset */
993 curr_lms = IXGBE_READ_REG(hw, IXGBE_AUTOC) & IXGBE_AUTOC_LMS_MASK;
994
967mac_reset_top: 995mac_reset_top:
968 /* 996 /*
969 * Issue global reset to the MAC. Needs to be SW reset if link is up. 997 * Issue global reset to the MAC. Needs to be SW reset if link is up.
@@ -1019,6 +1047,16 @@ mac_reset_top:
1019 hw->mac.orig_autoc2 = autoc2; 1047 hw->mac.orig_autoc2 = autoc2;
1020 hw->mac.orig_link_settings_stored = true; 1048 hw->mac.orig_link_settings_stored = true;
1021 } else { 1049 } else {
1050
1051 /* If MNG FW is running on a multi-speed device that
1052 * doesn't autoneg with out driver support we need to
1053 * leave LMS in the state it was before we MAC reset.
1054 */
1055 if (hw->phy.multispeed_fiber && hw->mng_fw_enabled)
1056 hw->mac.orig_autoc =
1057 (hw->mac.orig_autoc & ~IXGBE_AUTOC_LMS_MASK) |
1058 curr_lms;
1059
1022 if (autoc != hw->mac.orig_autoc) { 1060 if (autoc != hw->mac.orig_autoc) {
1023 /* Need SW/FW semaphore around AUTOC writes if LESM is 1061 /* Need SW/FW semaphore around AUTOC writes if LESM is
1024 * on, likewise reset_pipeline requires us to hold 1062 * on, likewise reset_pipeline requires us to hold
@@ -2216,7 +2254,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
2216 .release_swfw_sync = &ixgbe_release_swfw_sync, 2254 .release_swfw_sync = &ixgbe_release_swfw_sync,
2217 .get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic, 2255 .get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic,
2218 .init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic, 2256 .init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic,
2219 2257 .mng_fw_enabled = &ixgbe_mng_enabled,
2220}; 2258};
2221 2259
2222static struct ixgbe_eeprom_operations eeprom_ops_82599 = { 2260static struct ixgbe_eeprom_operations eeprom_ops_82599 = {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 3beac2300643..ac6e464382e4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7370,6 +7370,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
7370 if (err) 7370 if (err)
7371 goto err_sw_init; 7371 goto err_sw_init;
7372 7372
7373 /* Cache if MNG FW is up so we don't have to read the REG later */
7374 if (hw->mac.ops.mng_fw_enabled)
7375 hw->mng_fw_enabled = hw->mac.ops.mng_fw_enabled(hw);
7376
7373 /* Make it possible the adapter to be woken up via WOL */ 7377 /* Make it possible the adapter to be woken up via WOL */
7374 switch (adapter->hw.mac.type) { 7378 switch (adapter->hw.mac.type) {
7375 case ixgbe_mac_82599EB: 7379 case ixgbe_mac_82599EB:
@@ -7623,6 +7627,12 @@ skip_sriov:
7623 ixgbe_dbg_adapter_init(adapter); 7627 ixgbe_dbg_adapter_init(adapter);
7624#endif /* CONFIG_DEBUG_FS */ 7628#endif /* CONFIG_DEBUG_FS */
7625 7629
7630 /* Need link setup for MNG FW, else wait for IXGBE_UP */
7631 if (hw->mng_fw_enabled && hw->mac.ops.setup_link)
7632 hw->mac.ops.setup_link(hw,
7633 IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL,
7634 true);
7635
7626 return 0; 7636 return 0;
7627 7637
7628err_register: 7638err_register:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 05df36ef9884..200b1a885ec5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -729,6 +729,13 @@ struct ixgbe_thermal_sensor_data {
729#define IXGBE_MDEF_EXT(_i) (0x05160 + ((_i) * 4)) /* 8 of these (0-7) */ 729#define IXGBE_MDEF_EXT(_i) (0x05160 + ((_i) * 4)) /* 8 of these (0-7) */
730#define IXGBE_LSWFW 0x15014 730#define IXGBE_LSWFW 0x15014
731 731
732/* Management Bit Fields and Masks */
733#define IXGBE_MANC_RCV_TCO_EN 0x00020000 /* Rcv TCO packet enable */
734
735/* Firmware Semaphore Register */
736#define IXGBE_FWSM_MODE_MASK 0xE
737#define IXGBE_FWSM_FW_MODE_PT 0x4
738
732/* ARC Subsystem registers */ 739/* ARC Subsystem registers */
733#define IXGBE_HICR 0x15F00 740#define IXGBE_HICR 0x15F00
734#define IXGBE_FWSTS 0x15F0C 741#define IXGBE_FWSTS 0x15F0C
@@ -1019,6 +1026,7 @@ struct ixgbe_thermal_sensor_data {
1019#define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST) 1026#define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST)
1020 1027
1021/* FACTPS */ 1028/* FACTPS */
1029#define IXGBE_FACTPS_MNGCG 0x20000000 /* Manageblility Clock Gated */
1022#define IXGBE_FACTPS_LFS 0x40000000 /* LAN Function Select */ 1030#define IXGBE_FACTPS_LFS 0x40000000 /* LAN Function Select */
1023 1031
1024/* MHADD Bit Masks */ 1032/* MHADD Bit Masks */
@@ -2861,6 +2869,7 @@ struct ixgbe_mac_operations {
2861 s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8); 2869 s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);
2862 s32 (*get_thermal_sensor_data)(struct ixgbe_hw *); 2870 s32 (*get_thermal_sensor_data)(struct ixgbe_hw *);
2863 s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw); 2871 s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);
2872 bool (*mng_fw_enabled)(struct ixgbe_hw *hw);
2864}; 2873};
2865 2874
2866struct ixgbe_phy_operations { 2875struct ixgbe_phy_operations {
@@ -2988,6 +2997,7 @@ struct ixgbe_hw {
2988 bool adapter_stopped; 2997 bool adapter_stopped;
2989 bool force_full_reset; 2998 bool force_full_reset;
2990 bool allow_unsupported_sfp; 2999 bool allow_unsupported_sfp;
3000 bool mng_fw_enabled;
2991}; 3001};
2992 3002
2993struct ixgbe_info { 3003struct ixgbe_info {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
index 66c5e946284e..389324f5929a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
@@ -854,6 +854,7 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
854 .enable_rx_buff = &ixgbe_enable_rx_buff_generic, 854 .enable_rx_buff = &ixgbe_enable_rx_buff_generic,
855 .get_thermal_sensor_data = NULL, 855 .get_thermal_sensor_data = NULL,
856 .init_thermal_sensor_thresh = NULL, 856 .init_thermal_sensor_thresh = NULL,
857 .mng_fw_enabled = NULL,
857}; 858};
858 859
859static struct ixgbe_eeprom_operations eeprom_ops_X540 = { 860static struct ixgbe_eeprom_operations eeprom_ops_X540 = {