ixgbe: Stop cacheing if the MNG FW enabled
authorDon Skidmore <donald.c.skidmore@intel.com>
Thu, 27 Feb 2014 09:03:30 +0000 (09:03 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 20 Mar 2014 07:52:36 +0000 (00:52 -0700)
We use to cache whether the MNG FW was enabled, how since this isn't
static we really need to verify with each check.  This patch makes that
change.

CC: Arun Sharma <asharma@fb.com>
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>
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c

index 7fe22542e404c4ed9a40041b16db91f864394aba..4c78ea8946c1b48838db6d7e9ce890089ff6ab59 100644 (file)
@@ -1315,7 +1315,6 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
        .release_swfw_sync      = &ixgbe_release_swfw_sync,
        .get_thermal_sensor_data = NULL,
        .init_thermal_sensor_thresh = NULL,
-       .mng_fw_enabled         = NULL,
        .prot_autoc_read        = &prot_autoc_read_generic,
        .prot_autoc_write       = &prot_autoc_write_generic,
 };
index 34ab2fca2ee3484f92e5e6c3f1586c62297dedfb..f32b3dd1ba8e18911fd58876ed20e494d92ae389 100644 (file)
@@ -67,7 +67,7 @@ static s32 ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
 static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw);
 static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw);
 
-static bool ixgbe_mng_enabled(struct ixgbe_hw *hw)
+bool ixgbe_mng_enabled(struct ixgbe_hw *hw)
 {
        u32 fwsm, manc, factps;
 
@@ -94,7 +94,7 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
         * and MNG not enabled
         */
        if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
-           !hw->mng_fw_enabled) {
+           !ixgbe_mng_enabled(hw)) {
                mac->ops.disable_tx_laser =
                                       &ixgbe_disable_tx_laser_multispeed_fiber;
                mac->ops.enable_tx_laser =
@@ -1206,7 +1206,7 @@ mac_reset_top:
                 * Likewise if we support WoL we don't want change the
                 * LMS state either.
                 */
-               if ((hw->phy.multispeed_fiber && hw->mng_fw_enabled) ||
+               if ((hw->phy.multispeed_fiber && ixgbe_mng_enabled(hw)) ||
                    hw->wol_enabled)
                        hw->mac.orig_autoc =
                                (hw->mac.orig_autoc & ~IXGBE_AUTOC_LMS_MASK) |
@@ -2500,7 +2500,6 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
        .release_swfw_sync      = &ixgbe_release_swfw_sync,
        .get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic,
        .init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic,
-       .mng_fw_enabled         = &ixgbe_mng_enabled,
        .prot_autoc_read        = &prot_autoc_read_82599,
        .prot_autoc_write       = &prot_autoc_write_82599,
 };
index afa1cda90c2e6fd17cd44f6d251cfa93301a0ef7..f12c40fb5537a18604ff030f4adc4287946dbff4 100644 (file)
@@ -111,6 +111,7 @@ s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps);
 s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
                                 u8 build, u8 ver);
 void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);
+bool ixgbe_mng_enabled(struct ixgbe_hw *hw);
 
 void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb,
                             u32 headroom, int strategy);
index 02271f6d9a17948839c4ded59cc7caa2b48c427d..354771f169b684fc2db4ca30c5d5b179f3548ef2 100644 (file)
@@ -8038,10 +8038,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (err)
                goto err_sw_init;
 
-       /* Cache if MNG FW is up so we don't have to read the REG later */
-       if (hw->mac.ops.mng_fw_enabled)
-               hw->mng_fw_enabled = hw->mac.ops.mng_fw_enabled(hw);
-
        /* Make it possible the adapter to be woken up via WOL */
        switch (adapter->hw.mac.type) {
        case ixgbe_mac_82599EB:
@@ -8292,7 +8288,7 @@ skip_sriov:
        ixgbe_dbg_adapter_init(adapter);
 
        /* Need link setup for MNG FW, else wait for IXGBE_UP */
-       if (hw->mng_fw_enabled && hw->mac.ops.setup_link)
+       if (ixgbe_mng_enabled(hw) && hw->mac.ops.setup_link)
                hw->mac.ops.setup_link(hw,
                        IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL,
                        true);
index b5408eb8670b9d72c4c72310b808ee2c0ca5380a..8a6ff2423f076974d1c3c408b97c497d00bdc277 100644 (file)
@@ -2921,7 +2921,6 @@ struct ixgbe_mac_operations {
        s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);
        s32 (*get_thermal_sensor_data)(struct ixgbe_hw *);
        s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);
-       bool (*mng_fw_enabled)(struct ixgbe_hw *hw);
 };
 
 struct ixgbe_phy_operations {
@@ -3052,7 +3051,6 @@ struct ixgbe_hw {
        bool                            adapter_stopped;
        bool                            force_full_reset;
        bool                            allow_unsupported_sfp;
-       bool                            mng_fw_enabled;
        bool                            wol_enabled;
 };
 
index 2e0e5ec5d61f598c19a627fbd02abec4fcf92048..188a5974b85c41f7b8279b6128f72f749e845f76 100644 (file)
@@ -855,7 +855,6 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
        .enable_rx_buff         = &ixgbe_enable_rx_buff_generic,
        .get_thermal_sensor_data = NULL,
        .init_thermal_sensor_thresh = NULL,
-       .mng_fw_enabled         = NULL,
        .prot_autoc_read        = &prot_autoc_read_generic,
        .prot_autoc_write       = &prot_autoc_write_generic,
 };