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

	DEBUGFUNC("igc_validate_nvm_checksum_generic");

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

	if (checksum != (u16)NVM_SUM) {
		DEBUGOUT("NVM Checksum Invalid\n");
		return -IGC_ERR_NVM;
	}

	return IGC_SUCCESS;
}
/**
 *  igc_validate_nvm_checksum_generic - Validate EEPROM checksum
 *  @hw: pointer to the HW structure
 *
 *  Calculates the EEPROM checksum by reading/adding each word of the EEPROM
 *  and then verifies that the sum of the EEPROM is equal to 0xBABA.
 **/
Validate EEPROM checksum
@hw: pointer to the HW structure

Calculates the EEPROM checksum by reading/adding each word of the EEPROM
and then verifies that the sum of the EEPROM is equal to 0xBABA.
Validate EEPROM checksum @hw : pointer to the HW structure Calculates the EEPROM checksum by reading / adding each word of the EEPROM and then verifies that the sum of the EEPROM is equal to 0xBABA .
s32 igc_validate_nvm_checksum_generic(struct igc_hw *hw)
{
	s32 ret_val;
	u16 checksum = 0;
	u16 i, nvm_data;
	DEBUGFUNC("igc_validate_nvm_checksum_generic");
	for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
		ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
		if (ret_val) {
			DEBUGOUT("NVM Read Error\n");
			return ret_val;
		}
		checksum += nvm_data;
	}
	if (checksum != (u16)NVM_SUM) {
		DEBUGOUT("NVM Checksum Invalid\n");
		return -IGC_ERR_NVM;
	}
	return IGC_SUCCESS;
}
s32 igc_validate_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 + 1 ) ; i ++ ) { ret_val = hw -> nvm . ops . read ( hw , i , 1 , & nvm_data ) ; if ( ret_val ) { DEBUGOUT ( " \n " ) ; return ret_val ; } checksum += nvm_data ; } if ( checksum != ( u16 ) NVM_SUM ) { DEBUGOUT ( " \n " ) ; return - IGC_ERR_NVM ; } return IGC_SUCCESS ; }
igc_validate_nvm_checksum_generic - Validate EEPROM checksum
  @hw: pointer to the HW structure
igc_validate_nvm_checksum_generic - Validate EEPROM checksum @hw : pointer to the HW structure