src/dpdk/drivers/net/i40e/base/i40e_nvm.c
enum i40e_status_code i40e_validate_nvm_checksum(struct i40e_hw *hw,
						 u16 *checksum)
{
	enum i40e_status_code ret_code = I40E_SUCCESS;
	u16 checksum_sr = 0;
	u16 checksum_local = 0;

	DEBUGFUNC("i40e_validate_nvm_checksum");

	/* We must acquire the NVM lock in order to correctly synchronize the
	 * NVM accesses across multiple PFs. Without doing so it is possible
	 * for one of the PFs to read invalid data potentially indicating that
	 * the checksum is invalid.
	 */
	ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
	if (ret_code)
		return ret_code;
	ret_code = i40e_calc_nvm_checksum(hw, &checksum_local);
	__i40e_read_nvm_word(hw, I40E_SR_SW_CHECKSUM_WORD, &checksum_sr);
	i40e_release_nvm(hw);
	if (ret_code)
		return ret_code;

	/* Verify read checksum from EEPROM is the same as
	 * calculated checksum
	 */
	if (checksum_local != checksum_sr)
		ret_code = I40E_ERR_NVM_CHECKSUM;

	/* If the user cares, return the calculated checksum */
	if (checksum)
		*checksum = checksum_local;

	return ret_code;
}
/**
 * i40e_validate_nvm_checksum - Validate EEPROM checksum
 * @hw: pointer to hardware structure
 * @checksum: calculated checksum
 *
 * Performs checksum calculation and validates the NVM SW checksum. If the
 * caller does not need checksum, the value can be NULL.
 **/
Validate EEPROM checksum
@hw: pointer to hardware structure
@checksum: calculated checksum

Performs checksum calculation and validates the NVM SW checksum. If the
caller does not need checksum, the value can be NULL.
Validate EEPROM checksum @hw : pointer to hardware structure @checksum : calculated checksum Performs checksum calculation and validates the NVM SW checksum . If the caller does not need checksum the value can be NULL .
enum i40e_status_code i40e_validate_nvm_checksum(struct i40e_hw *hw,
						 u16 *checksum)
{
	enum i40e_status_code ret_code = I40E_SUCCESS;
	u16 checksum_sr = 0;
	u16 checksum_local = 0;
	DEBUGFUNC("i40e_validate_nvm_checksum");
	ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
	if (ret_code)
		return ret_code;
	ret_code = i40e_calc_nvm_checksum(hw, &checksum_local);
	__i40e_read_nvm_word(hw, I40E_SR_SW_CHECKSUM_WORD, &checksum_sr);
	i40e_release_nvm(hw);
	if (ret_code)
		return ret_code;
	if (checksum_local != checksum_sr)
		ret_code = I40E_ERR_NVM_CHECKSUM;
	if (checksum)
		*checksum = checksum_local;
	return ret_code;
}
enum i40e_status_code i40e_validate_nvm_checksum ( struct i40e_hw * hw , u16 * checksum ) { enum i40e_status_code ret_code = I40E_SUCCESS ; u16 checksum_sr = 0 ; u16 checksum_local = 0 ; DEBUGFUNC ( " " ) ; ret_code = i40e_acquire_nvm ( hw , I40E_RESOURCE_READ ) ; if ( ret_code ) return ret_code ; ret_code = i40e_calc_nvm_checksum ( hw , & checksum_local ) ; __i40e_read_nvm_word ( hw , I40E_SR_SW_CHECKSUM_WORD , & checksum_sr ) ; i40e_release_nvm ( hw ) ; if ( ret_code ) return ret_code ; if ( checksum_local != checksum_sr ) ret_code = I40E_ERR_NVM_CHECKSUM ; if ( checksum ) * checksum = checksum_local ; return ret_code ; }
i40e_validate_nvm_checksum - Validate EEPROM checksum
 @hw: pointer to hardware structure
 @checksum: calculated checksum
i40e_validate_nvm_checksum - Validate EEPROM checksum @hw : pointer to hardware structure @checksum : calculated checksum
/* We must acquire the NVM lock in order to correctly synchronize the
	 * NVM accesses across multiple PFs. Without doing so it is possible
	 * for one of the PFs to read invalid data potentially indicating that
	 * the checksum is invalid.
	 */ /* Verify read checksum from EEPROM is the same as
	 * calculated checksum
	 */ /* If the user cares, return the calculated checksum */