<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY><FONT face=Arial size=2>Index: 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/net/main.c<BR>===================================================================<BR>--- 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/net/main.c (revision 4206)<BR>+++ 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/net/main.c (revision 4207)<BR>@@ 
-159,7 +159,7 @@<BR>  struct mlx4_dev *mdev = 
dev;<BR> <BR>  for (i = 0; i < MLX4_MAX_PORTS; i++) 
<BR>-  port_type[i] = g.mod_port_type[i];<BR>+  port_type[i] 
= dev->dev_params.mod_port_type[i];<BR> <BR>  err = 
mlx4_QUERY_DEV_CAP(dev, dev_cap);<BR>  if (err) {<BR>@@ -886,13 
+886,15 @@<BR>  return NULL;<BR> }<BR> <BR>-int 
mlx4_init_one(struct pci_dev *pdev)<BR>+<BR>+int mlx4_init_one(struct pci_dev 
*pdev, struct mlx4_dev_params *dev_params)<BR> {<BR>  struct 
pci_device_id *id;<BR>  struct mlx4_priv *priv;<BR>  struct 
mlx4_dev *dev;<BR>  int err;<BR>  NTSTATUS 
status;<BR>+ int i;<BR> <BR> #ifdef 
FORCE_LIVEFISH<BR>   if (pdev)<BR>@@ -964,6 +966,9 
@@<BR>   goto end;<BR>  }<BR> <BR>+ for (i = 
0; i < MLX4_MAX_PORTS; i++) 
<BR>+  dev->dev_params.mod_port_type[i] = 
dev_params->mod_port_type[i];<BR>+<BR>  /*<BR>   * Now 
reset the HCA before we touch the PCI capabilities or<BR>   * attempt 
a firmware command, since a boot ROM may have left<BR>@@ -1077,8 +1082,11 
@@<BR> <BR> int mlx4_restart_one(struct pci_dev 
*pdev)<BR> {<BR>+ struct mlx4_dev_params 
dev_params;<BR>+ mlx4_copy_dev_params(&dev_params, 
&pdev->dev->dev_params);<BR>+<BR>  mlx4_remove_one(pdev, 
FALSE);<BR>- return mlx4_init_one(pdev);<BR>+ return 
mlx4_init_one(pdev, &dev_params);<BR> }<BR> <BR> void 
mlx4_net_init()<BR>Index: 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/net/mlx4.h<BR>===================================================================<BR>--- 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/net/mlx4.h (revision 4206)<BR>+++ 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/net/mlx4.h (revision 4207)<BR>@@ -83,7 
+83,6 @@<BR> <BR>  int mod_enable_qos;<BR>  int 
mod_mlx4_blck_lb;<BR>- enum mlx4_port_type 
mod_port_type[MLX4_MAX_PORTS];<BR>  int 
mod_interrupt_from_first;<BR> <BR>  int mod_affinity;<BR>@@ 
-421,7 +420,7 @@<BR> <BR> void mlx4_handle_catas_err(struct mlx4_dev 
*dev);<BR> <BR>-int mlx4_init_one(struct pci_dev *pdev);<BR>+int 
mlx4_init_one(struct pci_dev *pdev, struct mlx4_dev_params 
*dev_params);<BR> <BR> void mlx4_remove_one(struct pci_dev *pdev, int 
reset);<BR> <BR>Index: 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/inc/device.h<BR>===================================================================<BR>--- 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/inc/device.h (revision 4206)<BR>+++ 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/inc/device.h (revision 4207)<BR>@@ 
-337,6 +337,17 @@<BR> <BR> #define 
MLX4_DEV_SIGNATURE 0xf1b34a6e<BR> <BR>+struct mlx4_dev_params 
{<BR>+ enum mlx4_port_type mod_port_type[MLX4_MAX_PORTS];<BR>+} 
;<BR>+<BR>+static inline void mlx4_copy_dev_params(<BR>+ struct 
mlx4_dev_params *dst,<BR>+ struct mlx4_dev_params 
*src)<BR>+{<BR>+ *dst = *src;<BR>+}<BR>+<BR> struct mlx4_dev 
{<BR>  u32   signature;<BR>  struct 
pci_dev        *pdev;<BR>@@ -346,6 +357,7 
@@<BR>  struct 
radix_tree_root qp_table_tree;<BR>  u32   rev_id;<BR>  char   board_id[MLX4_BOARD_ID_LEN];<BR>+ struct 
mlx4_dev_params dev_params;<BR> };<BR> <BR> struct 
mlx4_init_port_param {<BR>Index: 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/drv/mlx4_bus.inx<BR>===================================================================<BR>--- 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/drv/mlx4_bus.inx (revision 
4206)<BR>+++ 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/drv/mlx4_bus.inx (revision 4207)<BR>@@ 
-138,12 +138,15 
@@<BR> <BR> [MLX4BUS.DDInstall.ntx86]<BR> CopyFiles = 
MLX4BUS.CopyFiles<BR>+AddReg    = 
MLX4BUS.SoftwareReg<BR> <BR> [MLX4BUS.DDInstall.ntamd64]<BR> CopyFiles 
= MLX4BUS.CopyFiles<BR>+AddReg    = 
MLX4BUS.SoftwareReg<BR> <BR> [MLX4BUS.DDInstall.ntia64]<BR> CopyFiles 
= MLX4BUS.CopyFiles<BR>+AddReg    = 
MLX4BUS.SoftwareReg<BR> <BR> [MLX4BUS.DDInstall.ntx86.Services]<BR> AddService 

mlx4_bus,%SPSVCINST_ASSOCSERVICE%,MLX4BUS.ServiceInstall,MLX4BUS.EventLog<BR>@@ 
-178,6 +181,9 @@<BR> HKR, , EventMessageFile, 0x00020000, 
"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\mlx4_bus.sys"<BR> HKR, 
, TypesSupported,   0x00010001, 
7<BR> <BR>+[MLX4BUS.SoftwareReg]<BR>+HKR,"Parameters","PortType",%REG_SZ%,"ib,ib"<BR>+<BR> [MLX4BUS.ParamsReg]<BR> HKR,,DeviceCharacteristics,0x10001,0x0100         
; Use same security checks on relative 
opens<BR> HKR,,Security,,"D:P(A;;GA;;;BA)(A;;GA;;;SY)"      
; Allow generic-all access to Built-in administrators and Local system <BR>@@ 
-197,9 +203,9 
@@<BR> HKR,"Parameters","NumMac",%REG_DWORD%,0x00000001<BR> HKR,"Parameters","NumVlan",%REG_DWORD%,0x00000000<BR> HKR,"Parameters","UsePrio",%REG_DWORD%,0x00000000<BR>-HKR,"Parameters","PortType",%REG_SZ%,"ib,ib"<BR> <BR> <BR>+<BR> HKLM,"System\CurrentControlSet\Control\WMI\GlobalLogger\E51BB6E2-914A-4e21-93C0-192F4801BBFF","Flags",%REG_DWORD%,0xffff<BR> HKLM,"System\CurrentControlSet\Control\WMI\GlobalLogger\E51BB6E2-914A-4e21-93C0-192F4801BBFF","Level",%REG_DWORD%,0x3<BR> <BR>Index: 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/drv/drv.c<BR>===================================================================<BR>--- 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/drv/drv.c (revision 4206)<BR>+++ 
Q:/projinf4/trunk/hw/mlx4/kernel/bus/drv/drv.c (revision 4207)<BR>@@ -257,9 
+257,74 @@<BR>  return status;<BR> }<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>+ DECLARE_CONST_UNICODE_STRING(Parameters, 
L"Parameters");<BR>+ DECLARE_CONST_UNICODE_STRING(PortType, 
L"PortType");<BR>+#define  MAX_UVALUE 100<BR>+ WCHAR 
uvalue_data[MAX_UVALUE];<BR>+ UNICODE_STRING uvalue;<BR>+ status = 
WdfDeviceOpenRegistryKey(Device, PLUGPLAY_REGKEY_DRIVER, 
<BR>+  STANDARD_RIGHTS_ALL, WDF_NO_OBJECT_ATTRIBUTES, 
&hKey);<BR>+ if( !NT_SUCCESS( status ) ) {<BR>+  MLX4_PRINT( 
TRACE_LEVEL_ERROR  ,MLX4_DBG_DEV  ,("WdfDeviceOpenRegistryKey Failed 
status = 0x%x\n", status));<BR>+  goto 
err;<BR>+ }<BR>+<BR>+ status = WdfRegistryOpenKey(hKey, 
&Parameters, STANDARD_RIGHTS_ALL, WDF_NO_OBJECT_ATTRIBUTES, 
&hParamsKey);<BR>+ if( !NT_SUCCESS( status ) ) 
{<BR>+  MLX4_PRINT( TRACE_LEVEL_ERROR  ,MLX4_DBG_DEV  
,("WdfRegistryOpenKey Failed status = 0x%x\n", status));<BR>+  goto 
err;<BR>+ }<BR>+<BR>+ uvalue.Buffer = 
uvalue_data;<BR>+ uvalue.MaximumLength = 
MAX_UVALUE;<BR>+ uvalue.Length = 0;<BR>+<BR>+ status = 
WdfRegistryQueryUnicodeString(hParamsKey, &PortType, NULL, 
&uvalue);<BR>+ if (NT_SUCCESS (status)) {<BR>+  if 
(!wcscmp(uvalue_data, L"ib,ib")) 
{<BR>+   dev_params->mod_port_type[0] = 
MLX4_PORT_TYPE_IB;<BR>+   dev_params->mod_port_type[1] = 
MLX4_PORT_TYPE_IB;<BR>+  } else<BR>+  if 
(!wcscmp(uvalue_data, L"ib,eth")) 
{<BR>+   dev_params->mod_port_type[0] = 
MLX4_PORT_TYPE_IB;<BR>+   dev_params->mod_port_type[1] = 
MLX4_PORT_TYPE_ETH;<BR>+  } else<BR>+  if 
(!wcscmp(uvalue_data, L"eth,ib")) 
{<BR>+   dev_params->mod_port_type[0] = 
MLX4_PORT_TYPE_ETH;<BR>+   dev_params->mod_port_type[1] = 
MLX4_PORT_TYPE_IB;<BR>+  } else<BR>+  if 
(!wcscmp(uvalue_data, L"eth,eth")) 
{<BR>+   dev_params->mod_port_type[0] = 
MLX4_PORT_TYPE_ETH;<BR>+   dev_params->mod_port_type[1] = 
MLX4_PORT_TYPE_ETH;<BR>+  }<BR>+ }<BR>+ else 
{<BR>+  dev_params->mod_port_type[0] = 
MLX4_PORT_TYPE_IB;<BR>+  dev_params->mod_port_type[1] = 
MLX4_PORT_TYPE_IB;<BR>+ }<BR>+<BR>+err:<BR>+ if (hKey != NULL) 
<BR>+  WdfRegistryClose(hKey);<BR>+<BR>+ if (hParamsKey != NULL) 
<BR>+  WdfRegistryClose(hParamsKey);<BR>+<BR>+ return 
status;<BR>+}<BR>+<BR>+<BR> static <BR> NTSTATUS<BR>-__start_card( 
<BR>+__start_card(<BR>+ IN WDFDEVICE  Device,<BR>  IN 
PFDO_DEVICE_DATA p_fdo <BR>  )<BR> {<BR>@@ -269,12 +334,17 
@@<BR>  int err;<BR>  NTSTATUS status = 
STATUS_SUCCESS;<BR>  struct pci_dev *pdev = 
&p_fdo->pci_dev;<BR>+ struct mlx4_dev_params 
dev_params;<BR> <BR>  MLX4_ENTER(MLX4_DBG_DRV);<BR> <BR>  if 
( p_fdo->card_started )<BR>   goto err; 
<BR>-  <BR>+<BR>+ status = __read_dev_params(Device, 
&dev_params);<BR>+ if( !NT_SUCCESS( status ) ) <BR>+  goto 
err;<BR>+<BR>  // enable the card<BR>  status = 
pci_hca_enable( &pdev->bus_pci_ifc, &pdev->pci_cfg_space 
);<BR>  if( !NT_SUCCESS( status ) ) <BR>@@ -291,7 +361,7 
@@<BR> #endif <BR> <BR>  // NET library<BR>- err = 
mlx4_init_one( &p_fdo->pci_dev );<BR>+ err = mlx4_init_one( 
&p_fdo->pci_dev, &dev_params );<BR>  if (err) 
{<BR>   status = 
errno_to_ntstatus(err);<BR>   goto err;<BR>@@ -323,12 +393,12 
@@<BR> <BR>  p_fdo->bus_ib_ifc.pdev = 
&p_fdo->pci_dev;<BR>  p_fdo->bus_ib_ifc.p_ibdev = 
p_fdo->pci_dev.ib_dev;<BR>-    
p_fdo->bus_ib_ifc.is_livefish = 
mlx4_is_livefish(p_fdo->pci_dev.dev);    
<BR>-    if ( p_fdo->bus_ib_ifc.is_livefish == 0 ) 
{<BR>-        p_fdo->bus_ib_ifc.pmlx4_dev 
= to_mdev(p_fdo->pci_dev.ib_dev)->dev;    
<BR>-     if ( p_fdo->bus_ib_ifc.pmlx4_dev->flags 
& MLX4_FLAG_MSI_X )<BR>-      
p_fdo->bus_ib_ifc.n_msi_vectors = p_fdo->pci_dev.n_msi_vectors - 
2;<BR>-    }<BR>+ p_fdo->bus_ib_ifc.is_livefish = 
mlx4_is_livefish(p_fdo->pci_dev.dev);    <BR>+ if ( 
p_fdo->bus_ib_ifc.is_livefish == 0 ) 
{<BR>+  p_fdo->bus_ib_ifc.pmlx4_dev = 
to_mdev(p_fdo->pci_dev.ib_dev)->dev;    <BR>+  if 
( p_fdo->bus_ib_ifc.pmlx4_dev->flags & MLX4_FLAG_MSI_X 
)<BR>+   p_fdo->bus_ib_ifc.n_msi_vectors = 
p_fdo->pci_dev.n_msi_vectors - 
2;<BR>+ }<BR> <BR>  p_fdo->card_started = 
TRUE;<BR> <BR>@@ -367,7 +437,7 @@<BR> <BR>  // start card 
(needed after Hibernetion)<BR>  if (PreviousState > 
WdfPowerDeviceD0)<BR>-  __start_card( p_fdo 
);<BR>+  __start_card( Device, p_fdo );<BR>  mdev = 
pdev->dev;<BR> <BR>  // create child device<BR>@@ -685,7 
+755,7 @@<BR>  }<BR> <BR>  // start the 
card<BR>- status = __start_card( p_fdo );<BR>+ status = 
__start_card(Device, p_fdo 
);<BR>  <BR> err:<BR>  MLX4_EXIT( MLX4_DBG_DRV );<BR>@@ 
-991,19 +1061,12 @@<BR>  // "Measure the interrupt from the first 
packet (default 
1)"<BR>  DECLARE_CONST_UNICODE_STRING(InterruptFromFirstPacket, 
L"InterruptFromFirstPacket"); <BR> <BR>- // "Ports L2 type 
(ib/eth/auto, entry per port, comma seperated, default ib for 
all)"<BR>- DECLARE_CONST_UNICODE_STRING(PortType, 
L"PortType");<BR>-<BR>  // 
"ProcessorAffinity"<BR>  DECLARE_CONST_UNICODE_STRING(ProcessorAffinity, 
L"ProcessorAffinity");<BR> <BR>  ULONG 
value;<BR>  WDFKEY hKey = NULL;<BR>  NTSTATUS status = 
STATUS_SUCCESS;<BR>-<BR>- UNICODE_STRING uvalue;<BR>-#define  
MAX_UVALUE 100<BR>- WCHAR 
uvalue_data[MAX_UVALUE];<BR>  <BR>  status = 
WdfDriverOpenParametersRegistryKey( 
*hDriver,<BR>   STANDARD_RIGHTS_ALL, WDF_NO_OBJECT_ATTRIBUTES, 
&hKey );<BR>@@ -1093,35 +1156,7 
@@<BR>   else<BR>    g.mod_affinity = 
0;<BR>   <BR>-  uvalue.Buffer = 
uvalue_data;<BR>-  uvalue.MaximumLength = 
MAX_UVALUE;<BR>-  uvalue.Length = 0;<BR> <BR>-  status 
= WdfRegistryQueryUnicodeString(hKey, &PortType, NULL, 
&uvalue);<BR>-  if (NT_SUCCESS (status)) 
{<BR>-   if (!wcscmp(uvalue_data, L"ib,ib")) 
{<BR>-    g.mod_port_type [0] = 
MLX4_PORT_TYPE_IB;<BR>-    g.mod_port_type [1] = 
MLX4_PORT_TYPE_IB;<BR>-   } else<BR>-   if 
(!wcscmp(uvalue_data, L"ib,eth")) {<BR>-    g.mod_port_type 
[0] = MLX4_PORT_TYPE_IB;<BR>-    g.mod_port_type [1] = 
MLX4_PORT_TYPE_ETH;<BR>-   } else<BR>-   if 
(!wcscmp(uvalue_data, L"eth,ib")) {<BR>-    g.mod_port_type 
[0] = MLX4_PORT_TYPE_ETH;<BR>-    g.mod_port_type [1] = 
MLX4_PORT_TYPE_IB;<BR>-   } else<BR>-   if 
(!wcscmp(uvalue_data, L"eth,eth")) {<BR>-    g.mod_port_type 
[0] = MLX4_PORT_TYPE_ETH;<BR>-    g.mod_port_type [1] = 
MLX4_PORT_TYPE_ETH;<BR>-   }<BR>-  }<BR>-  else 
{<BR>-   g.mod_port_type [0] = 
MLX4_PORT_TYPE_IB;<BR>-   g.mod_port_type [1] = 
MLX4_PORT_TYPE_IB;<BR>-  }<BR>-<BR>-<BR>   WdfRegistryClose(hKey);<BR>   status 
= STATUS_SUCCESS;<BR>  }<BR></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>