[Openib-windows] RE: [PATCH] FW version in vstat

Yossi Leybovich sleybo at mellanox.co.il
Mon Nov 7 01:39:56 PST 2005


Fab ,Yael

Attched is the new patch for adding fw_ver in query_ca_attr



10x
Yossi 

Singned-off-by:Yossi Leybovich (sleybo at mellanox.co.il)

Index: hw/mt23108/kernel/hca_data.c
===================================================================
--- hw/mt23108/kernel/hca_data.c	(revision 707)
+++ hw/mt23108/kernel/hca_data.c	(working copy)
@@ -2096,6 +2096,7 @@
 	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;
Index: hw/mt23108/vapi/Hca/hcahal/hh.h
===================================================================
--- hw/mt23108/vapi/Hca/hcahal/hh.h	(revision 707)
+++ hw/mt23108/vapi/Hca/hcahal/hh.h	(working copy)
@@ -69,6 +69,7 @@
   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 ...
*/
Index: hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c
===================================================================
--- hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c	(revision 707)
+++ hw/mt23108/vapi/Hca/hcahal/tavor/thh_hob/thh_hob.c	(working copy)
@@ -4176,6 +4176,9 @@
   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);
Index: inc/iba/ib_types.h
===================================================================
--- inc/iba/ib_types.h	(revision 707)
+++ inc/iba/ib_types.h	(working copy)
@@ -7574,6 +7574,7 @@
 	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 @@
 *	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
Index: tools/vstat/user/vstat_main.c
===================================================================
--- tools/vstat/user/vstat_main.c	(revision 707)
+++ tools/vstat/user/vstat_main.c	(working copy)
@@ -44,6 +44,7 @@
 #endif
 
 
+#define VEND_ID_MELLNOX	0x02c9
 
 
 /*******************************************************************
@@ -163,7 +164,14 @@
 	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 @@
 
 			/* 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 */
Index: ulp/opensm/user/include/iba/ib_types.h
===================================================================
--- ulp/opensm/user/include/iba/ib_types.h	(revision 707)
+++ ulp/opensm/user/include/iba/ib_types.h	(working copy)
@@ -7536,6 +7536,7 @@
 	uint32_t				vend_id;
 	uint16_t				dev_id;
 	uint16_t				revision;
+	uint16_t				fw_ver;
 
 	/*
 	 * Total size of the ca attributes in bytes
@@ -7625,6 +7626,9 @@
 *	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
Index: ulp/opensm/user/include/iba/ib_types_extended.h
===================================================================
--- ulp/opensm/user/include/iba/ib_types_extended.h	(revision 707)
+++ ulp/opensm/user/include/iba/ib_types_extended.h	(working copy)
@@ -607,6 +607,7 @@
 	uint32_t				vend_id;
 	uint16_t				dev_id;
 	uint16_t				revision;
+	uint64_t				fw_ver;
 
 	/*
 	 * Total size of the ca attributes in bytes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051107/9dd01299/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fw_ver2.patch
Type: application/octet-stream
Size: 4800 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051107/9dd01299/attachment.obj>


More information about the ofw mailing list