<!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><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></BODY></HTML>