/*++
*******************************************************************************
* Copyright (c) 1990-97 Digi International Inc., All Rights Reserved
*
* This software contains proprietary and confidential information of Digi
* International Inc.  By accepting transfer of this copy, Recipient agrees
* to retain this software in confidence, to prevent disclosure to others,
* and to make no use of this software other than that for which it was
* delivered.  This is an unpublished copyrighted work of Digi International
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
* prohibited.
*
* Restricted Rights Legend
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
* Technical Data and Computer Software clause at DFARS 252.227-7031 or
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -
* Restricted Rights at 48 CFR 52.227-19, as applicable.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
*
*******************************************************************************

Module Name:

   sohreg.h

Abstract:

   This module contains header definitions for SOH Registry access.

Author:

   Jeff Romatoski


--*/


////////////////////////////////////////////////////////////////////////////////

#ifndef _SOHREG_H
#define _SOHREG_H

#ifndef TEXT
#define TEXT __T
#endif

// Macros
#define DIGSOH_REG_STRING_SZ(string) ((sizeof(string) + 1) * sizeof( WCHAR ))

// Registry Defined
#define DIGISOH_SLASH					TEXT( "\\" )
#define DIGISOH_REGSUBKEY_SERVICES    	TEXT( "\\Registry\\Machine\\System\\CurrentControlSet\\Services\\" )

// Parameters Keys
#define DIGISOH_REGSUBKEY_PARAMETERS	TEXT( "Parameters" )
#define DIGISOH_REGSUBKEY_MPA			TEXT( "MiniportAdapters" )
#define DIGISOH_REGVAL_DEVICE    		TEXT( "Device" )

///////////////////////////////////////////////////////////////////////////////////////
// DigiSoh Tuneable Streams Parameters 
///////////////////////////////////////////////////////////////////////////////////////

// NT5 defines
#define DIGISOH_REGVAL_PORT_COUNT						TEXT( "PortCount" )
#define DIGISOH_REGVAL_PORT_COUNT_DEFAULT				8

// Max Streams Per Port Supports the largest allowable # of streams per port

#define DIGISOH_AVERAGE_STACK_SIZE						4
#define DIGISOH_BUFCALLS_PER_PORT						9

// Streams structures - one per open stream
#define DIGISOH_REGVAL_MIN_STREAMS_PER_PORT_DEFAULT		2	// Used For Calculations
#define DIGISOH_REGVAL_MAX_STREAMS_PER_PORT				TEXT( "MaxStreamsPerPort" )
#define DIGISOH_REGVAL_MAX_STREAMS_PER_PORT_DEFAULT		8

// QPair Structures - Two queues per linked module (DIGISOH_AVERAGE_STACK_SIZE) times the streams per port
#define DIGISOH_REGVAL_MIN_QPAIRS_PER_PORT				TEXT( "MinQPairsPerPort" )
#define DIGISOH_REGVAL_MIN_QPAIRS_PER_PORT_DEFAULT		(DIGISOH_AVERAGE_STACK_SIZE * DIGISOH_REGVAL_MIN_STREAMS_PER_PORT_DEFAULT)
#define DIGISOH_REGVAL_MAX_QPAIRS_PER_PORT				TEXT( "MaxQPairsPerPort" )
#define DIGISOH_REGVAL_MAX_QPAIRS_PER_PORT_DEFAULT		(DIGISOH_AVERAGE_STACK_SIZE * DIGISOH_REGVAL_MAX_STREAMS_PER_PORT_DEFAULT)

// BufCall structures - Based on one timeout per port
#define DIGISOH_REGVAL_MIN_BUFCALLS_PER_PORT			TEXT( "MinBufCallsPerPort" )
#define DIGISOH_REGVAL_MIN_BUFCALLS_PER_PORT_DEFAULT	(DIGISOH_BUFCALLS_PER_PORT * DIGISOH_REGVAL_MIN_STREAMS_PER_PORT_DEFAULT)
#define DIGISOH_REGVAL_MAX_BUFCALLS_PER_PORT			TEXT( "MaxBufCallsPerPort" )
#define DIGISOH_REGVAL_MAX_BUFCALLS_PER_PORT_DEFAULT	(DIGISOH_BUFCALLS_PER_PORT * DIGISOH_REGVAL_MAX_STREAMS_PER_PORT_DEFAULT)

