<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY>
<DIV><SPAN class=489005712-17112009><FONT color=#0000ff size=2
face=Arial>Applied at 2574.</FONT></SPAN></DIV>
<DIV><SPAN class=489005712-17112009><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=489005712-17112009><FONT color=#0000ff size=2
face=Arial>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=489005712-17112009><FONT color=#0000ff size=2
face=Arial>Tzachi</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Tzachi Dar <BR><B>Sent:</B> Sunday,
November 15, 2009 8:02 PM<BR><B>To:</B>
ofw@lists.openfabrics.org<BR><B>Cc:</B> Windows Design<BR><B>Subject:</B>
patch; [mlx4] modify PortType according to
setup_port_type<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=450530018-15112009>signed off by:
Firas.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial>Index:
Q:/projinf3/trunk/hw/mlx4/kernel/bus/drv/drv.c<BR>===================================================================<BR>---
Q:/projinf3/trunk/hw/mlx4/kernel/bus/drv/drv.c (revision 4774)<BR>+++
Q:/projinf3/trunk/hw/mlx4/kernel/bus/drv/drv.c (revision 4775)<BR>@@
-257,18 +257,48 @@<BR> return status;<BR> }<BR> <BR>-
<BR>+BOOLEAN __read_setup_params(PUNICODE_STRING
puvalue)<BR>+{ <BR>+
NTSTATUS status; <BR>+
WDFKEY hParamsKey = NULL;<BR>+ DECLARE_CONST_UNICODE_STRING(KeyName, L"<A
href="file://\\REGISTRY\\MACHINE\\SOFTWARE\\Mellanox">\\REGISTRY\\MACHINE\\SOFTWARE\\Mellanox</A>");<BR>+ DECLARE_CONST_UNICODE_STRING(PortType,
L"PortType");<BR>+ <BR>+ status =
WdfRegistryOpenKey(NULL, &KeyName, STANDARD_RIGHTS_ALL,
WDF_NO_OBJECT_ATTRIBUTES, &hParamsKey);<BR>+ if( !NT_SUCCESS( status
) ) <BR>+ {<BR>+ MLX4_PRINT(
TRACE_LEVEL_ERROR ,MLX4_DBG_DEV ,("WdfRegistryOpenKey Failed
status = 0x%x\n", status));<BR>+
return FALSE;<BR>+ }<BR>+ <BR>+
status = WdfRegistryQueryUnicodeString(hParamsKey, &PortType, NULL,
puvalue); <BR>+ if( !NT_SUCCESS( status ) )
<BR>+ {<BR>+
WdfRegistryClose(hParamsKey);<BR>+
return FALSE;<BR>+ }<BR>+<BR>+
WdfRegistryClose(hParamsKey); <BR>+ return
TRUE;
<BR>+}<BR>+<BR> NTSTATUS<BR> __read_dev_params(IN WDFDEVICE
Device, struct mlx4_dev_params *dev_params)<BR> {<BR> NTSTATUS
status = STATUS_SUCCESS;<BR> WDFKEY hKey =
NULL;<BR> WDFKEY hParamsKey = NULL;<BR>+ BOOLEAN
bRet = FALSE;<BR> DECLARE_CONST_UNICODE_STRING(Parameters,
L"Parameters");<BR> DECLARE_CONST_UNICODE_STRING(PortType,
L"PortType");<BR>+<BR> #define MAX_UVALUE 100<BR> WCHAR
uvalue_data[MAX_UVALUE];<BR>- UNICODE_STRING
uvalue;<BR>+ UNICODE_STRING uvalue;
<BR>+ uvalue.Buffer = uvalue_data;<BR>+ uvalue.MaximumLength =
MAX_UVALUE;<BR>+ uvalue.Length = 0;<BR>+
<BR> status = WdfDeviceOpenRegistryKey(Device,
PLUGPLAY_REGKEY_DRIVER, <BR> STANDARD_RIGHTS_ALL,
WDF_NO_OBJECT_ATTRIBUTES, &hKey);<BR> if( !NT_SUCCESS( status )
) {<BR>@@ -282,10 +312,17 @@<BR> goto
err;<BR> }<BR> <BR>- uvalue.Buffer =
uvalue_data;<BR>- uvalue.MaximumLength =
MAX_UVALUE;<BR>- uvalue.Length = 0;<BR>-<BR>+ bRet =
__read_setup_params(&uvalue);<BR>+ if (bRet ==
TRUE)<BR>+ {<BR>+
status = WdfRegistryAssignValue(hParamsKey, &PortType,
REG_SZ,uvalue.Length,uvalue.Buffer);
<BR>+ if( !NT_SUCCESS( status ) )
{<BR>+
MLX4_PRINT( TRACE_LEVEL_ERROR ,MLX4_DBG_DEV
,("WdfRegistryAssignValue Failed status = 0x%x\n",
status));<BR>+
goto err;<BR>+
}
<BR>+ uvalue.Length =
0;<BR>+ }<BR>+ <BR> status =
WdfRegistryQueryUnicodeString(hParamsKey, &PortType, NULL,
&uvalue);<BR> if (NT_SUCCESS (status))
{<BR> if (!wcscmp(uvalue_data, L"ib,ib")) {<BR></DIV></FONT>
<DIV><FONT size=2 face=Arial></FONT> </DIV></BLOCKQUOTE></BODY></HTML>