src/dpdk/drivers/net/igc/base/igc_nvm.c
s32 igc_read_nvm_eerd(struct igc_hw *hw, u16 offset, u16 words, u16 *data)
{
	struct igc_nvm_info *nvm = &hw->nvm;
	u32 i, eerd = 0;
	s32 ret_val = IGC_SUCCESS;

	DEBUGFUNC("igc_read_nvm_eerd");

	/* A check for invalid values:  offset too large, too many words,
	 * too many words for the offset, and not enough words.
	 */
	if (offset >= nvm->word_size || words > (nvm->word_size - offset) ||
			words == 0) {
		DEBUGOUT("nvm parameter(s) out of bounds\n");
		return -IGC_ERR_NVM;
	}

	for (i = 0; i < words; i++) {
		eerd = ((offset + i) << IGC_NVM_RW_ADDR_SHIFT) +
		       IGC_NVM_RW_REG_START;

		IGC_WRITE_REG(hw, IGC_EERD, eerd);
		ret_val = igc_poll_eerd_eewr_done(hw, IGC_NVM_POLL_READ);
		if (ret_val)
			break;

		data[i] = (IGC_READ_REG(hw, IGC_EERD) >>
			   IGC_NVM_RW_REG_DATA);
	}

	if (ret_val)
		DEBUGOUT1("NVM read error: %d\n", ret_val);

	return ret_val;
}
/**
 *  igc_read_nvm_eerd - Reads EEPROM using EERD register
 *  @hw: pointer to the HW structure
 *  @offset: offset of word in the EEPROM to read
 *  @words: number of words to read
 *  @data: word read from the EEPROM
 *
 *  Reads a 16 bit word from the EEPROM using the EERD register.
 **/
Reads EEPROM using EERD register
@hw: pointer to the HW structure
@offset: offset of word in the EEPROM to read
@words: number of words to read
@data: word read from the EEPROM

Reads a 16 bit word from the EEPROM using the EERD register.
Reads EEPROM using EERD register @hw : pointer to the HW structure @offset : offset of word in the EEPROM to read @words : number of words to read @data : word read from the EEPROM Reads a 16 bit word from the EEPROM using the EERD register .
s32 igc_read_nvm_eerd(struct igc_hw *hw, u16 offset, u16 words, u16 *data)
{
	struct igc_nvm_info *nvm = &hw->nvm;
	u32 i, eerd = 0;
	s32 ret_val = IGC_SUCCESS;
	DEBUGFUNC("igc_read_nvm_eerd");
	if (offset >= nvm->word_size || words > (nvm->word_size - offset) ||
			words == 0) {
		DEBUGOUT("nvm parameter(s) out of bounds\n");
		return -IGC_ERR_NVM;
	}
	for (i = 0; i < words; i++) {
		eerd = ((offset + i) << IGC_NVM_RW_ADDR_SHIFT) +
		       IGC_NVM_RW_REG_START;
		IGC_WRITE_REG(hw, IGC_EERD, eerd);
		ret_val = igc_poll_eerd_eewr_done(hw, IGC_NVM_POLL_READ);
		if (ret_val)
			break;
		data[i] = (IGC_READ_REG(hw, IGC_EERD) >>
			   IGC_NVM_RW_REG_DATA);
	}
	if (ret_val)
		DEBUGOUT1("NVM read error: %d\n", ret_val);
	return ret_val;
}
s32 igc_read_nvm_eerd ( struct igc_hw * hw , u16 offset , u16 words , u16 * data ) { struct igc_nvm_info * nvm = & hw -> nvm ; u32 i , eerd = 0 ; s32 ret_val = IGC_SUCCESS ; DEBUGFUNC ( " " ) ; if ( offset >= nvm -> word_size || words > ( nvm -> word_size - offset ) || words == 0 ) { DEBUGOUT ( " \n " ) ; return - IGC_ERR_NVM ; } for ( i = 0 ; i < words ; i ++ ) { eerd = ( ( offset + i ) << IGC_NVM_RW_ADDR_SHIFT ) + IGC_NVM_RW_REG_START ; IGC_WRITE_REG ( hw , IGC_EERD , eerd ) ; ret_val = igc_poll_eerd_eewr_done ( hw , IGC_NVM_POLL_READ ) ; if ( ret_val ) break ; data [ i ] = ( IGC_READ_REG ( hw , IGC_EERD ) >> IGC_NVM_RW_REG_DATA ) ; } if ( ret_val ) DEBUGOUT1 ( " \n " , ret_val ) ; return ret_val ; }
igc_read_nvm_eerd - Reads EEPROM using EERD register
  @hw: pointer to the HW structure
  @offset: offset of word in the EEPROM to read
  @words: number of words to read
  @data: word read from the EEPROM
igc_read_nvm_eerd - Reads EEPROM using EERD register @hw : pointer to the HW structure @offset : offset of word in the EEPROM to read @words : number of words to read @data : word read from the EEPROM
/* A check for invalid values:  offset too large, too many words,
	 * too many words for the offset, and not enough words.
	 */