[Openib-windows] [PATCH] read guids from flash

Yossi Leybovich sleybo at mellanox.co.il
Thu Sep 15 03:29:58 PDT 2005


Fab

attached patch h to read the GUID with query_ca and not directly read it
from the flash.
We encounter problem with new boards that have different sector size and the
driver could not read the GUID

(we should provide patch that will also get the sector size from the board
and assume it as define to 20000)


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


--- C:\sleybo\OpenIB\hw\mt23108\kernel\hca_driver.c	Sun Sep 04 09:42:56
2005
+++ C:\sleybo\clean\hw\mt23108\kernel\hca_driver.c	Wed Sep 07 15:17:25
2005
@@ -913,7 +913,6 @@
 {
 	NTSTATUS			status;
 	hca_dev_ext_t		*p_ext;
-	net64_t				ca_guid = 0;
 	HCA_ENTER( HCA_DBG_PNP );
 
 	/* Handled on the way up. */
@@ -936,16 +935,26 @@
 		return status;
 	}
 
-	/* store HCA PDO */
-	p_ext->hca.p_dev_obj = p_ext->cl_ext.p_pdo;
-	status = fw_flash_get_ca_guid(p_ext->cl_ext.p_pdo, &ca_guid);
-	if ( !NT_SUCCESS( status ) )
 	{
-		HCA_TRACE( HCA_DBG_ERROR, 
-			("fw_flash_get_ca_guid failed status =%#x.\n",
status) );
-		return status;
+		VAPI_hca_cap_t hca_cap;
+		int rc;
+
+		if (HH_OK != THH_hob_open_hca(p_ext->hca.hh_hndl, NULL,
NULL)) {
+			status = IB_ERROR;
+			return status;
+		}
+		
+		rc = THH_hob_query(p_ext->hca.hh_hndl, &hca_cap);
+		if (rc != HH_OK) {
+			HCA_TRACE( HCA_DBG_ERROR, ("Error on getting guid
(%#x).\n", rc) );
+			status = IB_ERROR;
+			return status;
+		}
+		p_ext->hca.guid = *(uint64_t *)hca_cap.node_guid;
+
+		THH_hob_close_hca(p_ext->hca.hh_hndl);
 	}
-	p_ext->hca.guid = ca_guid;
+
 	mlnx_hca_insert( &p_ext->hca );
 
 	/*

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


More information about the ofw mailing list