From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0C1014CC5 for ; Wed, 4 Jan 2017 13:09:38 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 04 Jan 2017 04:09:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,459,1477983600"; d="scan'208";a="209520045" Received: from dpdk7.bj.intel.com ([172.16.182.76]) by fmsmga004.fm.intel.com with ESMTP; 04 Jan 2017 04:09:36 -0800 From: Qiming Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, helin.zhang@intel.com, remy.horton@intel.com, Qiming Yang Date: Wed, 4 Jan 2017 20:03:46 +0800 Message-Id: <1483531428-14481-4-git-send-email-qiming.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483531428-14481-1-git-send-email-qiming.yang@intel.com> References: <1482841816-54143-1-git-send-email-qiming.yang@intel.com> <1483531428-14481-1-git-send-email-qiming.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 3/5] net/ixgbe: 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: Wed, 04 Jan 2017 12:09:39 -0000 This patch add a new function ixgbe_fw_version_get. Signed-off-by: Qiming Yang --- v3 changes: * use ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major, __rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 *etrack_id) instead of ixgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_version, int fw_length). Add statusment in /doc/guides/nics/features/ixgbe.ini. --- --- doc/guides/nics/features/ixgbe.ini | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/guides/nics/features/ixgbe.ini b/doc/guides/nics/features/ixgbe.ini index 4a5667f..b46287a 100644 --- a/doc/guides/nics/features/ixgbe.ini +++ b/doc/guides/nics/features/ixgbe.ini @@ -43,6 +43,7 @@ Timesync = Y Basic stats = Y Extended stats = Y Stats per queue = Y +FW_version = Y EEPROM dump = Y Registers dump = Y Multiprocess aware = Y diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index ec2edad..e2234c0 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -193,6 +193,9 @@ static int ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx); +static void ixgbe_fw_version_get(struct rte_eth_dev *dev, + __rte_unused u32 *fw_major, __rte_unused u32 *fw_minor, + __rte_unused u32 *fw_patch, u32 *etrack_id); static void ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static const uint32_t *ixgbe_dev_supported_ptypes_get(struct rte_eth_dev *dev); @@ -538,6 +541,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = { .xstats_reset = ixgbe_dev_xstats_reset, .xstats_get_names = ixgbe_dev_xstats_get_names, .queue_stats_mapping_set = ixgbe_dev_queue_stats_mapping_set, + .fw_version_get = ixgbe_fw_version_get, .dev_infos_get = ixgbe_dev_info_get, .dev_supported_ptypes_get = ixgbe_dev_supported_ptypes_get, .mtu_set = ixgbe_dev_mtu_set, @@ -3029,6 +3033,19 @@ ixgbevf_dev_stats_reset(struct rte_eth_dev *dev) } static void +ixgbe_fw_version_get(struct rte_eth_dev *dev, __rte_unused u32 *fw_major, + __rte_unused u32 *fw_minor, __rte_unused u32 *fw_patch, u32 *etrack_id) +{ + struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + u16 eeprom_verh, eeprom_verl; + + ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh); + ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl); + + *etrack_id = (eeprom_verh << 16) | eeprom_verl; +} + +static void ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev); -- 2.7.4