src/dpdk/drivers/net/i40e/base/i40e_nvm.c
enum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
					   u16 *words, u16 *data)
{
	enum i40e_status_code ret_code = I40E_SUCCESS;

	if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {
		ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
		if (!ret_code) {
			ret_code = i40e_read_nvm_buffer_aq(hw, offset, words,
							 data);
			i40e_release_nvm(hw);
		}
	} else {
		ret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data);
	}

	return ret_code;
}
/**
 * i40e_read_nvm_buffer - Reads Shadow RAM buffer and acquire lock if necessary
 * @hw: pointer to the HW structure
 * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF).
 * @words: (in) number of words to read; (out) number of words actually read
 * @data: words read from the Shadow RAM
 *
 * Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd()
 * method. The buffer read is preceded by the NVM ownership take
 * and followed by the release.
 **/
Reads Shadow RAM buffer and acquire lock if necessary
@hw: pointer to the HW structure
@offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF).
@words: (in) number of words to read; (out) number of words actually read
@data: words read from the Shadow RAM

Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd()
method. The buffer read is preceded by the NVM ownership take
and followed by the release.
Reads Shadow RAM buffer and acquire lock if necessary @hw : pointer to the HW structure @offset : offset of the Shadow RAM word to read ( 0x000000 - 0x001FFF ) . @words : ( in ) number of words to read ; ( out ) number of words actually read @data : words read from the Shadow RAM Reads 16 bit words ( data buffer ) from the SR using the i40e_read_nvm_srrd () method . The buffer read is preceded by the NVM ownership take and followed by the release .
enum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
					   u16 *words, u16 *data)
{
	enum i40e_status_code ret_code = I40E_SUCCESS;
	if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {
		ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
		if (!ret_code) {
			ret_code = i40e_read_nvm_buffer_aq(hw, offset, words,
							 data);
			i40e_release_nvm(hw);
		}
	} else {
		ret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data);
	}
	return ret_code;
}
enum i40e_status_code i40e_read_nvm_buffer ( struct i40e_hw * hw , u16 offset , u16 * words , u16 * data ) { enum i40e_status_code ret_code = I40E_SUCCESS ; if ( hw -> flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE ) { ret_code = i40e_acquire_nvm ( hw , I40E_RESOURCE_READ ) ; if ( ! ret_code ) { ret_code = i40e_read_nvm_buffer_aq ( hw , offset , words , data ) ; i40e_release_nvm ( hw ) ; } } else { ret_code = i40e_read_nvm_buffer_srctl ( hw , offset , words , data ) ; } return ret_code ; }
i40e_read_nvm_buffer - Reads Shadow RAM buffer and acquire lock if necessary
 @hw: pointer to the HW structure
 @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF).
i40e_read_nvm_buffer - Reads Shadow RAM buffer and acquire lock if necessary @hw : pointer to the HW structure @offset : offset of the Shadow RAM word to read ( 0x000000 - 0x001FFF ) .