// Sample code file: LANCONF.H

// Warning: This code has been marked up for HTML

/*****************************************************************************
 *
 *   (C) Copyright 1988-1994 Novell, Inc.
 *   All Rights Reserved.
 *
 *   This program is an unpublished copyrighted work which is proprietary
 *   to Novell, Inc. and contains confidential information that is not
 *   to be reproduced or disclosed to any other person or entity without
 *   prior written consent from Novell, Inc. in each and every instance.
 *
 *   WARNING:  Unauthorized reproduction of this program as well as
 *   unauthorized preparation of derivative works based upon the
 *   program or distribution of copies by sale, rental, lease or
 *   lending are violations of federal copyright laws and state trade
 *   secret laws, punishable by civil and criminal penalties.
 *
 *  $Workfile:   lanconf.h  $
 *  $Modtime:   Sep 02 1999 16:31:18  $
 *  $Revision:   1.0  $
 *  
 ****************************************************************************/

#ifndef _LANCONF_H_
#define _LANCONF_H_

struct LANMemoryConfiguration
{
   LONG LANMemoryAddress;
   WORD LANMemoryRangeParagraphs;
};

struct DriverConfigurationStructure
{
   BYTE DSignature[26];
   BYTE DCFG_MajorVersion;
   BYTE DCFG_MinorVersion;
   BYTE DNodeAddress[6];
   WORD DModeFlags;
   WORD DBoardNumber;
   WORD DBoardInstance;
   LONG DMaxDataSize;
   LONG DMaxRecvSize;
   LONG DRecvSize;
   LONG DCardName;
   LONG DShortName;
   BYTE *DMediaType;
   WORD DCardID;
   WORD DMediaID;
   WORD DTransportTime;
   BYTE DReserved[16];
   BYTE DMLID_MajorVersion;
   BYTE DMLID_MinorVersion;
   WORD DFlags;
   WORD DSendRetries;
   LONG DLink;
   WORD DSharingFlags;
   WORD DSlot;
   WORD DIOPortsAndRanges[4];
   struct LANMemoryConfiguration DMemoryDecodeAndLength[2];
   BYTE DIntLine[2];   /* FF Means Not Used */
   BYTE DDMALine[2];   /* FF Means Not Used */
   struct ResourceTagStructure *DResourceTag;
   struct DriverConfigurationStructure *DDriverConfig;
   BYTE *DCommandString;
   BYTE DLogicalName[18];
   LONG DLinearMemory[2];
   WORD DChannelNumber;
   LONG DBusTag;
   WORD DIOConfigVersion;   /* Config Size, ver >= 1 busTag supported */
};

struct oldIOConfigurationStructure
{
   struct IOConfigurationStructure *CLink;
   WORD CSharingFlags;
   WORD CSlot;
   WORD CIOPortsAndRanges[4];
   struct LANMemoryConfiguration CMemoryDecodeAndLength[2];
   BYTE CIntLine[2];   /* FF Means Not Used */
   BYTE CDMALine[2];   /* FF Means Not Used */
};

struct IOConfigurationStructure
{
   struct IOConfigurationStructure *CLink;
   WORD CSharingFlags;
   WORD CSlot;
   WORD CIOPortsAndRanges[4];
   struct LANMemoryConfiguration CMemoryDecodeAndLength[2];
   BYTE CIntLine[2];   /* FF Means Not Used */
   BYTE CDMALine[2];   /* FF Means Not Used */

   struct ResourceTagStructure *CResourceTag;
   struct DriverConfigurationStructure *CDriverConfig;
   BYTE *CCommandString;
   BYTE CLogicalName[18];
   LONG CLinearMemory[2];
   WORD CChannelNumber;
   LONG CBusTag;
   WORD CIOConfigVersion;   /* Config Size, ver >= 1 busTag supported */
};

struct MSL2TestInfoStructure
{
   void   (*MSL2ControlEntry)();
   void   (*MSL2DriverSend)();
   void  (*MSL2RepeatSend)();      
   void  (*MSL2ImDeadSend)();      
   void  (**MSL2ReceiveMsgPtr)();
   void   (**MSL2GetNextMsgPtr)();
   void    (**MSL2SendDonePtr)();
   struct ResourceTagStructure *MSL2RTag;      
   struct MSLIOConfigStructure *MSL2BoardConfig;
};

struct MSLInfoStruct
{
   LONG MSLSends;   
   LONG MSLStateRequest;
   LONG MSLStateReply;   
   LONG MSLStateStatus; 
   LONG MSLStartUp;
   LONG MSLLastError;
   LONG MSLSendCounter;
   LONG MSLRxCounter;
   LONG MSLPrelinkTimer;

};

struct MSLListEntry
{
   struct MSLListEntry   *NextMSLLink;
   LONG   MSLIndex;
   LONG   MSLInUse;
};


struct MSLPreLinkMsgData
{
   void *MSLCheckValue0;
     LONG MSLMsgDataSize;
   void *MSLMsgDataPointer;   
};




struct   MSLIOConfigStructure
{

   LONG MSLMsgSizeMslCanNowHandle;
   LONG MSLMsgSizeNowAvailable;
   LONG MSLMaximumMslDataLength;

   void (*MSLGetNextMsgPointer)();
   void (*MSLServerReceivePointer)();       
   void (*MSLSendServerCompletedPointer)();


   BYTE MSLCFG_MajorVersion;   
   BYTE MSLCFG_MinorVersion;

   BYTE MSLSoftInterFaceType;   
   BYTE MSLStatus;      

