[IPoIB] Add support for setting debug level from registry
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 30 Nov 2005 19:09:47 +0000 (19:09 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 30 Nov 2005 19:09:47 +0000 (19:09 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
Signed-off-by: Fab Tillier (ftillier@silverstorm.com)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@191 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_driver.c
ulp/ipoib/kernel/netipoib.inf

index 0dc365c..c1451f8 100644 (file)
@@ -220,6 +220,10 @@ static void
 __ipoib_dereg_addrs(\r
        IN                              ipoib_adapter_t* const          p_adapter );\r
 \r
+static NTSTATUS\r
+__ipoib_read_registry(\r
+       IN                              UNICODE_STRING* const           p_registry_path );\r
+\r
 \r
 //! Standard Windows Device Driver Entry Point\r
 /*! DriverEntry is the first routine called after a driver is loaded, and\r
@@ -259,6 +263,8 @@ DriverEntry(
        status          = NDIS_STATUS_SUCCESS;\r
        ndis_handle     = NULL;\r
 \r
+       __ipoib_read_registry(p_registry_path);\r
+       \r
        KeInitializeSpinLock( &g_ipoib.lock );\r
        InitializeListHead( &g_ipoib.adapter_list );\r
 \r
@@ -301,6 +307,55 @@ DriverEntry(
 }\r
 \r
 \r
+static NTSTATUS\r
+__ipoib_read_registry(\r
+       IN                              UNICODE_STRING* const           p_registry_path )\r
+{\r
+       NTSTATUS                                                status;\r
+       /* Remember the terminating entry in the table below. */\r
+       RTL_QUERY_REGISTRY_TABLE                table[2];\r
+       UNICODE_STRING                                  param_path;\r
+\r
+       IPOIB_ENTER( IPOIB_DBG_INIT );\r
+\r
+       RtlInitUnicodeString( &param_path, NULL );\r
+       param_path.MaximumLength = p_registry_path->Length + \r
+               sizeof(L"\\Parameters");\r
+       param_path.Buffer = cl_zalloc( param_path.MaximumLength );\r
+       if( !param_path.Buffer )\r
+       {\r
+               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, \r
+                       ("Failed to allocate parameters path buffer.\n") );\r
+               return STATUS_INSUFFICIENT_RESOURCES;\r
+       }\r
+\r
+       RtlAppendUnicodeStringToString( &param_path, p_registry_path );\r
+       RtlAppendUnicodeToString( &param_path, L"\\Parameters" );\r
+\r
+       /*\r
+        * Clear the table.  This clears all the query callback pointers,\r
+        * and sets up the terminating table entry.\r
+        */\r
+       cl_memclr( table, sizeof(table) );\r
+\r
+       /* Setup the table entries. */\r
+       table[0].Flags = RTL_QUERY_REGISTRY_DIRECT;\r
+       table[0].Name = L"DebugFlags";\r
+       table[0].EntryContext = &g_ipoib_dbg_lvl;\r
+       table[0].DefaultType = REG_DWORD;\r
+       table[0].DefaultData = &g_ipoib_dbg_lvl;\r
+       table[0].DefaultLength = sizeof(ULONG);\r
+\r
+       /* Have at it! */\r
+       status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, \r
+               param_path.Buffer, table, NULL, NULL );\r
+\r
+       cl_free( param_path.Buffer );\r
+       IPOIB_EXIT( IPOIB_DBG_INIT );\r
+       return status;\r
+}\r
+\r
+\r
 VOID\r
 ipoib_unload(\r
        IN                              PDRIVER_OBJECT                          p_drv_obj )\r
index d651c0e..740c290 100644 (file)
@@ -1,31 +1,30 @@
-; SilverStorm Technologies Internet Protocol over InfiniBand Adapter\r
+; OpenIB Internet Protocol over InfiniBand Adapter\r
 ; Copyright 2005 SilverStorm Technologies all Rights Reserved.\r
 \r
 [Version]\r
 Signature   = "$Windows NT$"\r
 Class       = Net\r
 ClassGUID   = {4d36e972-e325-11ce-bfc1-08002be10318}\r