// Timeout structures - Based on one timeout per port
#define DIGISOH_REGVAL_MAX_TIMEOUTS_PER_PORT			TEXT( "MaxTimeoutsPerPort" )
#define DIGISOH_REGVAL_MAX_TIMEOUTS_PER_PORT_DEFAULT	(DIGISOH_AVERAGE_STACK_SIZE * DIGISOH_REGVAL_MAX_STREAMS_PER_PORT_DEFAULT)


///////////////////////////////////////////////////////////////////////////////////////
// DigiSoh Tuneable Msg Block Parameters 
///////////////////////////////////////////////////////////////////////////////////////

// Msg Blks
#define DIGISOH_REGVAL_MIN_MSGBLOCKS_PER_PORT			TEXT( "MinMsgBlksPerPort" )
#define DIGISOH_REGVAL_MIN_MSGBLOCKS_PER_PORT_DEFAULT	64 * DIGISOH_REGVAL_MIN_STREAMS_PER_PORT_DEFAULT
#define DIGISOH_REGVAL_MAX_MSGBLOCKS_PER_PORT			TEXT( "MaxMsgBlksPerPort" )
#define DIGISOH_REGVAL_MAX_MSGBLOCKS_PER_PORT_DEFAULT	256 * DIGISOH_REGVAL_MAX_STREAMS_PER_PORT_DEFAULT

// Msg Priority Limits - As a Percentage
#define DIGISOH_REGVAL_MSGLIMIT_LOPRI					TEXT( "MsgLimitLoPri" )
#define DIGISOH_REGVAL_MSGLIMIT_LOPRI_DEFAULT			40
#define DIGISOH_REGVAL_MSGLIMIT_MEDPRI					TEXT( "MsgLimitMedPri" )
#define DIGISOH_REGVAL_MSGLIMIT_MEDPRI_DEFAULT			20


///////////////////////////////////////////////////////////////////////////////////////
// DigiSoh Tuneable Data Block Parameters 
///////////////////////////////////////////////////////////////////////////////////////
//
//	  Mins and Maxs are the number of messages PER PORT.  The system will
//    allocate the Minimum number of buffers from the pool at start up.  It will
//    then allocated up to the maximum from that pool.  If the pool becomes depleted
//    it will then look at the next higher up size.  This continues until all the
//    pool sized have been looked at.  If no buffer is available, a buffer wait
//    state is entered.
//
//    X25 and SNA use smaller size buffer (256 bytes), and frame relay uses larger
//    buffers (typically up to 2048).  However, X25 network node links will typically
//    use 4096 byte buffers.  
//
//    There are ten Msg sizes available in the Data Block Pool.  The message sizes and
//    default minimum and maximum are:
//
//		SIZE		MIN			MAX
//		----		---			---
//		16 			 64			 512	(MIN =    1 K, MAX =    8 K)
//		32 			 64			 512	(MIN =    2 K, MAX =   16 K)
//		64 			 64			 512	(MIN =    4 K, MAX =   32 K)
//		128			 64			 512	(MIN =    8 K, MAX =   64 K)
//		256			 64			 512	(MIN =   16 K, MAX =  128 K)
//		512 		 64			 256	(MIN =   32 K, MAX =  128 K)
//		1024		 64			 128	(MIN =   64 K, MAX =  128 K)
//		2048		 32			 128    (MIN =   64 K, MAX =  256 K) 
//		4096		 16			 128	(MIN =   64 K, MAX =  512 K)
//		8192		  0			 128	(MIN =    0 K, MAX = 1024 K)
//
//						TOTAL           (MIN =  255 K, MAX = 2296 K)
//
//	NT has three basic memory size models; small, medium, and large.  The
//  code will only allocate resources for 4 ports in the small model, 8
//  ports in the medium model, and the full 16 ports in the large mode.
//  This does not mean the user could not run more ports, but out of non-paged
//  memory conditions could occur.
//

#define DIGISOH_REGVAL_MIN_DATA16_PER_PORT				TEXT( "MinDataBlks16PerPort" )
#define DIGISOH_REGVAL_MIN_DATA16_PER_PORT_DEFAULT		64
#define DIGISOH_REGVAL_MAX_DATA16_PER_PORT				TEXT( "MaxDataBlks16PerPort" )
#define DIGISOH_REGVAL_MAX_DATA16_PER_PORT_DEFAULT		512

