src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_prot_autoc_write_raptor(struct txgbe_hw *hw, bool locked, u64 autoc)
{
	int err = 0;

	/* Blocked by MNG FW so bail */
	if (txgbe_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 && txgbe_verify_lesm_fw_enabled_raptor(hw)) {
		err = hw->mac.acquire_swfw_sync(hw,
					TXGBE_MNGSEM_SWPHY);
		if (err != 0)
			return TXGBE_ERR_SWFW_SYNC;

		locked = true;
	}

	txgbe_autoc_write(hw, autoc);
	err = txgbe_reset_pipeline_raptor(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.release_swfw_sync(hw, TXGBE_MNGSEM_SWPHY);

	return err;
}
/**
 * txgbe_prot_autoc_write_raptor - 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 prot_autoc_read_raptor.
 *
 * This part 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 prot_autoc_read_raptor.

This part 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 prot_autoc_read_raptor . This part 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 txgbe_prot_autoc_write_raptor(struct txgbe_hw *hw, bool locked, u64 autoc)
{
	int err = 0;
	if (txgbe_check_reset_blocked(hw))
		goto out;
	if (!locked && txgbe_verify_lesm_fw_enabled_raptor(hw)) {
		err = hw->mac.acquire_swfw_sync(hw,
					TXGBE_MNGSEM_SWPHY);
		if (err != 0)
			return TXGBE_ERR_SWFW_SYNC;
		locked = true;
	}
	txgbe_autoc_write(hw, autoc);
	err = txgbe_reset_pipeline_raptor(hw);
out:
	if (locked)
		hw->mac.release_swfw_sync(hw, TXGBE_MNGSEM_SWPHY);
	return err;
}
s32 txgbe_prot_autoc_write_raptor ( struct txgbe_hw * hw , bool locked , u64 autoc ) { int err = 0 ; if ( txgbe_check_reset_blocked ( hw ) ) goto out ; if ( ! locked && txgbe_verify_lesm_fw_enabled_raptor ( hw ) ) { err = hw -> mac . acquire_swfw_sync ( hw , TXGBE_MNGSEM_SWPHY ) ; if ( err != 0 ) return TXGBE_ERR_SWFW_SYNC ; locked = true ; } txgbe_autoc_write ( hw , autoc ) ; err = txgbe_reset_pipeline_raptor ( hw ) ; out : if ( locked ) hw -> mac . release_swfw_sync ( hw , TXGBE_MNGSEM_SWPHY ) ; return err ; }
txgbe_prot_autoc_write_raptor - 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 prot_autoc_read_raptor.
txgbe_prot_autoc_write_raptor - 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 prot_autoc_read_raptor .
/* 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.
	 */