From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 41D3A5598 for ; Thu, 17 Nov 2016 10:46:48 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 17 Nov 2016 01:46:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,653,1473145200"; d="scan'208";a="1060591453" Received: from unknown (HELO dpdk7.bj.intel.com) ([172.16.182.76]) by orsmga001.jf.intel.com with ESMTP; 17 Nov 2016 01:46:47 -0800 From: Qiming Yang To: dev@dpdk.org Cc: remy.horton@intel.com, jingjing.wu@intel.com, jing.d.chen@intel.com, Qiming Yang Date: Thu, 17 Nov 2016 17:42:52 +0800 Message-Id: <1479375779-46629-2-git-send-email-qiming.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479375779-46629-1-git-send-email-qiming.yang@intel.com> References: <1479375779-46629-1-git-send-email-qiming.yang@intel.com> Subject: [dpdk-dev] [PATCH 1/5] ethdev: add firmware version get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 09:46:49 -0000 This patch added API for 'rte_eth_dev_fwver_get' void rte_eth_dev_fwver_get(uint8_t port_id, char *fw_version, int fw_length); Signed-off-by: Qiming Yang --- lib/librte_ether/rte_ethdev.c | 12 ++++++++++++ lib/librte_ether/rte_ethdev.h | 18 ++++++++++++++++++ lib/librte_ether/rte_ether_version.map | 7 +++++++ 3 files changed, 37 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index fde8112..793e50f 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1538,6 +1538,18 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } void +rte_eth_dev_fwver_get(uint8_t port_id, char *fw_version, int fw_length) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_RET(port_id); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_RET(*dev->dev_ops->fw_version_get); + (*dev->dev_ops->fw_version_get)(dev, fw_version, fw_length); +} + +void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 9678179..cf54f1b 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1150,6 +1150,10 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev, typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset); /**< @internal Check DD bit of specific RX descriptor */ +typedef void (*eth_fw_version_get_t)(struct rte_eth_dev *dev, + char *fw_version, int fw_length); +/**< @internal Get firmware information of an Ethernet device. */ + typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev, uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo); @@ -1444,6 +1448,7 @@ struct eth_dev_ops { /**< Get names of extended statistics. */ eth_queue_stats_mapping_set_t queue_stats_mapping_set; /**< Configure per queue stat counter mapping. */ + eth_fw_version_get_t fw_version_get; /**< Get firmware version. */ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get; /**< Get packet types supported and identified by device*/ @@ -2385,6 +2390,19 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); /** + * Retrieve the firmware version of an Ethernet device. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param fw_version + * A pointer the firmware version of an Ethernet device + * @param fw_length + * The size of the firmware version, which should be large enough to store + * the firmware version of the device. + */ +void rte_eth_dev_fwver_get(uint8_t port_id, char *fw_version, int fw_length); + +/** * Retrieve the supported packet types of an Ethernet device. * * When a packet type is announced as supported, it *must* be recognized by diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index 72be66d..5e6387f 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -147,3 +147,10 @@ DPDK_16.11 { rte_eth_dev_pci_remove; } DPDK_16.07; + +DPDK_17.02 { + global: + + rte_eth_dev_fwver_get; + +} DPDK_16.11; -- 2.7.4