#define DIGISOH_REGVAL_MIN_DATA32_PER_PORT				TEXT( "MinDataBlks32PerPort" )
#define DIGISOH_REGVAL_MIN_DATA32_PER_PORT_DEFAULT		64
#define DIGISOH_REGVAL_MAX_DATA32_PER_PORT				TEXT( "MaxDataBlks32PerPort" )
#define DIGISOH_REGVAL_MAX_DATA32_PER_PORT_DEFAULT		512

#define DIGISOH_REGVAL_MIN_DATA64_PER_PORT				TEXT( "MinDataBlks64PerPort" )
#define DIGISOH_REGVAL_MIN_DATA64_PER_PORT_DEFAULT		64
#define DIGISOH_REGVAL_MAX_DATA64_PER_PORT				TEXT( "MaxDataBlks64PerPort" )
#define DIGISOH_REGVAL_MAX_DATA64_PER_PORT_DEFAULT		512

#define DIGISOH_REGVAL_MIN_DATA128_PER_PORT				TEXT( "MinDataBlks128PerPort" )
#define DIGISOH_REGVAL_MIN_DATA128_PER_PORT_DEFAULT		64
#define DIGISOH_REGVAL_MAX_DATA128_PER_PORT				TEXT( "MaxDataBlks128PerPort" )
#define DIGISOH_REGVAL_MAX_DATA128_PER_PORT_DEFAULT		512

#define DIGISOH_REGVAL_MIN_DATA256_PER_PORT				TEXT( "MinDataBlks256PerPort" )
#define DIGISOH_REGVAL_MIN_DATA256_PER_PORT_DEFAULT		64
#define DIGISOH_REGVAL_MAX_DATA256_PER_PORT				TEXT( "MaxDataBlks256PerPort" )
#define DIGISOH_REGVAL_MAX_DATA256_PER_PORT_DEFAULT		512

#define DIGISOH_REGVAL_MIN_DATA512_PER_PORT				TEXT( "MinDataBlks512PerPort" )
#define DIGISOH_REGVAL_MIN_DATA512_PER_PORT_DEFAULT		64
#define DIGISOH_REGVAL_MAX_DATA512_PER_PORT				TEXT( "MaxDataBlks512PerPort" )
#define DIGISOH_REGVAL_MAX_DATA512_PER_PORT_DEFAULT		256

#define DIGISOH_REGVAL_MIN_DATA1024_PER_PORT			TEXT( "MinDataBlks1024PerPort" )
#define DIGISOH_REGVAL_MIN_DATA1024_PER_PORT_DEFAULT	64
#define DIGISOH_REGVAL_MAX_DATA1024_PER_PORT			TEXT( "MaxDataBlks1024PerPort" )
#define DIGISOH_REGVAL_MAX_DATA1024_PER_PORT_DEFAULT	128

#define DIGISOH_REGVAL_MIN_DATA2048_PER_PORT			TEXT( "MinDataBlks2048PerPort" )
#define DIGISOH_REGVAL_MIN_DATA2048_PER_PORT_DEFAULT	32
#define DIGISOH_REGVAL_MAX_DATA2048_PER_PORT			TEXT( "MaxDataBlks2048PerPort" )
#define DIGISOH_REGVAL_MAX_DATA2048_PER_PORT_DEFAULT	128

#define DIGISOH_REGVAL_MIN_DATA4096_PER_PORT			TEXT( "MinDataBlks4096PerPort" )
#define DIGISOH_REGVAL_MIN_DATA4096_PER_PORT_DEFAULT	16
#define DIGISOH_REGVAL_MAX_DATA4096_PER_PORT			TEXT( "MaxDataBlks4096PerPort" )
#define DIGISOH_REGVAL_MAX_DATA4096_PER_PORT_DEFAULT	128

#define DIGISOH_REGVAL_MIN_DATA8192_PER_PORT			TEXT( "MinDataBlks8192PerPort" )
#define DIGISOH_REGVAL_MIN_DATA8192_PER_PORT_DEFAULT	0
#define DIGISOH_REGVAL_MAX_DATA8192_PER_PORT			TEXT( "MaxDataBlks8192PerPort" )
#define DIGISOH_REGVAL_MAX_DATA8192_PER_PORT_DEFAULT	128


#endif