src/dpdk/drivers/net/e1000/base/e1000_82575.c
s32 e1000_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset)
{
	s32 ret_val;
	u16 checksum = 0;
	u16 i, nvm_data;

	DEBUGFUNC("e1000_update_nvm_checksum_with_offset");

	for (i = offset; i < (NVM_CHECKSUM_REG + offset); i++) {
		ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
		if (ret_val) {
			DEBUGOUT("NVM Read Error while updating checksum.\n");
			goto out;
		}
		checksum += nvm_data;
	}
	checksum = (u16) NVM_SUM - checksum;
	ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1,
				    &checksum);
	if (ret_val)
		DEBUGOUT("NVM Write Error while updating checksum.\n");

out:
	return ret_val;
}
/**
 *  e1000_update_nvm_checksum_with_offset - Update EEPROM
 *  checksum
 *  @hw: pointer to the HW structure
 *  @offset: offset in words of the checksum protected region
 *
 *  Updates the EEPROM checksum by reading/adding each word of the EEPROM
 *  up to the checksum.  Then calculates the EEPROM checksum and writes the
 *  value to the EEPROM.
 **/
Update EEPROM
checksum
@hw: pointer to the HW structure
@offset: offset in words of the checksum protected region

Updates the EEPROM checksum by reading/adding each word of the EEPROM
up to the checksum.  Then calculates the EEPROM checksum and writes the
value to the EEPROM.
Update EEPROM checksum @hw : pointer to the HW structure @offset : offset in words of the checksum protected region Updates the EEPROM checksum by reading / adding each word of the EEPROM up to the checksum . Then calculates the EEPROM checksum and writes the value to the EEPROM .
s32 e1000_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset)
{
	s32 ret_val;
	u16 checksum = 0;
	u16 i, nvm_data;
	DEBUGFUNC("e1000_update_nvm_checksum_with_offset");
	for (i = offset; i < (NVM_CHECKSUM_REG + offset); i++) {
		ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
		if (ret_val) {
			DEBUGOUT("NVM Read Error while updating checksum.\n");
			goto out;
		}
		checksum += nvm_data;
	}
	checksum = (u16) NVM_SUM - checksum;
	ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1,
				    &checksum);
	if (ret_val)
		DEBUGOUT("NVM Write Error while updating checksum.\n");
out:
	return ret_val;
}
s32 e1000_update_nvm_checksum_with_offset ( struct e1000_hw * hw , u16 offset ) { s32 ret_val ; u16 checksum = 0 ; u16 i , nvm_data ; DEBUGFUNC ( " " ) ; for ( i = offset ; i < ( NVM_CHECKSUM_REG + offset ) ; i ++ ) { ret_val = hw -> nvm . ops . read ( hw , i , 1 , & nvm_data ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; goto out ; } checksum += nvm_data ; } checksum = ( u16 ) NVM_SUM - checksum ; ret_val = hw -> nvm . ops . write ( hw , ( NVM_CHECKSUM_REG + offset ) , 1 , & checksum ) ; if ( ret_val ) DEBUGOUT ( " \n " ) ; out : return ret_val ; }
e1000_update_nvm_checksum_with_offset - Update EEPROM
  checksum
  @hw: pointer to the HW structure
  @offset: offset in words of the checksum protected region
e1000_update_nvm_checksum_with_offset - Update EEPROM checksum @hw : pointer to the HW structure @offset : offset in words of the checksum protected region