-Provider    = %SST%\r
-CatalogFile = netipoib.cat\r
-DriverVer=09/01/2005,3.0.0036.0\r
+Provider    = %OPENIB%\r
+DriverVer=11/30/2005,1.0.0000.191\r
 \r
 [Manufacturer]\r
-%SST%       = SST,ntx86,ntamd64,ntia64\r
+%OPENIB%       = OPENIB,ntx86,ntamd64,ntia64\r
 \r
 [ControlFlags]\r
 ExcludeFromSelect = IBA\IPoIB\r
 \r
-[SST]\r
+[OPENIB]\r
 ; empty since we don't support W9x/Me\r
 \r
-[SST.ntx86]\r
-%IpoibDesc%      = Ipoib.DDInstall,    IBA\IPoIB   ; SilverStorm Internet Protocol over InfiniBand Adapter\r
+[OPENIB.ntx86]\r
+%IpoibDesc%      = Ipoib.DDInstall,    IBA\IPoIB   ; Internet Protocol over InfiniBand Adapter\r
 \r
-[SST.ntamd64]\r
-%IpoibDesc%      = Ipoib.DDInstall,    IBA\IPoIB   ; SilverStorm Internet Protocol over InfiniBand Adapter\r
+[OPENIB.ntamd64]\r
+%IpoibDesc%      = Ipoib.DDInstall,    IBA\IPoIB   ; Internet Protocol over InfiniBand Adapter\r
 \r
-[SST.ntia64]\r
-%IpoibDesc%      = Ipoib.DDInstall,    IBA\IPoIB   ; SilverStorm Internet Protocol over InfiniBand Adapter\r
+[OPENIB.ntia64]\r
+%IpoibDesc%      = Ipoib.DDInstall,    IBA\IPoIB   ; Internet Protocol over InfiniBand Adapter\r
 \r
 [Ipoib.DDInstall.ntx86]\r
 Characteristics = 0x81 ; NCF_HAS_UI | NCF_VIRTUAL\r
@@ -58,7 +57,7 @@ AddService = ipoib, 2, IpoibService, IpoibEventLog
 \r
 [IpoibAddReg]\r
 HKR, Ndi,                       Service,    0, "ipoib"\r
-HKR, Ndi\Interfaces,            UpperRange, 0, "ndis5_ip"\r
+HKR, Ndi\Interfaces,            UpperRange, 0, "ndis"\r
 HKR, Ndi\Interfaces,            LowerRange, 0, "ethernet"\r
 \r
 HKR, Ndi\Params\RqDepth,               ParamDesc,      0, "Receive Queue Depth"\r
@@ -133,6 +132,10 @@ StartType       = 3 ;%SERVICE_DEMAND_START%
 ErrorControl    = 1 ;%SERVICE_ERROR_NORMAL%\r
 ServiceBinary   = %12%\ipoib.sys\r
 LoadOrderGroup  = NDIS\r
+AddReg          = Ipoib.ParamsReg\r
+\r
+[Ipoib.ParamReg]\r
+HKR,"Parameters","DebugFlags",%REG_DWORD_NO_CLOBBER%,0x80000000\r
 \r
 [IpoibEventLog]\r
 AddReg = IpoibAddEventLogReg\r
@@ -181,10 +184,11 @@ WOW64CopyFiles    = %DIRID_SYSTEM_X86%
 DefaultDestDir    = %DIRID_SYSTEM%\r
 \r
 [Strings]\r
-SST                  = "SilverStorm Technologies"\r
-IpoibDesc            = "SilverStorm IPoIB Adapter"\r
+OPENIB               = "OpenIB Alliance"\r
+IpoibDesc            = "OpenIB IPoIB Adapter"\r
 IpoibServiceDispName = "IPoIB"\r
-IcsDisk1             = "SilverStorm Systems IPoIB Disk #1"\r
+IcsDisk1             = "OpenIB IPoIB Disk #1"\r
 DIRID_SYSTEM         = 11\r
 DIRID_DRIVERS        = 12\r
 DIRID_SYSTEM_X86     = 16425\r
+REG_DWORD_NO_CLOBBER = 0x00010003\r