From: ftillier Date: Mon, 7 Nov 2005 19:30:51 +0000 (+0000) Subject: [IBAL, HCA, VSTAT] Add FW version to CA attributes. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=eab24b5990eaa9df7f68f1c39514bfa9d8761468;p=~shefty%2Frdma-win.git [IBAL, HCA, VSTAT] Add FW version to CA attributes. Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il) git-svn-id: svn://openib.tc.cornell.edu/gen1@146 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/hw/mt23108/kernel/hca_data.c b/trunk/hw/mt23108/kernel/hca_data.c index 8c453952..7cc876c4 100644 --- a/trunk/hw/mt23108/kernel/hca_data.c +++ b/trunk/hw/mt23108/kernel/hca_data.c @@ -2074,6 +2074,7 @@ mlnx_conv_vapi_hca_cap( ca_attr_p->vend_id = hca_info_p->vendor_id; ca_attr_p->dev_id = (uint16_t)hca_info_p->dev_id; ca_attr_p->revision = (uint16_t)hca_info_p->hw_ver; + ca_attr_p->fw_ver = hca_info_p->fw_ver; ca_attr_p->ca_guid = *(UNALIGNED64 u_int64_t *)vapi_hca_cap_p->node_guid; ca_attr_p->num_ports = vapi_hca_cap_p->phys_port_num; diff --git a/trunk/hw/mt23108/vapi/Hca/hcahal/hh.h b/trunk/hw/mt23108/vapi/Hca/hcahal/hh.h index 9816d3a3..3f436c18 100644 --- a/trunk/hw/mt23108/vapi/Hca/hcahal/hh.h +++ b/trunk/hw/mt23108/vapi/Hca/hcahal/hh.h @@ -69,6 +69,7 @@ typedef struct HH_hca_dev_st { u_int32_t vendor_id; /* IEEE's 24 bit Device Vendor ID */ u_int32_t dev_id; /* Device ID */ u_int32_t hw_ver; /* Hardware version (step/rev) */ + u_int64_t fw_ver; struct hh_if_ops* if_ops; /* Interface operations */ /* Size (bytes) of user-level ... */ diff --git a/trunk/hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c b/trunk/hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c index 0484cf9f..8ffbe7a0 100644 --- a/trunk/hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c +++ b/trunk/hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c @@ -4176,6 +4176,9 @@ cmdif_dbg_ddr = hob_p->ddr_props.ddr_start_adr; /* address in ddr used for out p tdev.dev_id = (u_int32_t)hw_props_p->device_id; MTL_DEBUG1("hw_props_p: device_id = 0x%X, pci_vendor_id=0x%X,hw_ver=0x%X\n", hw_props_p->device_id, hw_props_p->pci_vendor_id, hw_props_p->hw_ver); + tdev.fw_ver= tdev.fw_ver = hob_p->fw_props.fw_rev_major; + tdev.fw_ver = (tdev.fw_ver <<16) | hob_p->fw_props.fw_rev_minor; + tdev.fw_ver = (tdev.fw_ver <<16) | hob_p->fw_props.fw_rev_subminor;; tdev.hw_ver = hob_p->hw_props.hw_ver; tdev.if_ops = if_ops_p; tdev.hca_ul_resources_sz = sizeof(THH_hca_ul_resources_t); diff --git a/trunk/inc/iba/ib_types.h b/trunk/inc/iba/ib_types.h index 2dfbbc9b..3bbbd90c 100644 --- a/trunk/inc/iba/ib_types.h +++ b/trunk/inc/iba/ib_types.h @@ -7574,6 +7574,7 @@ typedef struct _ib_ca_attr uint32_t vend_id; uint16_t dev_id; uint16_t revision; + uint64_t fw_ver; /* * Total size of the ca attributes in bytes @@ -7658,6 +7659,9 @@ typedef struct _ib_ca_attr * revision * Revision ID of this adapter * +* fw_ver +* Device Firmware version. +* * size * Total size in bytes for the HCA attributes. This size includes total * size required for all the variable members of the structure. If a diff --git a/trunk/tools/vstat/user/vstat_main.c b/trunk/tools/vstat/user/vstat_main.c index 875aa8d6..f6f780ef 100644 --- a/trunk/tools/vstat/user/vstat_main.c +++ b/trunk/tools/vstat/user/vstat_main.c @@ -44,6 +44,7 @@ #endif +#define VEND_ID_MELLNOX 0x02c9 /******************************************************************* @@ -163,7 +164,14 @@ void vstat_print_ca_attr(int idx, ib_ca_attr_t* ca_attr, BOOLEAN fullPrint){ printf("\tvendor_id=0x%04x\n", ca_attr->vend_id); printf("\tvendor_part_id=0x%04x\n", ca_attr->dev_id); printf("\thw_ver=0x%x\n", ca_attr->revision); //TODO: ??? - printf("\tfw_ver=NA\n"); + if(ca_attr->vend_id == VEND_ID_MELLNOX){ + printf("\tfw_ver=%d.%.2d.%.4d\n", + (uint16_t )(ca_attr->fw_ver>>32), + (uint16_t)(ca_attr->fw_ver>>16), + (uint16_t )(ca_attr->fw_ver)); + }else{ + printf("\tfw_ver=0x%I64x\n",ca_attr->fw_ver); + } printf("\tPSID=NA\n"); if(fullPrint){ printf("\tnum_phys_ports = %d\n",ca_attr->num_ports); @@ -336,7 +344,7 @@ vstat_ca_attr( /* Print_ca_attributes */ - vstat_print_ca_attr((int)i,vstat_ca_attr, fullPrint); + vstat_print_ca_attr((int)i, vstat_ca_attr, fullPrint); /* Free the memory */