src/dpdk/drivers/net/e1000/base/e1000_manage.c
bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
{
	u32 manc;
	u32 fwsm, factps;

	DEBUGFUNC("e1000_enable_mng_pass_thru");

	if (!hw->mac.asf_firmware_present)
		return false;

	manc = E1000_READ_REG(hw, E1000_MANC);

	if (!(manc & E1000_MANC_RCV_TCO_EN))
		return false;

	if (hw->mac.has_fwsm) {
		fwsm = E1000_READ_REG(hw, E1000_FWSM);
		factps = E1000_READ_REG(hw, E1000_FACTPS);

		if (!(factps & E1000_FACTPS_MNGCG) &&
		    ((fwsm & E1000_FWSM_MODE_MASK) ==
		     (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT)))
			return true;
	} else if ((hw->mac.type == e1000_82574) ||
		   (hw->mac.type == e1000_82583)) {
		u16 data;
		s32 ret_val;

		factps = E1000_READ_REG(hw, E1000_FACTPS);
		ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
		if (ret_val)
			return false;

		if (!(factps & E1000_FACTPS_MNGCG) &&
		    ((data & E1000_NVM_INIT_CTRL2_MNGM) ==
		     (e1000_mng_mode_pt << 13)))
			return true;
	} else if ((manc & E1000_MANC_SMBUS_EN) &&
		   !(manc & E1000_MANC_ASF_EN)) {
		return true;
	}

	return false;
}
/**
 *  e1000_enable_mng_pass_thru - Check if management passthrough is needed
 *  @hw: pointer to the HW structure
 *
 *  Verifies the hardware needs to leave interface enabled so that frames can
 *  be directed to and from the management interface.
 **/
Check if management passthrough is needed
@hw: pointer to the HW structure

Verifies the hardware needs to leave interface enabled so that frames can
be directed to and from the management interface.
Check if management passthrough is needed @hw : pointer to the HW structure Verifies the hardware needs to leave interface enabled so that frames can be directed to and from the management interface .
bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
{
	u32 manc;
	u32 fwsm, factps;
	DEBUGFUNC("e1000_enable_mng_pass_thru");
	if (!hw->mac.asf_firmware_present)
		return false;
	manc = E1000_READ_REG(hw, E1000_MANC);
	if (!(manc & E1000_MANC_RCV_TCO_EN))
		return false;
	if (hw->mac.has_fwsm) {
		fwsm = E1000_READ_REG(hw, E1000_FWSM);
		factps = E1000_READ_REG(hw, E1000_FACTPS);
		if (!(factps & E1000_FACTPS_MNGCG) &&
		    ((fwsm & E1000_FWSM_MODE_MASK) ==
		     (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT)))
			return true;
	} else if ((hw->mac.type == e1000_82574) ||
		   (hw->mac.type == e1000_82583)) {
		u16 data;
		s32 ret_val;
		factps = E1000_READ_REG(hw, E1000_FACTPS);
		ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
		if (ret_val)
			return false;
		if (!(factps & E1000_FACTPS_MNGCG) &&
		    ((data & E1000_NVM_INIT_CTRL2_MNGM) ==
		     (e1000_mng_mode_pt << 13)))
			return true;
	} else if ((manc & E1000_MANC_SMBUS_EN) &&
		   !(manc & E1000_MANC_ASF_EN)) {
		return true;
	}
	return false;
}
bool e1000_enable_mng_pass_thru ( struct e1000_hw * hw ) { u32 manc ; u32 fwsm , factps ; DEBUGFUNC ( " " ) ; if ( ! hw -> mac . asf_firmware_present ) return false ; manc = E1000_READ_REG ( hw , E1000_MANC ) ; if ( ! ( manc & E1000_MANC_RCV_TCO_EN ) ) return false ; if ( hw -> mac . has_fwsm ) { fwsm = E1000_READ_REG ( hw , E1000_FWSM ) ; factps = E1000_READ_REG ( hw , E1000_FACTPS ) ; if ( ! ( factps & E1000_FACTPS_MNGCG ) && ( ( fwsm & E1000_FWSM_MODE_MASK ) == ( e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT ) ) ) return true ; } else if ( ( hw -> mac . type == e1000_82574 ) || ( hw -> mac . type == e1000_82583 ) ) { u16 data ; s32 ret_val ; factps = E1000_READ_REG ( hw , E1000_FACTPS ) ; ret_val = e1000_read_nvm ( hw , NVM_INIT_CONTROL2_REG , 1 , & data ) ; if ( ret_val ) return false ; if ( ! ( factps & E1000_FACTPS_MNGCG ) && ( ( data & E1000_NVM_INIT_CTRL2_MNGM ) == ( e1000_mng_mode_pt << 13 ) ) ) return true ; } else if ( ( manc & E1000_MANC_SMBUS_EN ) && ! ( manc & E1000_MANC_ASF_EN ) ) { return true ; } return false ; }
e1000_enable_mng_pass_thru - Check if management passthrough is needed
  @hw: pointer to the HW structure
e1000_enable_mng_pass_thru - Check if management passthrough is needed @hw : pointer to the HW structure