]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[IBAL, HCA, VSTAT] Add FW version to CA attributes.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 Nov 2005 19:30:51 +0000 (19:30 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 Nov 2005 19:30:51 +0000 (19:30 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1@146 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/hw/mt23108/kernel/hca_data.c
trunk/hw/mt23108/vapi/Hca/hcahal/hh.h
trunk/hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c
trunk/inc/iba/ib_types.h
trunk/tools/vstat/user/vstat_main.c

index 8c45395290f10decd7b875b6d5da0ee63bbec4c0..7cc876c445cd3666ee421a6cb6ecb717d5ce451b 100644 (file)
@@ -2074,6 +2074,7 @@ mlnx_conv_vapi_hca_cap(
        ca_attr_p->vend_id  = hca_info_p->vendor_id;\r
        ca_attr_p->dev_id   = (uint16_t)hca_info_p->dev_id;\r
        ca_attr_p->revision = (uint16_t)hca_info_p->hw_ver;\r
+       ca_attr_p->fw_ver = hca_info_p->fw_ver;\r
 \r
        ca_attr_p->ca_guid   = *(UNALIGNED64 u_int64_t *)vapi_hca_cap_p->node_guid;\r
        ca_attr_p->num_ports = vapi_hca_cap_p->phys_port_num;\r
index 9816d3a3e3c3cbbe7538d493eb2215103f97cc61..3f436c184c54ade6effdfca198fd30c9f301110f 100644 (file)
@@ -69,6 +69,7 @@ typedef struct HH_hca_dev_st {
   u_int32_t           vendor_id;        /* IEEE's 24 bit Device Vendor ID */\r
   u_int32_t           dev_id;           /* Device ID */\r
   u_int32_t           hw_ver;           /* Hardware version (step/rev)  */\r
+  u_int64_t           fw_ver;\r
   struct hh_if_ops*   if_ops;           /* Interface operations */\r
 \r
                                         /* Size (bytes) of user-level ...  */\r
index 0484cf9fa2f6bc70bb1ba7f486ec219cc2f0ef2a..8ffbe7a033d8ffc527e10661dd284d6dbf8daff4 100644 (file)
@@ -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;\r
   MTL_DEBUG1("hw_props_p: device_id = 0x%X, pci_vendor_id=0x%X,hw_ver=0x%X\n",\r
               hw_props_p->device_id, hw_props_p->pci_vendor_id, hw_props_p->hw_ver);\r
+       tdev.fw_ver= tdev.fw_ver = hob_p->fw_props.fw_rev_major;\r
+       tdev.fw_ver = (tdev.fw_ver <<16) | hob_p->fw_props.fw_rev_minor;\r
+       tdev.fw_ver = (tdev.fw_ver <<16) | hob_p->fw_props.fw_rev_subminor;;\r
   tdev.hw_ver    = hob_p->hw_props.hw_ver; \r
   tdev.if_ops    = if_ops_p;\r
   tdev.hca_ul_resources_sz = sizeof(THH_hca_ul_resources_t);\r
index 2dfbbc9b72f6f1a94e78899a902bb81d03c0e898..3bbbd90c137bd46bb971cd0dc0f8d7658e96e223 100644 (file)
@@ -7574,6 +7574,7 @@ typedef struct _ib_ca_attr
        uint32_t                                vend_id;\r
        uint16_t                                dev_id;\r
        uint16_t                                revision;\r
+       uint64_t                                fw_ver;\r
 \r
        /*\r
         * Total size of the ca attributes in bytes\r
@@ -7658,6 +7659,9 @@ typedef struct _ib_ca_attr
 *      revision\r
 *              Revision ID of this adapter\r
 *\r
+*      fw_ver\r
+*              Device Firmware version.\r
+*\r
 *      size\r
 *              Total size in bytes for the HCA attributes.  This size includes total\r
 *              size required for all the variable members of the structure.  If a\r
index 875aa8d6b8ec5215ed6eca646e7f9fc19e6d7235..f6f780efa9fed4386f13ec8bb229ce062f5ac2e2 100644 (file)
@@ -44,6 +44,7 @@
 #endif\r
 \r
 \r
+#define VEND_ID_MELLNOX        0x02c9\r
 \r
 \r
 /*******************************************************************\r
@@ -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);\r
        printf("\tvendor_part_id=0x%04x\n", ca_attr->dev_id);\r
        printf("\thw_ver=0x%x\n", ca_attr->revision); //TODO: ???\r
-       printf("\tfw_ver=NA\n");\r
+       if(ca_attr->vend_id == VEND_ID_MELLNOX){\r
+               printf("\tfw_ver=%d.%.2d.%.4d\n",\r
+               (uint16_t )(ca_attr->fw_ver>>32),\r
+               (uint16_t)(ca_attr->fw_ver>>16),\r
+               (uint16_t )(ca_attr->fw_ver));\r
+       }else{\r
+               printf("\tfw_ver=0x%I64x\n",ca_attr->fw_ver);\r
+       }\r
        printf("\tPSID=NA\n");\r
        if(fullPrint){\r
                printf("\tnum_phys_ports = %d\n",ca_attr->num_ports);\r
@@ -336,7 +344,7 @@ vstat_ca_attr(
 \r
                        /* Print_ca_attributes */\r
 \r
-                       vstat_print_ca_attr((int)i,vstat_ca_attr, fullPrint);\r
+                       vstat_print_ca_attr((int)i, vstat_ca_attr, fullPrint);\r
 \r
 \r
                        /* Free the memory */\r