   LONG MSLLineSpeed;      
   LONG MSLBoardNumber;
   LONG MSLServerID;
   struct ResourceTagStructure *MSLDriverResourceTag;
      
   struct IOConfigurationStructure MSLBaseConfig;

};


struct IOOptionStructure
{
   LONG NumberOfOptions;
   LONG OptionData[1];
};

struct AdapterOptionDefinitionStructure
{
   struct IOOptionStructure *IOSlot;
   struct IOOptionStructure *IOPort0;
   struct IOOptionStructure *IOLength0;
   struct IOOptionStructure *IOPort1;
   struct IOOptionStructure *IOLength1;
   struct IOOptionStructure *MemoryDecode0;
   struct IOOptionStructure *MemoryLength0;
   struct IOOptionStructure *MemoryDecode1;
   struct IOOptionStructure *MemoryLength1;
   struct IOOptionStructure *Interrupt0;
   struct IOOptionStructure *Interrupt1;
   struct IOOptionStructure *DMA0;
   struct IOOptionStructure *DMA1;
   struct IOOptionStructure *Channel;
};

/* Flags that can be set on the OptionData */
#define OD_IS_RANGE         0x80000000
#define OD_HAS_INCREMENT   0x40000000
#define OD_HAS_CHOICE      0x20000000   /* OS internal use only */


/* DFlag bits */

#define LANDeActivatedBit   0x1

/* ParseIOParameters bits */

#define NeedsSlotBit         0x00000001
#define NeedsIOPort0Bit         0x00000002
#define NeedsIOLength0Bit      0x00000004
#define NeedsIOPort1Bit         0x00000008
#define NeedsIOLength1Bit      0x00000010
#define NeedsMemoryDecode0Bit   0x00000020
#define NeedsMemoryLength0Bit   0x00000040
#define NeedsMemoryDecode1Bit   0x00000080
#define NeedsMemoryLength1Bit   0x00000100
#define NeedsInterrupt0Bit      0x00000200
#define NeedsInterrupt1Bit      0x00000400
#define NeedsDMA0Bit         0x00000800
#define NeedsDMA1Bit         0x00001000
#define NeedsChannelBit         0x00002000

/* ParseLANParameters needFlags defines */
#define CAN_SET_NODE_ADDRESS   0x40000000
#define MUST_SET_NODE_ADDRESS   0x80000000

/* define the CSharingFlags bits */

#define IODetachedBit            0x0001
#define IOSharePort0Bit            0x0002
#define IOSharePort1Bit            0x0004
#define IOShareMemory0Bit         0x0008
#define IOShareMemory1Bit         0x0010
#define IOShareInterrupt0Bit      0x0020
#define IOShareInterrupt1Bit      0x0040
#define IOShareDMA0Bit            0x0080
#define IOShareDMA1Bit            0x0100
/* The driver has it's own command line info to put in the .NCF file */
#define IOHasCommandLineInfo      0x0200
/* The driver doesn't want any of the default info put in the .NCF file */
#define IODontDefaultCommandLine   0x0400

/* The sizes of the shared memory regions are in 4K blocks instead of
 * 16 BYTE blocks */
//jn-971007 
//jn-971007 #define IOShareMemPageBit1         0x1000
//jn-971007 #define IOShareMemPageBit2         0x8000
//jn-971007 /* SPD 110043 11- 09-95 WKU*/
//jn-971007 #define IOShareMemPageBit ( IOShareMemPageBit2 | IOShareMemPageBit1 )
//jn-971007 end

//jn+971007
#define IOShareMemPageBit         0x8000
//jn+971007 end

/* NOTE: This structure is also declared in LSL.386 */
#ifndef ProtocolNodeStructure_DEFINED
typedef   struct ProtocolNodeStructure {
   struct ProtocolNodeStructure *ProtocolListLink;
   struct ProtocolNodeStructure *ProtocolBoardLink;
   WORD ProtocolNumber;
   BYTE ProtocolID[6];
   LONG ProtocolBoardNumber;
   void (*ProtocolReceiveHandler)();
   struct ResourceTagStructure *ProtocolReceiveBufferRTag;
   LONG ProtocolMask;
} ProtocolNodeStructure;
#define ProtocolNodeStructure_DEFINED
#endif

/* LSL Errors */

#define BadCommand         0xFFFFFF81
#define BadParameters      0xFFFFFF82
#define Cancelled         0xFFFFFFFC
#define DuplicateEntry      0xFFFFFF83
#define Fail            0xFFFFFF84
#define ItemNotPresent      0xFFFFFF85
#define NoMoreItems         0xFFFFFF86
#define NoSuchDriver      0xFFFFFF87
#define NoSuchHandles      0xFFFFFF88
#define OutOfResources      0xFFFFFF89
#define RxOverflow         0xFFFFFF8A
#define InCriticalSection   0xFFFFFF8B

/* ParseLANParameters needFlags defines */
#define NF_CAN_SET_NODE_ADDRESS      0x00000001
#define NF_MUST_SET_NODE_ADDRESS   0x00000002

/* BUS types - one bit for each type because multiple may be supported. */
#define MICRO_CHANNEL_BUS   0x01
#define EISA_BUS         0x02
#define PCI_BUS            0x04
#define PCMCIA_BUS         0x08
#define ISA_BUS            0x10

/* MSL2 Equates */

#define MSL2_STARTUP      0x00
#define MSL2_STANDBY      0x01
#define MSL2_ACTIVE         0x10
#define MSL2_OFFLINE      0x04

/****************************************************************************/
/****************************************************************************/

#endif /* _LANCONF_H_ */