From patchwork Thu Feb 27 22:36:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 11411067 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DDEC138D for ; Thu, 27 Feb 2020 22:36:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 850D8246A4 for ; Thu, 27 Feb 2020 22:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730394AbgB0Wgw (ORCPT ); Thu, 27 Feb 2020 17:36:52 -0500 Received: from mga18.intel.com ([134.134.136.126]:49955 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730279AbgB0Wgm (ORCPT ); Thu, 27 Feb 2020 17:36:42 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 14:36:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,493,1574150400"; d="scan'208";a="238568408" Received: from jekeller-desk.amr.corp.intel.com (HELO jekeller-desk.jekeller.internal) ([10.166.244.172]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2020 14:36:42 -0800 From: Jacob Keller To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: Jacob Keller , Bjorn Helgaas , Jeff Kirsher , QLogic-Storage-Upstream@cavium.com, Michael Chan Subject: [PATCH 1/5] pci: introduce pci_get_dsn Date: Thu, 27 Feb 2020 14:36:31 -0800 Message-Id: <20200227223635.1021197-3-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.25.0.368.g28a2d05eebfb In-Reply-To: <20200227223635.1021197-1-jacob.e.keller@intel.com> References: <20200227223635.1021197-1-jacob.e.keller@intel.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Several device drivers read their Device Serial Number from the PCIe extended config space. Introduce a new helper function, pci_get_dsn, which will read the eight bytes of the DSN into the provided buffer. Signed-off-by: Jacob Keller Cc: Bjorn Helgaas Cc: Jeff Kirsher Cc: QLogic-Storage-Upstream@cavium.com Cc: Michael Chan --- drivers/pci/pci.c | 33 +++++++++++++++++++++++++++++++++ include/linux/pci.h | 5 +++++ 2 files changed, 38 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d828ca835a98..12d8101724d7 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "pci.h" @@ -557,6 +558,38 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap) } EXPORT_SYMBOL_GPL(pci_find_ext_capability); +/** + * pci_get_dsn - Read the 8-byte Device Serial Number + * @dev: PCI device to query + * @dsn: storage for the DSN. Must be at least 8 bytes + * + * Looks up the PCI_EXT_CAP_ID_DSN and reads the 8 bytes into the dsn storage. + * Returns -EOPNOTSUPP if the device does not have the capability. + */ +int pci_get_dsn(struct pci_dev *dev, u8 dsn[]) +{ + u32 dword; + int pos; + + + pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DSN); + if (!pos) + return -EOPNOTSUPP; + + /* + * The Device Serial Number is two dwords offset 4 bytes from the + * capability position. + */ + pos += 4; + pci_read_config_dword(dev, pos, &dword); + put_unaligned_le32(dword, &dsn[0]); + pci_read_config_dword(dev, pos + 4, &dword); + put_unaligned_le32(dword, &dsn[4]); + + return 0; +} +EXPORT_SYMBOL_GPL(pci_get_dsn); + static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) { int rc, ttl = PCI_FIND_CAP_TTL; diff --git a/include/linux/pci.h b/include/linux/pci.h index 3840a541a9de..883562323df3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1045,6 +1045,8 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); struct pci_bus *pci_find_next_bus(const struct pci_bus *from); +int pci_get_dsn(struct pci_dev *dev, u8 dsn[]); + struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from); struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, @@ -1699,6 +1701,9 @@ static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) { return 0; } +static inline int pci_get_dsn(struct pci_dev *dev, u8 dsn[]) +{ return -EOPNOTSUPP; } + /* Power management related routines */ static inline int pci_save_state(struct pci_dev *dev) { return 0; } static inline void pci_restore_state(struct pci_dev *dev) { } From patchwork Thu Feb 27 22:36:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 11411065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B09C4138D for ; Thu, 27 Feb 2020 22:36:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FEB4246A8 for ; Thu, 27 Feb 2020 22:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730345AbgB0Wgn (ORCPT ); Thu, 27 Feb 2020 17:36:43 -0500 Received: from mga18.intel.com ([134.134.136.126]:49955 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730310AbgB0Wgn (ORCPT ); Thu, 27 Feb 2020 17:36:43 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 14:36:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,493,1574150400"; d="scan'208";a="238568413" Received: from jekeller-desk.amr.corp.intel.com (HELO jekeller-desk.jekeller.internal) ([10.166.244.172]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2020 14:36:43 -0800 From: Jacob Keller To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: Jacob Keller , Michael Chan Subject: [PATCH 2/5] bnxt_en: use pci_get_dsn Date: Thu, 27 Feb 2020 14:36:32 -0800 Message-Id: <20200227223635.1021197-4-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.25.0.368.g28a2d05eebfb In-Reply-To: <20200227223635.1021197-1-jacob.e.keller@intel.com> References: <20200227223635.1021197-1-jacob.e.keller@intel.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace the open-coded implementation for reading the PCIe DSN with pci_get_dsn. Signed-off-by: Jacob Keller Cc: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 597e6fd5bfea..55f078fc067e 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11755,20 +11755,14 @@ static int bnxt_init_mac_addr(struct bnxt *bp) static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[]) { struct pci_dev *pdev = bp->pdev; - int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_DSN); - u32 dw; + int err; - if (!pos) { + err = pci_get_dsn(pdev, dsn); + if (err) { netdev_info(bp->dev, "Unable do read adapter's DSN"); - return -EOPNOTSUPP; + return err; } - /* DSN (two dw) is at an offset of 4 from the cap pos */ - pos += 4; - pci_read_config_dword(pdev, pos, &dw); - put_unaligned_le32(dw, &dsn[0]); - pci_read_config_dword(pdev, pos + 4, &dw); - put_unaligned_le32(dw, &dsn[4]); bp->flags |= BNXT_FLAG_DSN_VALID; return 0; } From patchwork Thu Feb 27 22:36:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 11411059 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8C4F138D for ; Thu, 27 Feb 2020 22:36:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 99E32246A6 for ; Thu, 27 Feb 2020 22:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730419AbgB0Wgo (ORCPT ); Thu, 27 Feb 2020 17:36:44 -0500 Received: from mga18.intel.com ([134.134.136.126]:49955 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729944AbgB0Wgn (ORCPT ); Thu, 27 Feb 2020 17:36:43 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 14:36:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,493,1574150400"; d="scan'208";a="238568417" Received: from jekeller-desk.amr.corp.intel.com (HELO jekeller-desk.jekeller.internal) ([10.166.244.172]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2020 14:36:43 -0800 From: Jacob Keller To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: Jacob Keller , QLogic-Storage-Upstream@cavium.com Subject: [PATCH 3/5] scsi: qedf: use pci_get_dsn Date: Thu, 27 Feb 2020 14:36:33 -0800 Message-Id: <20200227223635.1021197-5-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.25.0.368.g28a2d05eebfb In-Reply-To: <20200227223635.1021197-1-jacob.e.keller@intel.com> References: <20200227223635.1021197-1-jacob.e.keller@intel.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace the open-coded implementation for reading the PCIe DSN with pci_get_dsn. Signed-off-by: Jacob Keller Cc: QLogic-Storage-Upstream@cavium.com --- drivers/scsi/qedf/qedf_main.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 604856e72cfb..6ef688ef465c 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -1578,7 +1578,7 @@ static void qedf_setup_fdmi(struct qedf_ctx *qedf) struct fc_lport *lport = qedf->lport; struct fc_host_attrs *fc_host = shost_to_fc_host(lport->host); u8 buf[8]; - int i, pos; + int i, err; /* * fdmi_enabled needs to be set for libfc to execute FDMI registration. @@ -1591,20 +1591,16 @@ static void qedf_setup_fdmi(struct qedf_ctx *qedf) */ /* Get the PCI-e Device Serial Number Capability */ - pos = pci_find_ext_capability(qedf->pdev, PCI_EXT_CAP_ID_DSN); - if (pos) { - pos += 4; - for (i = 0; i < 8; i++) - pci_read_config_byte(qedf->pdev, pos + i, &buf[i]); - + err = pci_get_dsn(qedf->pdev, buf); + if (err) + snprintf(fc_host->serial_number, + sizeof(fc_host->serial_number), "Unknown"); + else snprintf(fc_host->serial_number, sizeof(fc_host->serial_number), "%02X%02X%02X%02X%02X%02X%02X%02X", buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]); - } else - snprintf(fc_host->serial_number, - sizeof(fc_host->serial_number), "Unknown"); snprintf(fc_host->manufacturer, sizeof(fc_host->manufacturer), "%s", "Cavium Inc."); From patchwork Thu Feb 27 22:36:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 11411063 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37D141580 for ; Thu, 27 Feb 2020 22:36:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20CB5246A1 for ; Thu, 27 Feb 2020 22:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730442AbgB0Wgp (ORCPT ); Thu, 27 Feb 2020 17:36:45 -0500 Received: from mga18.intel.com ([134.134.136.126]:49955 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730420AbgB0Wgo (ORCPT ); Thu, 27 Feb 2020 17:36:44 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 14:36:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,493,1574150400"; d="scan'208";a="238568424" Received: from jekeller-desk.amr.corp.intel.com (HELO jekeller-desk.jekeller.internal) ([10.166.244.172]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2020 14:36:44 -0800 From: Jacob Keller To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: Jacob Keller , Jeff Kirsher Subject: [PATCH 4/5] ice: use pci_get_dsn Date: Thu, 27 Feb 2020 14:36:34 -0800 Message-Id: <20200227223635.1021197-6-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.25.0.368.g28a2d05eebfb In-Reply-To: <20200227223635.1021197-1-jacob.e.keller@intel.com> References: <20200227223635.1021197-1-jacob.e.keller@intel.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace the open-coded implementation for reading the PCIe DSN with pci_get_dsn. Signed-off-by: Jacob Keller Cc: Jeff Kirsher --- drivers/net/ethernet/intel/ice/ice_main.c | 32 ++++++++++------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 5ae671609f98..77b56dcae331 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -3099,30 +3099,26 @@ static char *ice_get_opt_fw_name(struct ice_pf *pf) * followed by a EUI-64 identifier (PCIe Device Serial Number) */ struct pci_dev *pdev = pf->pdev; - char *opt_fw_filename = NULL; - u32 dword; + char *opt_fw_filename; u8 dsn[8]; - int pos; + int err; /* Determine the name of the optional file using the DSN (two * dwords following the start of the DSN Capability). */ - pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_DSN); - if (pos) { - opt_fw_filename = kzalloc(NAME_MAX, GFP_KERNEL); - if (!opt_fw_filename) - return NULL; + err = pci_get_dsn(pdev, dsn); + if (err) + return NULL; - pci_read_config_dword(pdev, pos + 4, &dword); - put_unaligned_le32(dword, &dsn[0]); - pci_read_config_dword(pdev, pos + 8, &dword); - put_unaligned_le32(dword, &dsn[4]); - snprintf(opt_fw_filename, NAME_MAX, - "%sice-%02x%02x%02x%02x%02x%02x%02x%02x.pkg", - ICE_DDP_PKG_PATH, - dsn[7], dsn[6], dsn[5], dsn[4], - dsn[3], dsn[2], dsn[1], dsn[0]); - } + opt_fw_filename = kzalloc(NAME_MAX, GFP_KERNEL); + if (!opt_fw_filename) + return NULL; + + snprintf(opt_fw_filename, NAME_MAX, + "%sice-%02x%02x%02x%02x%02x%02x%02x%02x.pkg", + ICE_DDP_PKG_PATH, + dsn[7], dsn[6], dsn[5], dsn[4], + dsn[3], dsn[2], dsn[1], dsn[0]); return opt_fw_filename; } From patchwork Thu Feb 27 22:36:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 11411061 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4198138D for ; Thu, 27 Feb 2020 22:36:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82B30246A4 for ; Thu, 27 Feb 2020 22:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730353AbgB0Wgs (ORCPT ); Thu, 27 Feb 2020 17:36:48 -0500 Received: from mga18.intel.com ([134.134.136.126]:49955 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730422AbgB0Wgp (ORCPT ); Thu, 27 Feb 2020 17:36:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 14:36:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,493,1574150400"; d="scan'208";a="238568429" Received: from jekeller-desk.amr.corp.intel.com (HELO jekeller-desk.jekeller.internal) ([10.166.244.172]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2020 14:36:44 -0800 From: Jacob Keller To: linux-pci@vger.kernel.org, netdev@vger.kernel.org Cc: Jacob Keller , Jeff Kirsher Subject: [PATCH 5/5] ixgbe: use pci_get_dsn Date: Thu, 27 Feb 2020 14:36:35 -0800 Message-Id: <20200227223635.1021197-7-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.25.0.368.g28a2d05eebfb In-Reply-To: <20200227223635.1021197-1-jacob.e.keller@intel.com> References: <20200227223635.1021197-1-jacob.e.keller@intel.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace the open-coded implementation for reading the PCIe DSN with pci_get_dsn. Signed-off-by: Jacob Keller Cc: Jeff Kirsher --- drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c index ccd852ad62a4..74ee12b87fc3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c @@ -968,7 +968,7 @@ int ixgbe_fcoe_get_hbainfo(struct net_device *netdev, { struct ixgbe_adapter *adapter = netdev_priv(netdev); struct ixgbe_hw *hw = &adapter->hw; - int i, pos; + int i, err; u8 buf[8]; if (!info) @@ -985,19 +985,15 @@ int ixgbe_fcoe_get_hbainfo(struct net_device *netdev, /* Serial Number */ /* Get the PCI-e Device Serial Number Capability */ - pos = pci_find_ext_capability(adapter->pdev, PCI_EXT_CAP_ID_DSN); - if (pos) { - pos += 4; - for (i = 0; i < 8; i++) - pci_read_config_byte(adapter->pdev, pos + i, &buf[i]); - + err = pci_get_dsn(adapter->pdev, buf); + if (err) + snprintf(info->serial_number, sizeof(info->serial_number), + "Unknown"); + else snprintf(info->serial_number, sizeof(info->serial_number), "%02X%02X%02X%02X%02X%02X%02X%02X", buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]); - } else - snprintf(info->serial_number, sizeof(info->serial_number), - "Unknown"); /* Hardware Version */ snprintf(info->hardware_version,