<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>[PATCH] read guids from flash</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Fab</FONT>
</P>
<P><FONT SIZE=2>attached patch h to read the GUID with query_ca and not directly read it from the flash.</FONT>
<BR><FONT SIZE=2>We encounter problem with new boards that have different sector size and the driver could not read the GUID</FONT>
</P>
<P><FONT SIZE=2>(we should provide patch that will also get the sector size from the board and assume it as define to 20000)</FONT>
</P>
<BR>
<P><FONT SIZE=2>Singed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)</FONT>
</P>
<BR>
<P><FONT SIZE=2>--- C:\sleybo\OpenIB\hw\mt23108\kernel\hca_driver.c Sun Sep 04 09:42:56 2005</FONT>
<BR><FONT SIZE=2>+++ C:\sleybo\clean\hw\mt23108\kernel\hca_driver.c Wed Sep 07 15:17:25 2005</FONT>
<BR><FONT SIZE=2>@@ -913,7 +913,6 @@</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> NTSTATUS status;</FONT>
<BR><FONT SIZE=2> hca_dev_ext_t *p_ext;</FONT>
<BR><FONT SIZE=2>- net64_t ca_guid = 0;</FONT>
<BR><FONT SIZE=2> HCA_ENTER( HCA_DBG_PNP );</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /* Handled on the way up. */</FONT>
<BR><FONT SIZE=2>@@ -936,16 +935,26 @@</FONT>
<BR><FONT SIZE=2> return status;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- /* store HCA PDO */</FONT>
<BR><FONT SIZE=2>- p_ext->hca.p_dev_obj = p_ext->cl_ext.p_pdo;</FONT>
<BR><FONT SIZE=2>- status = fw_flash_get_ca_guid(p_ext->cl_ext.p_pdo, &ca_guid);</FONT>
<BR><FONT SIZE=2>- if ( !NT_SUCCESS( status ) )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2>- HCA_TRACE( HCA_DBG_ERROR, </FONT>
<BR><FONT SIZE=2>- ("fw_flash_get_ca_guid failed status =%#x.\n", status) );</FONT>
<BR><FONT SIZE=2>- return status;</FONT>
<BR><FONT SIZE=2>+ VAPI_hca_cap_t hca_cap;</FONT>
<BR><FONT SIZE=2>+ int rc;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ if (HH_OK != THH_hob_open_hca(p_ext->hca.hh_hndl, NULL, NULL)) {</FONT>
<BR><FONT SIZE=2>+ status = IB_ERROR;</FONT>
<BR><FONT SIZE=2>+ return status;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2>+ rc = THH_hob_query(p_ext->hca.hh_hndl, &hca_cap);</FONT>
<BR><FONT SIZE=2>+ if (rc != HH_OK) {</FONT>
<BR><FONT SIZE=2>+ HCA_TRACE( HCA_DBG_ERROR, ("Error on getting guid (%#x).\n", rc) );</FONT>
<BR><FONT SIZE=2>+ status = IB_ERROR;</FONT>
<BR><FONT SIZE=2>+ return status;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ p_ext->hca.guid = *(uint64_t *)hca_cap.node_guid;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ THH_hob_close_hca(p_ext->hca.hh_hndl);</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>- p_ext->hca.guid = ca_guid;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> mlnx_hca_insert( &p_ext->hca );</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
</P>
<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"></FONT>
</BODY>
</HTML>