From: Jingjing Wu Date: Sun, 6 Sep 2015 07:11:23 +0000 (+0800) Subject: i40e/base: get OEM version X-Git-Tag: spdx-start~8454 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8d6c51fcd24b;p=dpdk.git i40e/base: get OEM version This patch adds a member to the nvm_info struct for oem_ver info to be output either by OID or ethtool. Signed-off-by: Jingjing Wu Acked-by: Helin Zhang Tested-by: Huilong Xu --- diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c index 556470fe6b..b2a96fa7cf 100644 --- a/drivers/net/i40e/base/i40e_adminq.c +++ b/drivers/net/i40e/base/i40e_adminq.c @@ -563,6 +563,7 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) enum i40e_status_code ret_code; #ifdef PF_DRIVER u16 eetrack_lo, eetrack_hi; + u16 cfg_ptr, oem_hi, oem_lo; int retry = 0; #endif /* verify input for valid configuration */ @@ -627,6 +628,12 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; + i40e_read_nvm_word(hw, I40E_SR_BOOT_CONFIG_PTR, &cfg_ptr); + i40e_read_nvm_word(hw, (cfg_ptr + I40E_NVM_OEM_VER_OFF), + &oem_hi); + i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), + &oem_lo); + hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index 1f46f38719..4ea9c2d635 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -345,6 +345,7 @@ struct i40e_nvm_info { bool blank_nvm_mode; /* is NVM empty (no FW present)*/ u16 version; /* NVM package version */ u32 eetrack; /* NVM data version */ + u32 oem_ver; /* OEM version info */ }; /* definitions used in NVM update support */ @@ -1301,6 +1302,7 @@ struct i40e_hw_port_stats { #define I40E_SR_PBA_FLAGS 0x15 #define I40E_SR_PBA_BLOCK_PTR 0x16 #define I40E_SR_BOOT_CONFIG_PTR 0x17 +#define I40E_NVM_OEM_VER_OFF 0x83 #define I40E_SR_NVM_DEV_STARTER_VERSION 0x18 #define I40E_SR_NVM_WAKE_ON_LAN 0x19 #define I40E_SR_ALTERNATE_SAN_MAC_ADDRESS_PTR 0x27