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