Skip to contentSkip to conversation

ixgbe: add new function to check for management presence

PATCH New Donald C Skidmore 2 participants 2 messages Jun 11, 2015 – Sep 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: add new function to check for management presence

From: Don Skidmore <[email protected]>

This patchs adds a support function that will indicate for the existence of management FW.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c  |    8 ++------
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c |   15 +++++++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.h |    1 +
 3 files changed, 18 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +2 -6
index b1e364d..08fcf57 100644
@@ -504,16 +504,12 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
  **/
 static void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw)
 {
-	u32 autoc2_reg, fwsm;
+	u32 autoc2_reg;
 	u16 ee_ctrl_2 = 0;
 
 	hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2);
 
-	/* Check to see if MNG FW could be enabled */
-	fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw));
-
-	if (((fwsm & IXGBE_FWSM_MODE_MASK) != IXGBE_FWSM_FW_MODE_PT) &&
-	    !hw->wol_enabled &&
+	if (!ixgbe_mng_present(hw) && !hw->wol_enabled &&
 	    ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) {
 		autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
 		autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK;
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +15 -0
index 4c1c267..7a5cb8b 100644
@@ -3905,3 +3905,18 @@ void ixgbe_enable_rx_generic(struct ixgbe_hw *hw)
 		}
 	}
 }
+
+/** ixgbe_mng_present - returns true when management capability is present
+  * @hw: pointer to hardware structure
+  **/
+bool ixgbe_mng_present(struct ixgbe_hw *hw)
+{
+	u32 fwsm;
+
+	if (hw->mac.type < ixgbe_mac_82599EB)
+		return false;
+
+	fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw));
+	fwsm &= IXGBE_FWSM_MODE_MASK;
+	return fwsm == IXGBE_FWSM_FW_MODE_PT;
+}
drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +1 -0
index ec015fe..2f779f3 100644
@@ -113,6 +113,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
 s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 				 u32 length, u32 timeout, bool return_data);
 void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);
+bool ixgbe_mng_present(struct ixgbe_hw *hw);
 bool ixgbe_mng_enabled(struct ixgbe_hw *hw);
 
 void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb,
#1 lore raw

PATCH 1/1 ixgbe: add new function to check for management presence

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Donald C Skidmore
Sent: Wednesday, June 10, 2015 5:05 PM
To: [email protected]
Subject: [Intel-wired-lan] [net-next PATCH] ixgbe: add new function to check for management presence

From: Don Skidmore <[email protected]>

This patchs adds a support function that will indicate for the existence of management FW.

---