From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id BBE272B91 for ; Tue, 27 Dec 2016 13:35:50 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 27 Dec 2016 04:35:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,416,1477983600"; d="scan'208";a="916475375" Received: from dpdk7.bj.intel.com ([172.16.182.76]) by orsmga003.jf.intel.com with ESMTP; 27 Dec 2016 04:35:49 -0800 From: Qiming Yang To: dev@dpdk.org, thomas.monjalon@6wind.com Cc: remy.horton@intel.com, ferruh.yigit@intel.com, Qiming Yang Date: Tue, 27 Dec 2016 20:30:16 +0800 Message-Id: <1482841816-54143-5-git-send-email-qiming.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482841816-54143-1-git-send-email-qiming.yang@intel.com> References: <1481008582-69416-1-git-send-email-qiming.yang@intel.com> <1482841816-54143-1-git-send-email-qiming.yang@intel.com> Subject: [dpdk-dev] [PATCH v3 4/4] net/i40e: add firmware version get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 12:35:51 -0000 This patch add a new function i40e_fw_version_get. Signed-off-by: Qiming Yang --- v3 changes: * use i40e_fw_version_get(struct rte_eth_dev *dev, u32 *fw_major, u32 *fw_minor, __rte_unused u32 *fw_patch, u32 *etrack_id) instead of i40e_fw_version_get(struct rte_eth_dev *dev, char *fw_version, int fw_length). Add statusment in /doc/guides/nics/features/i40e.ini. --- --- doc/guides/nics/features/i40e.ini | 1 + drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/guides/nics/features/i40e.ini b/doc/guides/nics/features/i40e.ini index 0d143bc..6dab9f7 100644 --- a/doc/guides/nics/features/i40e.ini +++ b/doc/guides/nics/features/i40e.ini @@ -46,3 +46,4 @@ Linux VFIO = Y x86-32 = Y x86-64 = Y ARMv8 = Y +FW version = Y diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 8f63044..1dbbcc4 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -324,6 +324,8 @@ static int i40e_dev_queue_stats_mapping_set(struct rte_eth_dev *dev, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx); +static void i40e_fw_version_get(struct rte_eth_dev *dev, u32 *fw_major, + u32 *fw_minor, __rte_unused u32 *fw_patch, u32 *etrack_id); static void i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static int i40e_vlan_filter_set(struct rte_eth_dev *dev, @@ -503,6 +505,7 @@ static const struct eth_dev_ops i40e_eth_dev_ops = { .stats_reset = i40e_dev_stats_reset, .xstats_reset = i40e_dev_stats_reset, .queue_stats_mapping_set = i40e_dev_queue_stats_mapping_set, + .fw_version_get = i40e_fw_version_get, .dev_infos_get = i40e_dev_info_get, .dev_supported_ptypes_get = i40e_dev_supported_ptypes_get, .vlan_filter_set = i40e_vlan_filter_set, @@ -2590,6 +2593,18 @@ i40e_dev_queue_stats_mapping_set(__rte_unused struct rte_eth_dev *dev, } static void +i40e_fw_version_get(struct rte_eth_dev *dev, u32 *fw_major, u32 *fw_minor, + __rte_unused u32 *fw_patch, u32 *etrack_id) +{ + struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + *fw_major = (hw->nvm.version >> 12) & 0xf; + *fw_minor = ((hw->nvm.version >> 4) & 0xff) * 10 + + (hw->nvm.version & 0xf); + *etrack_id = hw->nvm.eetrack; +} + +static void i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); -- 2.7.4