src/dpdk/drivers/net/igc/base/igc_nvm.c
s32 igc_update_nvm_checksum_generic(struct igc_hw *hw)
{
	s32 ret_val;
	u16 checksum = 0;
	u16 i, nvm_data;

	DEBUGFUNC("igc_update_nvm_checksum");

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

	return ret_val;
}
/**
 *  igc_update_nvm_checksum_generic - Update EEPROM checksum
 *  @hw: pointer to the HW structure
 *
 *  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

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 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 igc_update_nvm_checksum_generic(struct igc_hw *hw)
{
	s32 ret_val;
	u16 checksum = 0;
	u16 i, nvm_data;
	DEBUGFUNC("igc_update_nvm_checksum");
	for (i = 0; i < NVM_CHECKSUM_REG; i++) {
		ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
		if (ret_val) {
			DEBUGOUT("NVM Read Error while updating checksum.\n");
			return ret_val;
		}
		checksum += nvm_data;
	}
	checksum = (u16)NVM_SUM - checksum;
	ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
	if (ret_val)
		DEBUGOUT("NVM Write Error while updating checksum.\n");
	return ret_val;
}
s32 igc_update_nvm_checksum_generic ( struct igc_hw * hw ) { s32 ret_val ; u16 checksum = 0 ; u16 i , nvm_data ; DEBUGFUNC ( " " ) ; for ( i = 0 ; i < NVM_CHECKSUM_REG ; i ++ ) { ret_val = hw -> nvm . ops . read ( hw , i , 1 , & nvm_data ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; return ret_val ; } checksum += nvm_data ; } checksum = ( u16 ) NVM_SUM - checksum ; ret_val = hw -> nvm . ops . write ( hw , NVM_CHECKSUM_REG , 1 , & checksum ) ; if ( ret_val ) DEBUGOUT ( " \n " ) ; return ret_val ; }
igc_update_nvm_checksum_generic - Update EEPROM checksum
  @hw: pointer to the HW structure
igc_update_nvm_checksum_generic - Update EEPROM checksum @hw : pointer to the HW structure