src/dpdk/drivers/net/ixgbe/base/ixgbe_82599.c
s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
{
	s32 ret_val = IXGBE_SUCCESS;

	/* Blocked by MNG FW so bail */
	if (ixgbe_check_reset_blocked(hw))
		goto out;

	/* We only need to get the lock if:
	 *  - We didn't do it already (in the read part of a read-modify-write)
	 *  - LESM is enabled.
	 */
	if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) {
		ret_val = hw->mac.ops.acquire_swfw_sync(hw,
					IXGBE_GSSR_MAC_CSR_SM);
		if (ret_val != IXGBE_SUCCESS)
			return IXGBE_ERR_SWFW_SYNC;

		locked = true;
	}

	IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
	ret_val = ixgbe_reset_pipeline_82599(hw);

out:
	/* Free the SW/FW semaphore as we either grabbed it here or
	 * already had it when this function was called.
	 */
	if (locked)
		hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);

	return ret_val;
}
/**
 * prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write
 * @hw: pointer to hardware structure
 * @autoc: value to write to AUTOC
 * @locked: bool to indicate whether the SW/FW lock was already taken by
 *          previous proc_autoc_read_82599.
 *
 * This part (82599) may need to hold the SW/FW lock around all writes to
 * AUTOC. Likewise after a write we need to do a pipeline reset.
 */
Hides MAC differences needed for AUTOC write
@hw: pointer to hardware structure
@autoc: value to write to AUTOC
@locked: bool to indicate whether the SW/FW lock was already taken by
previous proc_autoc_read_82599.

This part (82599) may need to hold the SW/FW lock around all writes to
AUTOC. Likewise after a write we need to do a pipeline reset.
Hides MAC differences needed for AUTOC write @hw : pointer to hardware structure @autoc : value to write to AUTOC @locked : bool to indicate whether the SW / FW lock was already taken by previous proc_autoc_read_82599 . This part ( 82599 ) may need to hold the SW / FW lock around all writes to AUTOC . Likewise after a write we need to do a pipeline reset .
s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
{
	s32 ret_val = IXGBE_SUCCESS;
	if (ixgbe_check_reset_blocked(hw))
		goto out;
	if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) {
		ret_val = hw->mac.ops.acquire_swfw_sync(hw,
					IXGBE_GSSR_MAC_CSR_SM);
		if (ret_val != IXGBE_SUCCESS)
			return IXGBE_ERR_SWFW_SYNC;
		locked = true;
	}
	IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
	ret_val = ixgbe_reset_pipeline_82599(hw);
out:
	if (locked)
		hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
	return ret_val;
}
s32 prot_autoc_write_82599 ( struct ixgbe_hw * hw , u32 autoc , bool locked ) { s32 ret_val = IXGBE_SUCCESS ; if ( ixgbe_check_reset_blocked ( hw ) ) goto out ; if ( ! locked && ixgbe_verify_lesm_fw_enabled_82599 ( hw ) ) { ret_val = hw -> mac . ops . acquire_swfw_sync ( hw , IXGBE_GSSR_MAC_CSR_SM ) ; if ( ret_val != IXGBE_SUCCESS ) return IXGBE_ERR_SWFW_SYNC ; locked = true ; } IXGBE_WRITE_REG ( hw , IXGBE_AUTOC , autoc ) ; ret_val = ixgbe_reset_pipeline_82599 ( hw ) ; out : if ( locked ) hw -> mac . ops . release_swfw_sync ( hw , IXGBE_GSSR_MAC_CSR_SM ) ; return ret_val ; }
prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write
 @hw: pointer to hardware structure
 @autoc: value to write to AUTOC
 @locked: bool to indicate whether the SW/FW lock was already taken by
          previous proc_autoc_read_82599.
prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write @hw : pointer to hardware structure @autoc : value to write to AUTOC @locked : bool to indicate whether the SW / FW lock was already taken by previous proc_autoc_read_82599 .
/* Blocked by MNG FW so bail */ /* We only need to get the lock if:
	 *  - We didn't do it already (in the read part of a read-modify-write)
	 *  - LESM is enabled.
	 */ /* Free the SW/FW semaphore as we either grabbed it here or
	 * already had it when this function was called.
	 */