diff options
Diffstat (limited to 'private/ntos/miniport/trantor/include')
29 files changed, 2679 insertions, 0 deletions
diff --git a/private/ntos/miniport/trantor/include/card.h b/private/ntos/miniport/trantor/include/card.h new file mode 100644 index 000000000..8213bf435 --- /dev/null +++ b/private/ntos/miniport/trantor/include/card.h @@ -0,0 +1,58 @@ +//----------------------------------------------------------------------- +// +// CARD.H +// +// Functions exported from the lower level driver. These functions +// are in the cardtxxx.c files. +// +// Only these routines may be accessed from a given cardtxxx.lib file +// for a given operating system. +// +// To use these routines, include TYPEDEFS.H, STATUS.H before this file. +// +// Revisions: +// 03-22-93 KJB First. +// 03-25-93 JAP Comment changes only. +// 03-26-93 JAP Fixed up prototype typedef inconsistencies +// 04-22-93 JAP Added CardGetIRQ() prototype. +// 05-12-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both the PBASE_REGISTER and the +// PWORKSPACE parameters. Auto Request Sense is +// now supported. +// 05-14-93 KJB CardCheckAdapter now takes only two parameters: +// PWORKSPACE and PINIT. The baseIoAddress is inside +// the PINIT structure and must be filled. +// 05-17-93 KJB Fixed CardParseCommandString parameter warning. +// +//----------------------------------------------------------------------- + +// +// Functions +// + +PBASE_REGISTER CardAddress (USHORT i); +USHORT CardNumberOfAddressRanges (VOID); +ULONG CardMaxTransferSize (VOID); +BOOLEAN CardAddressRangeInIoSpace (VOID); +USHORT CardAddressRangeLength (VOID); +BOOLEAN CardSupportsInterrupts (VOID); +UCHAR CardDefaultInterruptLevel (VOID); +USHORT CardStartCommandInterrupt (PTSRB t); +USHORT CardFinishCommandInterrupt (PTSRB t); +USHORT CardDoCommand (PTSRB t); +BOOLEAN CardCheckAdapter (PWORKSPACE w, PINIT init); +BOOLEAN CardInterrupt (PWORKSPACE w); +VOID CardResetBus (PWORKSPACE w); +PUCHAR CardGetName (VOID); +PUCHAR CardGetShortName (VOID); +UCHAR CardGetType (VOID); +USHORT CardGetIRQ (USHORT i); +USHORT CardGetWorkspaceSize (VOID); +BOOLEAN CardParseCommandString (PINIT init, PCHAR str); + diff --git a/private/ntos/miniport/trantor/include/cardlib.h b/private/ntos/miniport/trantor/include/cardlib.h new file mode 100644 index 000000000..6d40acdf4 --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardlib.h @@ -0,0 +1,29 @@ +//----------------------------------------------------------------------- +// +// CARDLIB.H +// +// Generic Library Access File +// +// Only these routines may be accessed from a given cardtxxx.lib file +// for a given operating system. +// +// Only this file --CARDLIB.H-- and the cardtxxx.lib file should be used +// to build an application or driver. +// +// Revisions: +// +// 03-22-93 KJB First. +// +//----------------------------------------------------------------------- + +// General typedefs + +#include "typedefs.h" + +// Return status codes for all SHORT functions + +#include "status.h" + +// Functions that are exported... + +#include "card.h" diff --git a/private/ntos/miniport/trantor/include/cardt128.h b/private/ntos/miniport/trantor/include/cardt128.h new file mode 100644 index 000000000..4aa120385 --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardt128.h @@ -0,0 +1,108 @@ +#ifndef _CARDT128_H +#define _CARDT128_H + +//----------------------------------------------------------------------- +// +// CARDT128.H +// +// T128 Adapter Definitions File +// +// Revision History: +// 09-01-92 KJB First. +// 03-05-93 JAP Cleaned comments, modified string in CardGetName() +// to conform to ASM Driver names. +// NOTE: This file was dated 03-04-93, but with no +// corresponding Revision History log. +// 03-08-93 JAP Added CardGetShortName() to conform to c_name +// returned in ASM-Drivers. +// 03-09-93 JAP Added CardGetType() function and included cardtype.h +// 03-23-93 KJB Reorged for functional library interface. +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + +// include general os definitions + +#include "osdefs.h" + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + + PBASE_REGISTER BaseIoAddress; // address of this card + +} ADAPTER_INFO, FARP PADAPTER_INFO; + +// they have an n5380 + +#include "n5380.h" + + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + + +// all port access routines + +#include "portmem.h" + + +// the t128 specific file + +#include "t128.h" + + +// CARDTYPE definitions file + +#include "cardtype.h" + +// include exported function definitions + +#include "card.h" + +//----------------------------------------------------------------------- +// +// Redefined routines +// +//----------------------------------------------------------------------- + +// Routines used by T128.c + +#define T128PortTest(g, reg, mask) \ + PortMemTest(&((PUCHAR)g->BaseIoAddress)[reg],mask) + +#define T128PortSet(g, reg, mask) \ + PortMemSet(&((PUCHAR)g->BaseIoAddress)[reg],mask); + +#define T128PortClear(g, reg, mask) \ + PortMemClear(&((PUCHAR)g->BaseIoAddress)[reg],mask); + +#define T128PortPut(g,reg,byte) \ + PortMemPut(&((PUCHAR)g->BaseIoAddress)[reg],byte); + +#define T128PortGet(g,reg,byte) \ + PortMemGet(&((PUCHAR)g->BaseIoAddress)[reg],byte); + +// +// Other Routines +// +#define CardReadBytesFast T128ReadBytesFast +#define CardWriteBytesFast T128WriteBytesFast +#define CardWriteBytesCommand ScsiWriteBytesSlow + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + +#endif // _CARDT128_H diff --git a/private/ntos/miniport/trantor/include/cardt13b.h b/private/ntos/miniport/trantor/include/cardt13b.h new file mode 100644 index 000000000..e287ee5d0 --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardt13b.h @@ -0,0 +1,149 @@ +#ifndef _CARDT13B_H +#define _CARDT13B_H + +//----------------------------------------------------------------------- +// +// CARD.H +// +// T13B Adapter Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 03-05-93 JAP Cleaned comments, modified string in CardGetName() +// to conform to ASM Driver names. +// NOTE: This file was dated 03-03-93, but with no +// corresponding Revision History log. +// 03-08-93 JAP Added CardGetShortName() to conform to c_name +// returned in ASM-Drivers. +// 03-09-93 JAP Added CardGetType() function and included cardtype.h +// 03-22-93 KJB Reorged for functional library interface. +// 03-26-93 JAP Added CARDIOPORTLEN to define number of I/O ports +// the card uses. Used for NOVELL builds only. +// 04-01-93 KJB Moved N53C400 register offsets into here from +// n53c400.h. +// 05-05-93 KJB Added definition of T13B_SWITCH register. +// 05-13-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both the PBASE_REGISTER and the +// PWORKSPACE parameters. +// 05-14-93 KJB CardCheckAdapter now does not take a PBASE_REGISTER +// parameter, this parameter is now in the PINIT +// structure. +// +//----------------------------------------------------------------------- + +// include general os definitions + +#include "osdefs.h" + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + + PBASE_REGISTER BaseIoAddress; // address of this card + +} ADAPTER_INFO, FARP PADAPTER_INFO; + +// they have an n5380 + +#include "n5380.h" + +// +// 53c400 register offsets from 53c400 base +// + +#define N53C400_CONTROL 0 +#define N53C400_STATUS 0 +#define N53C400_COUNTER 1 +#define T13B_SWITCH 2 +#define N53C400_HOST_BFR 4 +#define N53C400_5380 8 + +// all of these cards have a 53c400 + +#include "n53c400.h" + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + +// use generic port io routines + +#include "portio.h" + +// type of cards + +#include "cardtype.h" + +// include exported function definitions + +#include "card.h" + + +//----------------------------------------------------------------------- +// +// Definitions +// +//----------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// For Novell, we need #define for number of I/O ports the card uses. +//----------------------------------------------------------------------- + #ifdef NOVELL +#define CARDIOPORTLEN 16 // number of IO ports in card + #endif + + +//----------------------------------------------------------------------- +// +// Redefined Functions +// +//----------------------------------------------------------------------- + +// These are card specific routines, but since this card has a 5380, we +// will redefine these to the generic n5380 or other routines. + +#define CardWriteBytesCommand CardWriteBytesFast +#define CardReadBytesFast N53C400ReadBytesFast +#define CardWriteBytesFast N53C400WriteBytesFast + +// the N53C400.C module needs access to the IO ports, PortIO provides this + +#define N53C400PortTest(g, reg, mask) \ + PortIOTest(&((PUCHAR)g->BaseIoAddress)[reg],mask) + +#define N53C400PortSet(g, reg, mask) \ + PortIOSet(&((PUCHAR)g->BaseIoAddress)[reg],mask); + +#define N53C400PortClear(g, reg, mask) \ + PortIOClear(&((PUCHAR)g->BaseIoAddress)[reg],mask); + +#define N53C400PortPut(g,reg,byte) \ + PortIOPut(&((PUCHAR)g->BaseIoAddress)[reg],byte); + +#define N53C400PortGet(g,reg,byte) \ + PortIOGet(&((PUCHAR)g->BaseIoAddress)[reg],byte); + +#define N53C400PortGetBuffer(g, reg, buffer, len) \ + ScsiPortReadPortBufferUshort ( \ + (PUSHORT)&(((PUCHAR)g->BaseIoAddress)[reg]), \ + (PUSHORT)buffer, len/2); + +#define N53C400PortPutBuffer(g, reg, buffer, len) \ + ScsiPortWritePortBufferUshort ( \ + (PUSHORT)&(((PUCHAR)g->BaseIoAddress)[reg]), \ + (PUSHORT)buffer, len/2); + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + +#endif // _CARDT13B_H diff --git a/private/ntos/miniport/trantor/include/cardt160.h b/private/ntos/miniport/trantor/include/cardt160.h new file mode 100644 index 000000000..9d13a6617 --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardt160.h @@ -0,0 +1,133 @@ +#ifndef _CARDT160_H +#define _CARDT160_H + +//----------------------------------------------------------------------- +// +// CARDT160.H +// +// T160 Adapter Definitions File +// +// Revisions: +// 02-24-92 KJB First. +// 03-05-93 JAP Cleaned comments, modified string in CardGetName() +// to conform to ASM Driver names. +// NOTE: This file was dated 03-04-93, but with no +// corresponding Revision History log. +// 03-08-93 JAP Added CardGetShortName() to conform to c_name +// returned in ASM-Drivers. +// 03-09-93 JAP Added CardGetType() function and included cardtype.h +// 03-10-93 KJB Changed default interrupt to 12 +// 03-24-93 KJB Reorged for functional library interface. +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + + +// include general os definitions + +#include "osdefs.h" + + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + + PBASE_REGISTER BaseIoAddress; // address of this card + +} ADAPTER_INFO, FARP PADAPTER_INFO; + +// they have an n5380 + +#include "n5380.h" + +// all of these cards have a pc9010 + +#include "pc9010.h" + + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + + +// io routines to the io ports + +#include "portio.h" + + +// CARDTYPE definitions file + +#include "cardtype.h" + + +// include exported function definitions + +#include "card.h" + +//----------------------------------------------------------------------- +// +// Definitions +// +//----------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// +// Redefined Functions +// +//----------------------------------------------------------------------- + +#define CardReadBytesFast PC9010ReadBytesFast +#define CardWriteBytesFast PC9010WriteBytesFast +#define CardWriteBytesCommand CardWriteBytesFast + +// the PC9010.C module needs access to the IO ports, PortIO provides this + +#define PC9010PortTest(g, reg, mask) \ + PortIOTest(&((PUCHAR)(g->BaseIoAddress))[reg],mask) + +#define PC9010PortSet(g, reg, mask) \ + PortIOSet(&((PUCHAR)(g->BaseIoAddress))[reg],mask); + +#define PC9010PortClear(g, reg, mask) \ + PortIOClear(&((PUCHAR)(g->BaseIoAddress))[reg],mask); + +#define PC9010PortPut(g,reg,byte) \ + PortIOPut(&((PUCHAR)(g->BaseIoAddress))[reg],byte); + +#define PC9010PortGet(g,reg,byte) \ + PortIOGet(&((PUCHAR)(g->BaseIoAddress))[reg],byte); + + +#define PC9010PortGetWord(g, reg, pword) \ + *(PUSHORT)pword = ScsiPortReadPortUshort ( \ + (PUSHORT)&(((PUCHAR)(g->BaseIoAddress))[reg])); + +#define PC9010PortGetBufferWord(g, reg, buffer, len) \ + ScsiPortReadPortBufferUshort ( \ + (PUSHORT)&(((PUCHAR)(g->BaseIoAddress))[reg]), \ + (PUSHORT)buffer, len); + +#define PC9010PortPutWord(g, reg, word) \ + ScsiPortWritePortUshort ( \ + (PUSHORT)&(((PUCHAR)(g->BaseIoAddress))[reg]),(USHORT)word) + +#define PC9010PortPutBufferWord(g, reg, buffer, len) \ + ScsiPortWritePortBufferUshort ( \ + (PUSHORT)&(((PUCHAR)(g->BaseIoAddress))[reg]), \ + (PUSHORT)buffer, len); + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + +#endif // _CARDT160_H diff --git a/private/ntos/miniport/trantor/include/cardt338.h b/private/ntos/miniport/trantor/include/cardt338.h new file mode 100644 index 000000000..f8ad8ba69 --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardt338.h @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------- +// +// CARDT338.H +// +// T338 Adapter Definitions File +// +// Revisions: +// 02-01-93 KJB First. +// 02-25-93 KJB Reorganized, supports dataunderrun with long delay +// for under run on large xfers. Can we fix this? +// 03-05-93 JAP Cleaned comments, modified string in CardGetName() +// to conform to ASM Driver names. +// NOTE: This file was dated 02-26-93, but with no +// corresponding Revision History log. +// 03-08-93 JAP Added CardGetShortName() to conform to c_name +// returned in ASM-Drivers. +// 03-09-93 JAP Added CardGetType() function and included cardtype.h +// 03-12-93 KJB Now supports polling thru CardInterrupt and +// StartCommandInterrupt/FinishCommandInterrupt. +// 03-22-93 KJB Reorged for functional interface. +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + +// include general os definitions + +#include "osdefs.h" + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + + PBASE_REGISTER BaseIoAddress; // address of this card + +} ADAPTER_INFO, FARP PADAPTER_INFO; + +// they have an n5380 + +#include "n5380.h" + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + +// this card uses io ports + +#include "portio.h" + +// the parallel port defs + +#include "parallel.h" + +// the t338 board logic defs + +#include "t338.h" + +// CARDTYPE definitions file + +#include "cardtype.h" + +// Functions exported from library + +#include "card.h" + +// Redefined routines.. + +#define CardWriteBytesFast T338WriteBytesFast +#define CardReadBytesFast T338ReadBytesFast +#define CardWriteBytesCommand ScsiWriteBytesSlow + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + diff --git a/private/ntos/miniport/trantor/include/cardt348.h b/private/ntos/miniport/trantor/include/cardt348.h new file mode 100644 index 000000000..790a521ce --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardt348.h @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------- +// +// CARDT348.H +// +// T348 Adapter Definitions File +// +// +// Revision History: +// +// 09-01-92 KJB First. +// 02-25-93 KJB Reorganized, supports dataunderrun with long delay +// for under run on large xfers. Can we fix this? +// 03-05-93 JAP Cleaned comments, modified string in CardGetName() +// to conform to ASM Driver names. +// 03-08-93 JAP Added CardGetShortName() to conform to c_name +// returned in ASM-Drivers. +// 03-09-93 JAP Added CardGetType() function and included cardtype.h +// 03-12-93 KJB Now supports polling thru CardInterrupt and +// StartCommandInterrupt/FinishCommandInterrupt. +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + +// include general os definitions + +#include "osdefs.h" + + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + + PBASE_REGISTER BaseIoAddress; // address of this card + UCHAR ParallelPortType; // the type of parallel port being used + +} ADAPTER_INFO, FARP PADAPTER_INFO; + +// they have an n5380 + +#include "n5380.h" + + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + + +// the paralle port uses io ports + +#include "portio.h" + + +// the parallel port defs + +#include "parallel.h" + + +// the p3c chip defs + +#include "p3c.h" + + +// CARDTYPE definitions file + +#include "cardtype.h" + +// Functions exported to library + +#include "card.h" + +//----------------------------------------------------------------------- +// +// Redefined routines +// +//----------------------------------------------------------------------- + +#define CardWriteBytesCommand ScsiWriteBytesSlow +#define CardWriteBytesFast P3CWriteBytesFast +#define CardReadBytesFast P3CReadBytesFast + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + diff --git a/private/ntos/miniport/trantor/include/cardt358.h b/private/ntos/miniport/trantor/include/cardt358.h new file mode 100644 index 000000000..68020bf15 --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardt358.h @@ -0,0 +1,115 @@ +//----------------------------------------------------------------------- +// +// CARDT358.H +// +// T358 Adapter Definitions File +// +// +// Revision History: +// +// 03-26-93 KJB First. +// 05-13-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both the PBASE_REGISTER and the +// PWORKSPACE parameters. +// 05-14-93 KJB CardCheckAdapter now does not take a PBASE_REGISTER +// parameter, this parameter is now in the PINIT +// structure. +// +//----------------------------------------------------------------------- + +// include general os definitions + +#include "osdefs.h" + +// the parallel port uses io ports + +#include "portio.h" + + +// the parallel port defs + +#include "parallel.h" + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + PBASE_REGISTER BaseIoAddress; // address of this card + UCHAR ParallelPortType; // the type of parallel port being used + UCHAR Delay; // amount of delay for t358 + BOOLEAN EnableInterrupt; // whether or not interrupt should be enabled + UCHAR SignatureBytes[2]; // signature bytes of T358 + + // the following routines are all remapped based on the type of + // parallel port detected... + + VOID (*EP3CWriteControlRegister)(struct tagAdapterInfo FARP g, + UCHAR reg, UCHAR value); + VOID (*EP3CReadControlRegister)(struct tagAdapterInfo FARP g, + PUCHAR value); + VOID (*EP3CReadDataRegister)(struct tagAdapterInfo FARP g, + UCHAR reg, PUCHAR byte); + VOID (*EP3CWriteDataRegister)(struct tagAdapterInfo FARP g, + UCHAR reg, UCHAR byte); + VOID (*EP3CReadFifo)(PBASE_REGISTER baseIoAddress, PUCHAR buffer); + VOID (*EP3CWriteFifo)(PBASE_REGISTER baseIoAddress, PUCHAR buffer); + VOID (*EP3CSetRegister)(struct tagAdapterInfo FARP g, UCHAR reg); + +} ADAPTER_INFO, FARP PADAPTER_INFO; + + +// the ep3c chip defs + +#include "ep3c.h" + + +// the 386sl and 80360 definitions + +#include "sl386.h" + + +// they have an n5380 + +#include "n5380.h" + + +// all of these cards have a 53c400 + +#include "n53c400.h" + + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + + +// CARDTYPE definitions file + +#include "cardtype.h" + +// Functions exported to library + +#include "card.h" + +//----------------------------------------------------------------------- +// +// Redefined routines +// +//----------------------------------------------------------------------- + +#define CardWriteBytesCommand N53C400WriteBytesFast +#define CardWriteBytesFast N53C400WriteBytesFast +#define CardReadBytesFast N53C400ReadBytesFast + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + diff --git a/private/ntos/miniport/trantor/include/cardtmv1.h b/private/ntos/miniport/trantor/include/cardtmv1.h new file mode 100644 index 000000000..366ff74da --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardtmv1.h @@ -0,0 +1,112 @@ +#ifndef _CARDTMV1_H +#define _CARDTMV1_H + +//----------------------------------------------------------------------- +// +// CARDTMV1.H +// +// TMV1 Adapter Definitions File +// +// Revision History: +// +// 01-28-92 KJB First. +// 03-05-93 JAP Cleaned comments, modified string in CardGetName() +// to conform to ASM Driver names. +// NOTE: This file was dated 02-26-93, but with no +// corresponding Revision History log. +// 03-08-93 JAP Added CardGetShortName() to conform to c_name +// returned in ASM-Drivers. +// 03-09-93 JAP Added CardGetType() function and included cardtype.h +// 05-14-93 KJB CardCheckAdapter now does not take a PBASE_REGISTER +// parameter, this parameter is now in the PINIT +// structure. +// +//----------------------------------------------------------------------- + +// include general os definitions + +#include "osdefs.h" + + +// +// Global per Adapter Information +// +typedef struct tagAdapterInfo { + PBASE_REGISTER BaseIoAddress; // address of this card + UCHAR InterruptLevel; // interrupt level this card is using + UCHAR DRQMask; // mask for DRQ, varies with MV card type +} ADAPTER_INFO, FARP PADAPTER_INFO; + +// they have an n5380 + +#include "n5380.h" + + +// all 5380 type cards use the scsifnc module + +#include "scsifnc.h" + + +// all cards have a MV101 chip + +#include "mv101.h" + + +// all port access routines + +#include "portio.h" + + +// CARDTYPE definitions file + +#include "cardtype.h" + + +// include exported function definitions + +#include "card.h" + +//----------------------------------------------------------------------- +// +// Definitions +// +//----------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// Routines used by MV101.c +//----------------------------------------------------------------------- + +#define MV101PortTest(g, reg, mask) \ + PortIOTest(&((PUCHAR)g->BaseIoAddress)[reg],mask) + +#define MV101PortSet(g, reg, mask) \ + PortIOSet(&((PUCHAR)g->BaseIoAddress)[reg],mask); + +#define MV101PortClear(g, reg, mask) \ + PortIOClear(&((PUCHAR)g->BaseIoAddress)[reg],mask); + +#define MV101PortPut(g,reg,byte) \ + PortIOPut(&((PUCHAR)g->BaseIoAddress)[reg],byte); + +#define MV101PortGet(g,reg,byte) \ + PortIOGet(&((PUCHAR)g->BaseIoAddress)[reg],byte); + + +//----------------------------------------------------------------------- +// +// Redefined routines +// +//----------------------------------------------------------------------- + +#define CardReadBytesFast MV101ReadBytesFast +#define CardWriteBytesFast MV101WriteBytesFast +#define CardWriteBytesCommand ScsiWriteBytesSlow + +// +// Local routines (to the whole lower level driver) +// +VOID CardEnableInterrupt (PADAPTER_INFO g); +VOID CardDisableInterrupt (PADAPTER_INFO g); + +#endif // _CARDTMV1_H + diff --git a/private/ntos/miniport/trantor/include/cardtype.h b/private/ntos/miniport/trantor/include/cardtype.h new file mode 100644 index 000000000..346decc2c --- /dev/null +++ b/private/ntos/miniport/trantor/include/cardtype.h @@ -0,0 +1,48 @@ +#ifndef _CARDTYPE_H +#define _CARDTYPE_H + +//----------------------------------------------------------------------- +// +// CARDTYPE.H +// +// CARDTYPE_xxxx Definitions File +// +// Revision History: +// 03-09-93 JAP First. +// +//----------------------------------------------------------------------- + + +#define CARDTYPE_UNKNOWN 0 +#define CARDTYPE_T100 1 +#define CARDTYPE_SGATE 2 +#define CARDTYPE_T110_PROTO 3 +#define CARDTYPE_T150 4 +#define CARDTYPE_T200 5 +#define CARDTYPE_T110 6 +#define CARDTYPE_T120 7 +#define CARDTYPE_T140 8 +#define CARDTYPE_T500 9 +#define CARDTYPE_ASPI 10 +#define CARDTYPE_T12P 11 +#define CARDTYPE_T338 12 +#define CARDTYPE_TP30 13 +#define CARDTYPE_T130 14 +#define CARDTYPE_TMV1 15 +#define CARDTYPE_TMG1 16 +#define CARDTYPE_T348 17 +#define CARDTYPE_TP43 18 +#define CARDTYPE_T295 19 +#define CARDTYPE_T130B 20 +#define CARDTYPE_T180 21 +#define CARDTYPE_MK5087 22 +#define CARDTYPE_T160 23 +#define CARDTYPE_T358 24 + + +#endif // _CARDTYPE_H + + +//----------------------------------------------------------------------- +// End Of File. +//----------------------------------------------------------------------- diff --git a/private/ntos/miniport/trantor/include/ep3c.h b/private/ntos/miniport/trantor/include/ep3c.h new file mode 100644 index 000000000..28d2380ce --- /dev/null +++ b/private/ntos/miniport/trantor/include/ep3c.h @@ -0,0 +1,78 @@ +//----------------------------------------------------------------------- +// +// EP3C.H +// +// Trantor EP3C Definitions File +// +// Revisions: +// 04-01-93 KJB First. +// 05-17-93 KJB Added some missing prototypes. +// +//----------------------------------------------------------------------- + +// mappings for registers + +#define EP3C_AREG1 0x00 +#define EP3C_AREG2 0x80 + +// bits for aux reg 1 + +#define EP3C_IRQEN 0x40 +#define EP3C_RSVD1 0x20 +#define EP3C_ADRS 0x1f + +// bits for aux reg 2 + +#define EP3C_RST 0x40 +#define EP3C_UNIDIR 0x20 +#define EP3C_RSVD2 0x18 +#define EP3C_DLY 0x07 + +// +// Public Functions +// + +// +// for the n53c400 that is in the EP3C +// 53c400 register offsets from 53c400 base +// + +#define N53C400_CONTROL 0x18 +#define N53C400_STATUS 0x18 +#define N53C400_COUNTER 0x19 +#define N53C400_SWITCH 0x1a +#define N53C400_HOST_BFR 0x10 +#define N53C400_5380 0x08 +#define N53C400_RAM 0x00 + +// for the 53C400 that is in the P3C + +VOID N53C400PortGet(PADAPTER_INFO g,UCHAR reg,PUCHAR byte); +VOID N53C400PortPut(PADAPTER_INFO g,UCHAR reg,UCHAR byte); +BOOLEAN N53C400PortTest(PADAPTER_INFO g,UCHAR reg,UCHAR byte); +VOID N53C400PortSet(PADAPTER_INFO g,UCHAR reg,UCHAR byte); +VOID N53C400PortClear(PADAPTER_INFO g,UCHAR reg,UCHAR byte); +VOID N53C400PortPutBuffer(PADAPTER_INFO g, UCHAR reg, + PUCHAR pbytes, ULONG len); +VOID N53C400PortGetBuffer(PADAPTER_INFO g, UCHAR reg, + PUCHAR pbytes, ULONG len); + +// for the parallel port the P3C uses + +#define ParallelPortGet(baseIoAddress, reg, byte) \ + PortIOGet((PUCHAR)baseIoAddress+reg,byte) +#define ParallelPortPut(baseIoAddress,reg,byte) \ + PortIOPut((PUCHAR)baseIoAddress+reg,byte) + +// exported routines + +BOOLEAN EP3CCheckAdapter(PADAPTER_INFO g); +USHORT EP3CDoCommand(PTSRB t); +VOID EP3CResetBus(PADAPTER_INFO g); +USHORT EP3CStartCommandInterrupt(PTSRB t); +USHORT EP3CFinishCommandInterrupt(PTSRB t); +BOOLEAN EP3CInterrupt(PADAPTER_INFO g); +VOID EP3CEnableInterrupt(PADAPTER_INFO g); +VOID EP3CDisableInterrupt(PADAPTER_INFO g); +VOID EP3CResetBus(PADAPTER_INFO g); + diff --git a/private/ntos/miniport/trantor/include/findpas.h b/private/ntos/miniport/trantor/include/findpas.h new file mode 100644 index 000000000..758de236e --- /dev/null +++ b/private/ntos/miniport/trantor/include/findpas.h @@ -0,0 +1,319 @@ +//========================================================================== +// +// Definitions from findpas.h (card searching) +// +// 01-28-93 KJB First. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +//========================================================================== + + + +typedef struct { + USHORT wBoardRev; + USHORT wChipRev; + union + { + struct /* Our PAS_16 gives */ + { + unsigned long CDInterfaceType:2; /* 3 */ + unsigned long EnhancedSCSI:1; /* 0 - not enhanced SCSI*/ + unsigned long DAC16:1; /* 1 DAC16 */ + + unsigned long OPL_3:1; /* 1 OPL3 */ + unsigned long Mixer_508:1; /* 1 Mixer 508 */ + unsigned long DualDAC:1; /* 1 Dual DAC */ + unsigned long MPU401:1; /* 0 NO mpu401 */ + + unsigned long Slot16:1; /* 1 - slot 16 */ + unsigned long MCA:1; /* 0 - not MCA */ + unsigned long CDPC:1; /* 0 - not CDPC */ + unsigned long SoundBlaster:1; /* 1 - sound blaster */ + + unsigned long SCSI_IO_16:1; /* 1 - ? */ + unsigned long reserved:2; + unsigned long Did_HW_Init:1; /* 0 - ? */ + unsigned long unused:16; + } CapsBits; + ULONG dwCaps; + } Caps; + ULONG ProPort; + UCHAR ProDMA; + UCHAR ProIRQ; + USHORT SBPort; + UCHAR SBDMA; + UCHAR SBIRQ; + USHORT MPUPort; + UCHAR MPUIRQ; + UCHAR CDIRQ; + ULONG TranslateCode; + UCHAR ReservedB1; + UCHAR ReservedB2; + PUCHAR PROBase; +} FOUNDINFO, FARP PFOUNDINFO; + + +// these version numbers are found in 0B8Bh +#define PAS_VERSION_1 0x000 // original +#define PAS_PLUS 0x001 // Pro Audio Spectrum Plus with SCSI +#define PAS_SIXTEEN 0x001 // Pro Audio Spectrum 16 with SCSI +#define PAS_STUDIO 0x003 +#define PAS_CDPC 0x007 // CDPC 05/06/92 mmq +#define BOARD_REV_MASK 07 + + +#define CHIP_REV_B 0x002 +#define CHIP_REV_D 0x004 + +#define NO_PAS_INSTALLED 0x000 // can't find board + + +// CD interface type definitions +#define NO_INTERFACE 0 +#define MITSUMI_TYPE 1 +#define SONY_TYPE 2 +#define SCSI_TYPE 3 +#define SCSI_TYPE 3 + +// sound definitions +#define SOUND_DEF_DMACHANNEL 1 // DMA channel no +#define SOUND_DEF_INT 7 +#define SOUND_DEF_PORT 0x220 + +//========================================================================== +// +// Definitions from pasdef.h +// +//========================================================================== + +// +// THESE DEFINITIONS FOR CAPABILITIES FILED +// + + +#define DEFAULT_BASE 0x388 // default base I/O address of Pro AudioSpectrum + +//// THESE ARE BASE REGISTER ATES + +// +// Used only during initialization +// + +#define PCM_CONTROL 0x0f8a // + +#define ENHANCED_SCSI_DETECT_REG 0x7f89 // + +#define SYSTEM_CONFIG_1 0x8388 // +#define SYSTEM_CONFIG_2 0x8389 // +#define SYSTEM_CONFIG_3 0x838a // +#define SYSTEM_CONFIG_4 0x838b // + +#define IO_PORT_CONFIG_1 0xf388 // +#define IO_PORT_CONFIG_2 0xf389 // +#define IO_PORT_CONFIG_3 0xf38a // + +#define COMPATIBLE_REGISTER_ENABLE 0xf788 // SB and MPU emulation +#define EMULATION_ADDRESS_POINTER 0xf789 // D0-D3 is SB; D4-D7 is MPU + +#define EMULATION_INTERRUPT_POINTER 0xfb8a // MPU and SB IRQ and SB DMA settings + +#define CHIP_REV 0xff88 // MV101 chip revision number +#define MASTER_MODE_READ 0xff8b // aka Master Address Pointer + +// +// Used for volume setting +// + +#define MIXER_508_REG 0x078b // Mixer 508 1 port + +#define SERIAL_MIXER 0x0b88 // for Pas 1 and Pas 8 +#define FEATURE_ENABLE 0x0b88 // for Pas 16 boards only +#define INTERRUPT_ENABLE 0x0b89 // +#define FILTER_REGISTER 0x0b8a // +#define INTERRUPT_CTRL_REG 0x0b8b // + + +// +// Only one of each of these +// + +#define PAS_2_WAKE_UP_REG 0x9a01 // aka Master Address Pointer + + +// +// Not used here +// + +#define TIMEOUT_COUNTER 0x4388 // +#define TIMEOUT_STATUS 0x4389 // +#define WAIT_STATE 0xbf88 // +#define PRESCALE_DIVIDER 0xbf8A // + +#define SLAVE_MODE_READ 0xef8b // bits D0-D1 + + + +#define READ_PAS(pGDI, port) \ + READ_PORT_UCHAR((PUCHAR)((port) ^ (pGDI->TranslateCode))) + +#define WRITE_PAS(pGDI, port, data) \ + WRITE_PORT_UCHAR((PUCHAR)((port) ^ (pGDI->TranslateCode)), (UCHAR)(data)) + + +// useful bit definitions +#define D0 (1<<0) +#define D1 (1<<1) +#define D2 (1<<2) +#define D3 (1<<3) +#define D4 (1<<4) +#define D5 (1<<5) +#define D6 (1<<6) +#define D7 (1<<7) + + +//// BIT FIELDS FOR COMPATIBLE_REGISTER_ENABLE +#define MPU_ENABLE_BIT D0 +#define SB_ENABLE_BIT D1 +#define SB_IRQ_ENABLE_BIT D2 // read only + +//// BIT FIELDS FOR FEATURE_ENABLE (0xb88) +#define PCM_FEATURE_ENABLE D0 +#define FM_FEATURE_ENABLE D1 +#define MIXER_FEATURE_ENABLE D2 +#define SB_FEATURE_ENABLE D4 + +/// BIT FIELDS FOR PCM CONTROL +#define PCM_STEREO D0+D3 +#define PCM_DAC D4 +#define PCM_MONO D5 +#define PCM_ENGINE D6 +#define PCM_DRQ D7 + +/// BIT FIELDS FOR SYSTEM CONFIG 3 +#define C3_ENHANCED_TIMER D0 +#define C3_SB_CLOCK_EMUL D1 // don't set! see Brian Colvin +#define C3_VCO_INVERT D2 +#define C3_INVERT_BCLK D3 +#define C3_SYNC_PULSE D4 +#define C3_PSEUDO_PCM_STEREO D5 + +/// BIT FIELDS FOR INTERRUPT ENABLE +#define INT_LEFT_FM D0 +#define INT_RIGHT_FM D1 +#define INT_SB D1 +#define INT_SAMPLE_RATE D2 +#define INT_SAMPLE_BUFFER D3 +#define INT_MIDI D4 + + + +/// BIT FIELDS FOR COMPATIBLE REGISTER ENABLE +#define COMPAT_MPU D0 +#define COMPAT_SB D1 + + +/// IRQ POINTER VALUES FOR EMULATION INTERRUPT POINTER +#define EMUL_IRQ_NONE 0 +#define EMUL_IRQ_2 1 +#define EMUL_IRQ_3 2 +#define EMUL_IRQ_5 3 +#define EMUL_IRQ_7 4 +#define EMUL_IRQ_10 5 +#define EMUL_IRQ_11 6 +#define EMUL_IRQ_12 7 + +/// DMA POINTER VALUES FOR EMULATION DMA POINTER +#define EMUL_DMA_NONE 0 +#define EMUL_DMA_1 1 +#define EMUL_DMA_2 2 +#define EMUL_DMA_3 3 + + +/// BIT VALUES FOR FILTER REGISTER +#define FILTER_NOMUTE D5 + + +#define MIXCROSSCAPS_NORMAL_STEREO 0 // Left->Left, Right->Right +#define MIXCROSSCAPS_RIGHT_TO_BOTH 1 // Right->Left, Right->Right +#define MIXCROSSCAPS_LEFT_TO_BOTH 2 // Left->Left, Left->Right +#define MIXCROSSCAPS_REVERSE_STEREO 4 // Left->Right, Right->Left +#define MIXCROSSCAPS_RIGHT_TO_LEFT 8 // Right->Left, Right->Right +#define MIXCROSSCAPS_LEFT_TO_RIGHT 0x10 // Left->Left, Left->Right + +#define OUT_AMPLIFIER 0 +#define OUT_PCM 1 + +#define _LEFT 1 +#define _RIGHT 2 + +#define _BASS 0 +#define _TREBLE 1 + + +#define MV_508_ADDRESS D7 +#define MV_508_INPUT D4 +#define MV_508_SWAP D6 +#define MV_508_BASS (D0+D1) +#define MV_508_TREBLE (D2) +#define MV_508_EQMODE (D2+D0) + +#define MV_508_LOUDNESS D2 +#define MV_508_ENHANCE (D1+D0) + +/// DEFINES FOR SERIAL MIXER +#define NATIONAL_SELECTMUTE_REG 0x40 +#define NATIONAL_LOUD_ENH_REG 0x41 +#define NATIONAL_BASS_REG 0x42 +#define NATIONAL_TREB_REG 0x43 +#define NATIONAL_LEFT_VOL_REG 0x44 +#define NATIONAL_RIGHT_VOL_REG 0x45 +#define NATIONAL_MODESELECT_REG 0x46 + +#define NATIONAL_COMMAND D7 +#define NATIONAL_LOUDNESS D0 +#define NATIONAL_ENHANCE D1 + +#define SERIAL_MIX_LEVEL D0 +#define SERIAL_MIX_CLOCK D1 +#define SERIAL_MIX_STROBE D2 +#define SERIAL_MIX_MASTER D4 +#define SERIAL_MIX_REALSOUND D6 +#define SERIAL_MIX_DUALFM D7 + + +// FILTER_REGISTER +#define fFIdatabits 0x1f // 00011111B filter select and decode field bits +#define fFImutebits D5 // filter mute field bit +#define fFIpcmbits (D7+D6) // 11000000B filter sample rate field bits +#define bFImute D5 // filter mute bit +#define bFIsrate D6 // filter sample rate timer mask +#define bFIsbuff D7 // filter sample buffer counter mask + +#define FILTERMAX 6 // six possible settings + +#define FILTER_MUTE 0 // mute - goes to PC speaker +#define FILTER_LEVEL_1 1 // 20hz to 2.9khz +#define FILTER_LEVEL_2 2 // 20hz to 5.9khz +#define FILTER_LEVEL_3 3 // 20hz to 8.9khz +#define FILTER_LEVEL_4 4 // 20hz to 11.9khz +#define FILTER_LEVEL_5 5 // 20hz to 15.9khz +#define FILTER_LEVEL_6 6 // 20hz to 17.8khz + + +/// SLAVE_MODE_READ BITS +#define SLAVE_MODE_OPL3 D2 +#define SLAVE_MODE_16 D3 + +#define PASX_IN(pFI, port) \ + ScsiPortReadPortUchar(pFI->PROBase + ( (port) ^ pFI->TranslateCode) ) + +#define PASX_OUT(pFI, port, data) \ + ScsiPortWritePortUchar(pFI->PROBase + ((port) ^ pFI->TranslateCode), (UCHAR)(data)) + +#define WRITE_PORT_UCHAR ScsiPortWritePortUchar +#define READ_PORT_UCHAR ScsiPortReadPortUchar + +// +// Exported routines +// +int FindPasHardware(PFOUNDINFO pFoundInfo); +void InitProHardware(PFOUNDINFO pFI); diff --git a/private/ntos/miniport/trantor/include/mv101.h b/private/ntos/miniport/trantor/include/mv101.h new file mode 100644 index 000000000..bf34042c9 --- /dev/null +++ b/private/ntos/miniport/trantor/include/mv101.h @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// +// MV101.H +// +// Trantor MV101 Definitions File +// +// Revisions: +// 02-25-93 KJB First. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 04-05-93 KJB Added prototypes for enable/disable interrupt. +// 05-13-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both the PBASE_REGISTER and the +// PWORKSPACE parameters. Auto Request Sense is +// now supported. +// 05-13-93 KJB Merged Microsoft Bug fixes to card detection. +// 05-17-93 KJB Added missing function prototype. +// +//----------------------------------------------------------------------- + + +// Register offsets of MV101 used by scsi + +#define MV101_5380_1 (0x1f88-0x388) +#define MV101_5380_2 (0x3f88-0x388) +#define MV101_TIMEOUT_COUNTER (0x4388-0x388) +#define MV101_TIMEOUT_STATUS (0x4389-0x388) +#define MV101_DMA_PORT (0x5f88-0x388) +#define MV101_DRQ_PORT (0x5f89-0x388) +#define MV101_IRQ_PORT (0x5f8b-0x388) +#define MV101_SYSTEM_CONFIG4 (0x838b-0x388) +#define MV101_WAIT_STATE (0xbf88-0x388) +#define MV101_IO_PORT_CONFIG3 (0xf38a-0x388) + +// +// Public Functions +// + +// for the 5380 that is in the P3C + +VOID N5380PortGet(PADAPTER_INFO g,UCHAR reg,PUCHAR byte); +VOID N5380PortPut(PADAPTER_INFO g,UCHAR reg,UCHAR byte); + +// exported routines + +BOOLEAN MV101CheckAdapter(PADAPTER_INFO g); +USHORT MV101DoCommand(PTSRB t); +USHORT MV101ReadBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT MV101WriteBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +VOID MV101ResetBus(PADAPTER_INFO g); +VOID MV101EnableInterrupt (PADAPTER_INFO g); +VOID MV101DisableInterrupt (PADAPTER_INFO g); +VOID MV101SetInterruptLevel (PADAPTER_INFO g, UCHAR level); + diff --git a/private/ntos/miniport/trantor/include/n5380.h b/private/ntos/miniport/trantor/include/n5380.h new file mode 100644 index 000000000..d0ece3765 --- /dev/null +++ b/private/ntos/miniport/trantor/include/n5380.h @@ -0,0 +1,148 @@ +//----------------------------------------------------------------------- +// +// FILE: n5380.h +// +// N5380 Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 01-12-93 KJB Changed reset time. +// 03-02-93 KJB/JAP Added N5380WaitLastByteSent. +// 03-09-93 KJB Changed Names of bits/register to be consistent with +// n5380 manual. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// +//----------------------------------------------------------------------- + +// scsi reset time in usec +#define SCSI_RESET_TIME 1000000 + +// +// Define the scsi phases +// + +#define PHASE_NULL 0 +#define PHASE_DATAOUT 0 +#define PHASE_DATAIN 1 +#define PHASE_COMMAND 2 +#define PHASE_STATUS 3 +#define PHASE_MSGOUT 6 +#define PHASE_MSGIN 7 + +// +// Define n5380 registers +// +// NOTE: The names of these registers are +// made to correspond exactly with the L5380 manual +// page 7 of Logic Devices Incorporated +// + +#define N5380_CURRENT_DATA 0 +#define N5380_OUTPUT_DATA 0 +#define N5380_INITIATOR_COMMAND 1 +#define N5380_MODE 2 +#define N5380_TARGET_COMMAND 3 +#define N5380_CURRENT_STATUS 4 +#define N5380_ID_SELECT 4 +#define N5380_DMA_STATUS 5 +#define N5380_START_DMA_SEND 5 +#define N5380_INPUT_DATA 6 +#define N5380_START_TARGET_RECIEVE 6 +#define N5380_RESET_INTERRUPT 7 +#define N5380_START_INITIATOR_RECEIVE 7 + +// +// Define 5380 register bit assignments +// +// NOTE: The names of these bit assignments are +// made to correspond exactly with the L5380 manual +// page 7 of Logic Devices Incorporated +// + +// Initiator Command + +#define IC_RST 0x80 +#define IC_ARBITRATION_IN_PROGRESS 0x40 +#define IC_LOST_ARBITRATION 0x20 +#define IC_ACK 0x10 +#define IC_BSY 0x8 +#define IC_SEL 0x4 +#define IC_ATN 0x2 +#define IC_DATA_BUS 0x1 + +// Mode Register + +#define MR_BLOCK_MODE_DMA 0x80 +#define MR_TARGET_MODE 0x40 +#define MR_ENABLE_PARITY_CHECKING 0x20 +#define MR_ENABLE_PARITY_INTERRUPT 0x10 +#define MR_ENABLE_EODMA_INTERRUPT 0x8 +#define MR_MONITOR_BSY 0x4 +#define MR_DMA_MODE 0x2 +#define MR_ARBITRATE 0x1 + +// Target Command Register + +#define TC_LAST_BYTE_SENT 0x80 +#define TC_REQ 0x8 +#define TC_MSG 0x4 +#define TC_CD 0x2 +#define TC_IO 0x1 + +// Current SCSI Control Register + +#define CS_RST 0x80 +#define CS_BSY 0x40 +#define CS_REQ 0x20 +#define CS_MSG 0x10 +#define CS_CD 0x8 +#define CS_IO 0x4 +#define CS_SEL 0x2 +#define CS_PARITY 0x1 + +// DMA Status Register + +#define DS_DMA_END 0x80 +#define DS_DMA_REQUEST 0x40 +#define DS_PARITY_ERROR 0x20 +#define DS_INTERRUPT_REQUEST 0x10 +#define DS_PHASE_MATCH 0x8 +#define DS_BUSY_ERROR 0x4 +#define DS_ATN 0x2 +#define DS_ACK 0x1 + +// +// Public Routines Definitions +// + +#define N5380EnableInterrupt(g) \ + N5380PortSet(g,N5380_MODE,MR_DMA_MODE) + +// +// Public Routines +// + +BOOLEAN N5380Interrupt(PADAPTER_INFO g); +VOID N5380DisableInterrupt(PADAPTER_INFO g); +USHORT N5380ToggleAck(PADAPTER_INFO g, ULONG usec); +USHORT N5380GetByte(PADAPTER_INFO g, ULONG usec, PUCHAR byte); +USHORT N5380PutByte(PADAPTER_INFO g, ULONG usec, UCHAR byte); +USHORT N5380GetPhase(PADAPTER_INFO g, PUCHAR phase); +USHORT N5380SetPhase(PADAPTER_INFO g, UCHAR phase); +USHORT N5380WaitNoRequest(PADAPTER_INFO g, ULONG usec); +USHORT N5380WaitRequest(PADAPTER_INFO g, ULONG usec); +USHORT N5380WaitNoBusy(PADAPTER_INFO g, ULONG usec); +USHORT N5380WaitBusy(PADAPTER_INFO g, ULONG usec); +USHORT N5380WaitLastByteSent(PADAPTER_INFO g, ULONG usec); +USHORT N5380Select(PADAPTER_INFO g, UCHAR target, UCHAR lun); +VOID N5380ResetBus(PADAPTER_INFO g); +BOOLEAN N5380CheckAdapter(PADAPTER_INFO g); +VOID N5380DebugDump(PADAPTER_INFO g); +VOID N5380EnableDmaWrite(PADAPTER_INFO g); +VOID N5380EnableDmaRead(PADAPTER_INFO g); +VOID N5380DisableDmaRead(PADAPTER_INFO g); +BOOLEAN N5380PortTest(PADAPTER_INFO g,UCHAR reg,UCHAR mask); +VOID N5380PortClear(PADAPTER_INFO g,UCHAR reg,UCHAR byte); +VOID N5380PortSet(PADAPTER_INFO g,UCHAR reg,UCHAR byte); +VOID N5380DisableDmaWrite (PADAPTER_INFO g); diff --git a/private/ntos/miniport/trantor/include/n53c400.h b/private/ntos/miniport/trantor/include/n53c400.h new file mode 100644 index 000000000..e9a798643 --- /dev/null +++ b/private/ntos/miniport/trantor/include/n53c400.h @@ -0,0 +1,59 @@ +//----------------------------------------------------------------------- +// +// FILE: n53c400.h +// +// N53C400 Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 04-01-03 KJB Moved N53C400 register offsets away from here to +// cardt13b.h. So we can use this module with the +// t358. +// +//----------------------------------------------------------------------- + +// Control Register for 53C400 + +#define CR_RST 0x80 +#define CR_DIR 0x40 +#define CR_BFR_INT 0x20 +#define CR_5380_INT 0x10 +#define CR_SH_INT 0x8 + +// Status Register for 53C400 + +#define SR_ACCESS 0x80 +#define SR_DIR 0x40 +#define SR_BFR_INT 0x20 +#define SR_5380_INT 0x10 +#define SR_SH_INT 0x8 +#define SR_HBFR_RDY 0x4 +#define SR_SBFR_RDY 0x2 +#define SR_IRQ_RDY 0x1 + +// +// Redefined routines +// + +// Each N53C400 has a 5380 built in + +#define N5380PortPut(g,reg,byte) \ + N53C400PortPut(g,N53C400_5380+reg,byte); + +#define N5380PortGet(g,reg,byte) \ + N53C400PortGet(g,N53C400_5380+reg,byte); + +// +// public functions +// + +BOOLEAN N53C400CheckAdapter(PADAPTER_INFO g); +USHORT N53C400WriteBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT N53C400ReadBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +VOID N53C400EnableInterrupt(PADAPTER_INFO g); +VOID N53C400DisableInterrupt(PADAPTER_INFO g); +VOID N53C400ResetBus(PADAPTER_INFO g); diff --git a/private/ntos/miniport/trantor/include/p3c.h b/private/ntos/miniport/trantor/include/p3c.h new file mode 100644 index 000000000..03f6f876d --- /dev/null +++ b/private/ntos/miniport/trantor/include/p3c.h @@ -0,0 +1,75 @@ +//----------------------------------------------------------------------- +// +// P3C.H +// +// Trantor P3C Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 02-25-93 KJB Reorganized, supports dataunderrun with long delay +// for under run on large xfers. Can we fix this? +// 03-12-93 KJB Now supports polling thru CardInterrupt and +// StartCommandInterrupt/FinishCommandInterrupt. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 04-05-93 KJB Fixed function prototype. +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + +// p3c control + +#define PC_RES 0x80 +#define PC_MODE 0x70 +#define PC_ADRS 0x0f + +// p3c modes + +#define PCCC_MODE_RPER_BYTE 0 +#define PCCC_MODE_RPER_NIBBLE 0x10 +#define PCCC_MODE_RDMA_BYTE 0x20 +#define PCCC_MODE_RDMA_NIBBLE 0x30 +#define PCCC_MODE_WPER 0x40 +#define PCCC_MODE_RSIG_BYTE 0x50 +#define PCCC_MODE_WDMA 0x60 +#define PCCC_MODE_RSIG_NIBBLE 0x70 + + +// +// Public Functions +// + +// for the 5380 that is in the P3C + +VOID N5380PortGet(PADAPTER_INFO g,UCHAR reg,PUCHAR byte); +VOID N5380PortPut(PADAPTER_INFO g,UCHAR reg,UCHAR byte); + +// for the parallel port the P3C uses + +#define ParallelPortGet(baseIoAddress, reg, byte) \ + PortIOGet((PUCHAR)baseIoAddress+reg,byte) +#define ParallelPortPut(baseIoAddress,reg,byte) \ + PortIOPut((PUCHAR)baseIoAddress+reg,byte) + +// exported routines + +BOOLEAN P3CCheckAdapter(PADAPTER_INFO g); +USHORT P3CDoCommand(PTSRB t); +VOID P3CResetBus(PADAPTER_INFO g); +USHORT P3CStartCommandInterrupt(PTSRB t); +USHORT P3CFinishCommandInterrupt(PTSRB t); +BOOLEAN P3CInterrupt(PADAPTER_INFO g); +USHORT P3CReadBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT P3CWriteBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +VOID P3CResetBus(PADAPTER_INFO g); +USHORT P3CDoIo(PTSRB t); + diff --git a/private/ntos/miniport/trantor/include/parallel.h b/private/ntos/miniport/trantor/include/parallel.h new file mode 100644 index 000000000..b2314998b --- /dev/null +++ b/private/ntos/miniport/trantor/include/parallel.h @@ -0,0 +1,43 @@ +// +// PARALLEL.H +// +// Parallel Port Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// + +// parallel port defs + +// p_s - status port + +#define P_BUSY 0x80 +#define P_ACK 0x40 +#define P_PE 0x20 +#define P_SELECT 0x10 +#define P_ERR 0x8 + +// p_c - control port. + +#define P_BUFEN 0xE0 +#define P_IRQEN 0x10 +#define P_SLC 0x8 +#define P_INIT 0x4 +#define P_AFX 0x2 +#define P_STB 0x1 + +// parallel port registers + +#define PARALLEL_DATA 0 +#define PARALLEL_STATUS 1 +#define PARALLEL_CONTROL 2 + +// +// Public Functions +// + +USHORT ParallelWaitBusy(PBASE_REGISTER baseIoAddress, ULONG usec, PUCHAR data); +USHORT ParallelWaitNoBusy(PBASE_REGISTER baseIoAddress, ULONG usec, PUCHAR data); + + diff --git a/private/ntos/miniport/trantor/include/pc9010.h b/private/ntos/miniport/trantor/include/pc9010.h new file mode 100644 index 000000000..b996b3efc --- /dev/null +++ b/private/ntos/miniport/trantor/include/pc9010.h @@ -0,0 +1,92 @@ +//----------------------------------------------------------------------- +// +// FILE: pc9010.h +// +// PC9010 Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 05-06-93 KJB Added prototype for PC9010CheckAdapter +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + +// +// PC9010 Register Offsets +// + +#define PC9010_CONFIG 0 +#define PC9010_CONTROL 2 +#define PC9010_FIFO_STATUS 3 +#define PC9010_FIFO 4 +#define PC9010_N5380 8 + +// size of fifo in bytes + +#define PC9010_FIFO_SIZE 128 + +// Config Register for PC9010 + +#define CFR_VERSION 0xF0 +#define CFR_SWITCH 0x0F + +// Control Register for PC9010 + +#define CTR_CONFIG 0x80 +#define CTR_SWSEL 0x40 +#define CTR_IRQEN 0x20 +#define CTR_DMAEN 0x10 +#define CTR_FEN 0x8 +#define CTR_FDIR 0x4 +#define CTR_F16 0x2 +#define CTR_FRST 0x1 + +// Fifo Status Register for PC9010 + +#define FSR_IRQ 0x80 +#define FSR_DRQ 0x40 +#define FSR_FHFUL 0x20 +#define FSR_FHEMP 0x10 +#define FSR_FLFUL 0x08 +#define FSR_FLEMP 0x04 +#define FSR_FFUL 0x02 +#define FSR_FEMP 0x01 + +// constant JEDEC ID + +#define PC9010_JEDEC_ID 0x8f + +// +// Redefined routines +// + +// Each PC9010 has a 5380 built in + +#define N5380PortPut(g,reg,byte) \ + PC9010PortPut(g,PC9010_N5380+reg,byte); + +#define N5380PortGet(g,reg,byte) \ + PC9010PortGet(g,PC9010_N5380+reg,byte); + +// +// public functions +// + +BOOLEAN PC9010CheckAdapter (PADAPTER_INFO g); +USHORT PC9010WriteBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT PC9010ReadBytesFast(PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +VOID PC9010EnableInterrupt(PADAPTER_INFO g); +VOID PC9010DisableInterrupt(PADAPTER_INFO g); +VOID PC9010ResetBus(PADAPTER_INFO g); + diff --git a/private/ntos/miniport/trantor/include/port.h b/private/ntos/miniport/trantor/include/port.h new file mode 100644 index 000000000..5b4da398e --- /dev/null +++ b/private/ntos/miniport/trantor/include/port.h @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------- +// +// FILE: PORT.H +// +// Port Access Definitions File +// +// Revisions: +// 01-08-92 KJB First. +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// +//--------------------------------------------------------------------- + +VOID CardPortClear (PUCHAR baseIoAddress, UCHAR mask); +VOID CardPortSet (PUCHAR baseIoAddress, UCHAR mask); +BOOLEAN CardPortTest (PUCHAR baseIoAddress, UCHAR mask); + +// the following definitions must be defined by card.h +// since there is a difference between io and memory mapped access + +// VOID CardPortGet (PUCHAR baseIoAddress, UCHAR *byte); +// VOID CardPortPut (PUCHAR baseIoAddress, UCHAR byte); diff --git a/private/ntos/miniport/trantor/include/portio.h b/private/ntos/miniport/trantor/include/portio.h new file mode 100644 index 000000000..161b8a389 --- /dev/null +++ b/private/ntos/miniport/trantor/include/portio.h @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------ +// +// FILE: PORTIO.H +// +// Port Access Definitions File +// +// Revisions: +// 01-08-92 KJB First. +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 04-07-93 KJB Added routines to deal with words. +// +//------------------------------------------------------------------------ + +VOID PortIOClear(PBASE_REGISTER baseIoAddress, UCHAR mask); +VOID PortIOSet(PBASE_REGISTER baseIoAddress, UCHAR mask); +BOOLEAN PortIOTest(PBASE_REGISTER baseIoAddress, UCHAR mask); +VOID PortIOClearWord(PBASE_REGISTER baseIoAddress, USHORT mask); +VOID PortIOSetWord(PBASE_REGISTER baseIoAddress, USHORT mask); +BOOLEAN PortIOTestWord(PBASE_REGISTER baseIoAddress, USHORT mask); + +// +// Generic Port Access Macros +// +#define PortIOGet(baseIoAddress,tmp) \ + *tmp = ScsiPortReadPortUchar(baseIoAddress); + +#define PortIOPut(baseIoAddress,tmp) \ + ScsiPortWritePortUchar(baseIoAddress,tmp); + +#define PortIOGetWord(baseIoAddress,tmp) \ + *tmp = ScsiPortReadPortUshort(baseIoAddress); + +#define PortIOPutWord(baseIoAddress,tmp) \ + ScsiPortWritePortUshort(baseIoAddress,tmp); + + diff --git a/private/ntos/miniport/trantor/include/portmem.h b/private/ntos/miniport/trantor/include/portmem.h new file mode 100644 index 000000000..1e99db5c3 --- /dev/null +++ b/private/ntos/miniport/trantor/include/portmem.h @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// FILE: PORTMEM.H +// +// Memory Mapped Port Access Definitions File +// +// Revisions: +// 01-08-92 KJB First. +// 02-25-93 KJB Renamed routines from CardPort to PortMem +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// +//----------------------------------------------------------------------- + +VOID PortMemClear(PUCHAR baseIoAddress, UCHAR mask); +VOID PortMemSet(PUCHAR baseIoAddress, UCHAR mask); +BOOLEAN PortMemTest(PUCHAR baseIoAddress, UCHAR mask); + +// +// Generic Port Access Macros +// +#define PortMemGet(baseIoAddress,tmp) \ + *tmp = ScsiPortReadRegisterUchar(baseIoAddress); + +#define PortMemPut(baseIoAddress,tmp) \ + ScsiPortWriteRegisterUchar(baseIoAddress,tmp); + diff --git a/private/ntos/miniport/trantor/include/scsifnc.h b/private/ntos/miniport/trantor/include/scsifnc.h new file mode 100644 index 000000000..f17892bb1 --- /dev/null +++ b/private/ntos/miniport/trantor/include/scsifnc.h @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------- +// +// FILE: SCSIFNC.H +// +// SCSIFNC Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 02-19-93 KJB Added support for data underrun and return of actual +// transfer size. +// 03-11-93 JAP Changed TSRB direction flag definitions from +// TSRB_READ/WRITE to TRSBD_READ/WRITE. +// Added TSRBD_UNKNOWN +// 03-11-93 KJB Changed dir flag names and others in TSRB structure. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-22-93 KJB Reorged for stub function library, TSRB def moved +// to typedefs.h. +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// +//------------------------------------------------------------------------- + +#ifndef _SCSIFNC_H +#define _SCSIFNC_H + +// +// Public Functions +// + +USHORT ScsiWriteBytesSlow (PADAPTER_INFO g, UCHAR FARP pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT ScsiReadBytesSlow (PADAPTER_INFO g, UCHAR FARP pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT ScsiSendCommand (PADAPTER_INFO g, UCHAR target, + UCHAR lun, UCHAR FARP pcmd, UCHAR cmdlen); +USHORT ScsiGetStat (PADAPTER_INFO g, PUCHAR pstatus); +USHORT ScsiDoIo(PTSRB t); +USHORT ScsiFinishCommandInterrupt (PTSRB t); +USHORT ScsiStartCommandInterrupt (PTSRB t); +USHORT ScsiDoCommand (PTSRB t); + +#endif // _SCSIFNC_H + diff --git a/private/ntos/miniport/trantor/include/scsiport.h b/private/ntos/miniport/trantor/include/scsiport.h new file mode 100644 index 000000000..67504878a --- /dev/null +++ b/private/ntos/miniport/trantor/include/scsiport.h @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------- +// +// FILE: scsiport.h +// +// Contains routine definitions for the operating system independent +// procedures to access i/o and memory locations. +// +// Revisions: +// 03-09-93 KJB First. +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// +//------------------------------------------------------------------------- + +UCHAR ScsiPortReadPortUchar (PUCHAR Port); +USHORT ScsiPortReadPortUshort (PUSHORT Port); +ULONG ScsiPortReadPortUlong (PULONG Port); +VOID ScsiPortReadPortBufferUchar (PUCHAR Port, PUCHAR Buffer, ULONG Count); +VOID ScsiPortReadPortBufferUshort (PUSHORT Port, PUSHORT Buffer, ULONG Count); +VOID ScsiPortReadPortBufferUlong (PULONG Port, PULONG Buffer, ULONG Count); +UCHAR ScsiPortReadRegisterUchar (PUCHAR Register); +USHORT ScsiPortReadRegisterUshort (PUSHORT Register); +ULONG ScsiPortReadRegisterUlong (PULONG Register); +VOID ScsiPortStallExecution (ULONG Delay); +VOID ScsiPortWritePortUchar (PUCHAR Port, UCHAR Value); +VOID ScsiPortWritePortUshort (PUSHORT Port, USHORT Value); +VOID ScsiPortWritePortUlong (PULONG Port, ULONG Value); +VOID ScsiPortWritePortBufferUchar (PUCHAR Port, PUCHAR Buffer, ULONG Count); +VOID ScsiPortWritePortBufferUshort (PUSHORT Port, PUSHORT Buffer, ULONG Count); +VOID ScsiPortWritePortBufferUlong (PULONG Port, PULONG Buffer, ULONG Count); +VOID ScsiPortWriteRegisterUchar (PUCHAR Register, UCHAR Value); +VOID ScsiPortWriteRegisterUshort (PUSHORT Register, USHORT Value); +VOID ScsiPortWriteRegisterUlong (PULONG Register, ULONG Value); + +#if DBG +VOID ScsiDebugPrint (ULONG DebugPrintLevel, PCCHAR DebugMessage, ...); +#else + +#define ScsiDebugPrint + +#endif // DBG diff --git a/private/ntos/miniport/trantor/include/sl386.h b/private/ntos/miniport/trantor/include/sl386.h new file mode 100644 index 000000000..4e8a61e94 --- /dev/null +++ b/private/ntos/miniport/trantor/include/sl386.h @@ -0,0 +1,202 @@ +//----------------------------------------------------------------------- +// +// SL386.H +// +// Trantor SL386 Definitions File +// +// Revisions: +// 04-07-93 KJB First, taken from SL386.def. +// 05-17-93 KJB Added missing prototype. +// +//----------------------------------------------------------------------- + +//----------------------------------------------------------------------- +// 80386SL unit configuration spaces +// +// Perform the following sequence of IOs to unlock the +// CPUPWRMODE register. +// +// byte write 0h to port 23h +// byte write 80h to port 22h +// word write 0080h to port 22h +// +// CPUPWRMODE bit definitions: +// +// Bit 15: IOCFGOPN +// +// Bits 14-9: Not defined here +// +// Bit 8: CPUCNFG lock +// +// Bits 7-4: Not defined here +// +// Bits 3,2: UID1 UID0 +// 0 0 CMCU (Mem ctlr unit cfg space) +// 0 1 CU (Cache unit cfg space) +// 1 0 IBU (Internal bus unit cfg space) +// 1 1 EBU (External bus unit cfg space) +// +// Bit 1: Unit enable +// +// Bit 0: Unlock status +//----------------------------------------------------------------------- + +#define SL_CPUPWRMODE 0x22 + +//cpupwrmode_rec record pm_iocfgopn:1,pm_resv:6,pm_cfg_lock:1, +//pm_resv1:4,pm_uid:2,pm_ue:1,pm_ls:1 + +#define PM_IOCFGOPN 0x8000 +#define PM_RESV 0x7e00 +#define PM_CFG_LOCK 0x0100 +#define PM_RESV1 0x00f0 +#define PM_UID 0x00c0 +#define PM_UE 0x0002 +#define PM_LS 0x0001 + +#define PM_UID_CMCU 0x00 +#define PM_UID_CU 0x40 +#define PM_UID_IBU 0x80 +#define PM_UID_EBU 0xc0 + + +//----------------------------------------------------------------------- +// 80386SL configuration space +//----------------------------------------------------------------------- + +// Read the following I/O addresses in the specified order to +// enable the 386SL configuration space. + +#define SL_CNFG_ENA1 0x0fc23 +#define SL_CNFG_ENA2 0x0f023 +#define SL_CNFG_ENA3 0x0c023 +#define SL_CNFG_ENA4 0x00023 + +#define SL_CFG_STATUS 0x23 //Config space status +#define SL_CFG_INDEX 0x24 //Config space index +#define SL_CFG_DATA 0x25 //Config space data + +#define SL_IDXLCK 0x0fa //Cfg index lock register +#define SL_IDXLCK_VAL 0x01 //default value for same + + +//----------------------------------------------------------------------- +// CFGR2 bit definitions +// +// Bit 7: COMA_MIDI +// +// Bits 6-4: AIRQ2 AIRQ1 AIRQ0 +// 0 0 0 COMA IRQ3 +// 0 0 1 COMA IRQ4 +// 0 1 0 COMA IRQ10 +// 0 1 1 COMA IRQ11 +// 1 0 0 COMA IRQ12 +// 1 0 1 COMA IRQ15 +// +// Bit 3: SFIO_EN +// +// Bit 2: FD_SEL +// +// Bit 1: HD_SEL +// +// Bit 0: PS2_EN +//----------------------------------------------------------------------- + +#define SL_CFGR2 0x61 //CFGR2 register index + +//cfgr2_rec record c2_midi:1,c2_airq:3,c2_sfio:1,c2_fd:1,c2_hd:1,c2_ps2:1 + +#define C2_MIDI 0x80 +#define C2_AIRQ 0x70 +#define C2_SFIO 0x08 +#define C2_FD 0x04 +#define C2_HD 0x02 +#define C2_PS2 0x01 + + +//----------------------------------------------------------------------- +// Special feature control registers +//----------------------------------------------------------------------- + +#define SL_SF_INDEX 0x0ae //Special feature index +#define SL_SF_DATA 0x0af //Special feature data + +#define SL_SFS_DISABLE 0x0f9 //Special feature disable +#define SL_SFS_ENABLE 0x0fb //Special feature enable + + +//----------------------------------------------------------------------- +// Bit definitions for FPP control register. +// +// Bit 7: 0 = ISA or PS/2 modes +// 1 = FAST_MODE (EPP) +// +// Bit 6: 0 = unidirectional mode +// 1 = bidirectional mode +// +// Bits 5,4: CTL5 CTL4 +// 0 0 Parallel port disabled +// 0 1 Parallel port LPT1 (378h), IRQ7 +// 1 0 Parallel port LPT2 (278h), IRQ5 +// 1 1 Reserved +// +// Bits 0-3: Reserved (0) +//----------------------------------------------------------------------- + +#define SL_FPP_CNTL 0x02 //SFS index for FPP_CNTL + +// fpp_cntl_rec record fpp_fm:1,fpp_em:1,fpp_ctl:2,fpp_resv:4 + +#define FPP_FM 0x80 +#define FPP_EM 0x40 +#define FPP_CTL 0x03 + +#define FPP_CTL_DIS 0 +#define FPP_CTL_LPT1 0x10 +#define FPP_CTL_LPT2 0x20 +#define FPP_CTL_RESV 0x30 + + +//----------------------------------------------------------------------- +// Bit definitions for PPCONFIG register. +// +// Bit 7: 0 = unidirectional mode +// 1 = bidirectional mode +// +// Bit 6,5: LPTSL1 LPTSL0 +// 0 0 Selects LPT1 (IO base 378h) +// 0 1 Selects LPT2 (IO base 278h) +// 1 0 Selects LPT3 (IO base 3bch) +// 1 1 Disables internal parallel port +// +// Bits 0-4: Reserved +//----------------------------------------------------------------------- + +#define SL_PPCONFIG 0x102 //PPCONFIG reg + +//ppconfig_rec record ppc_bid:1,ppc_sel:2,ppc_resv:5 + +#define PPC_BID 0x80 +#define PPC_SEL 0x60 +#define PPC_SEL_POS 0x05 +#define PPC_SEL_LPT1 0x00 +#define PPC_SEL_LPT2 0x20 +#define PPC_SEL_LPT3 0x40 +#define PPC_SEL_DIS 0x60 + + +//----------------------------------------------------------------------- +// EPP Parallel port register offsets +//----------------------------------------------------------------------- + +#define EPP_DATA 0x0 //read/write +#define EPP_STATUS 0x1 //read-only +#define EPP_CTL 0x2 //read/write +#define EPP_AUTO_ADDRESS 0x3 //read/write +#define EPP_AUTO_DATA 0x4 //read/write (also at 5h-7h) + +// +// Exported functions. +// + +BOOLEAN SL386EnableEPP(VOID ); diff --git a/private/ntos/miniport/trantor/include/status.h b/private/ntos/miniport/trantor/include/status.h new file mode 100644 index 000000000..a1079b376 --- /dev/null +++ b/private/ntos/miniport/trantor/include/status.h @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------- +// +// FILE: status.h +// +// Contains scsi status messages. +// +// Note: These errors are returned by the lower level drivers functions. +// At an even lower level, the functions either return these values or +// 0, where 0 indicates no error; but for cases where the card routines +// are passed a TSRB, 0 means SRB_STATUS_PENDING, and 1 means SRB_STATUS_ +// SUCCESS. +// +// Revisions: +// 03-09-93 KJB First. +// 03-11-93 JAP Changed #defines to reflect more appropriate meaning +// 03-23-93 KJB Added RET_STATUS_MISSED_INTERRUPT. +// +//------------------------------------------------------------------------- + + +#if DBG +#define DebugPrint(x) ScsiDebugPrint x +#else +#define DebugPrint(x) +#endif + +// +// Return Value Definitions +// + +#define RET_STATUS_PENDING 0x00 +#define RET_STATUS_SUCCESS 0x01 +#define RET_STATUS_ABORTED 0x02 +#define RET_STATUS_ABORT_FAILED 0x03 +#define RET_STATUS_ERROR 0x04 +#define RET_STATUS_BUSY 0x05 +#define RET_STATUS_INVALID_REQUEST 0x06 +#define RET_STATUS_INVALID_PATH_ID 0x07 +#define RET_STATUS_NO_DEVICE 0x08 +#define RET_STATUS_TIMEOUT 0x09 +#define RET_STATUS_SELECTION_TIMEOUT 0x0A +#define RET_STATUS_COMMAND_TIMEOUT 0x0B +#define RET_STATUS_MESSAGE_REJECTED 0x0D +#define RET_STATUS_BUS_RESET 0x0E +#define RET_STATUS_PARITY_ERROR 0x0F +#define RET_STATUS_REQUEST_SENSE_FAILED 0x10 +#define RET_STATUS_NO_HBA 0x11 +#define RET_STATUS_DATA_OVERRUN 0x12 +#define RET_STATUS_UNEXPECTED_BUS_FREE 0x13 +#define RET_STATUS_PHASE_SEQ_FAILURE 0x14 +#define RET_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 +#define RET_STATUS_REQUEST_FLUSHED 0x16 +#define RET_STATUS_INVALID_LUN 0x20 +#define RET_STATUS_INVALID_TARGET_ID 0x21 +#define RET_STATUS_BAD_FUNCTION 0x22 +#define RET_STATUS_ERROR_RECOVERY 0x23 +#define RET_STATUS_MISSED_INTERRUPT 0x101 + diff --git a/private/ntos/miniport/trantor/include/t128.h b/private/ntos/miniport/trantor/include/t128.h new file mode 100644 index 000000000..7d247b6ad --- /dev/null +++ b/private/ntos/miniport/trantor/include/t128.h @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------- +// +// T128.H +// +// Trantor T128 Definitions File +// +// This file contains definitions specific to the logic used on the T128 +// parallel to scsi adapter. +// +// Revisions: +// 02-25-92 KJB First. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//----------------------------------------------------------------------- + +// +// T128 Specific Hardware Definitions +// + +// T128 Registers + +#define T128_RAM 0x0000 +#define T128_ROM 0x1800 +#define T128_CONTROL 0x1C00 +#define T128_STATUS 0x1C20 +#define T128_5380 0x1D00 +#define T128_DATA 0x1E00 + +// control register definitions + +#define CR_UNUSED 0xe0 +#define CR_INTENB 0x10 +#define CR_SCSIWRITE 0x8 +#define CR_SCSIREAD 0x4 +#define CR_TIMEOUT 0x2 +#define CR_16BIT 0x1 + +// status registers + +#define SR_SW5 0x80 +#define SR_SW4 0x40 +#define SR_SW3 0x20 +#define SR_SW2 0x10 +#define SR_PS2 0x8 +#define SR_XFR_READY 0x4 +#define SR_TIMEOUT 0x2 +#define SR_16BIT 0x1 + +#define SR_ROM_ENABLED SR_SW5 +#define SR_DISABLE_TIMEOUT SR_SW4 + +// Each T128 has a 5380 built in + +#define N5380PortPut(g,reg,byte) \ + T128PortPut(g,T128_5380+reg*0x20,byte) + +#define N5380PortGet(g,reg,byte) \ + T128PortGet(g,T128_5380+reg*0x20,byte) + +// +// public functions +// + +USHORT T128WriteBytesFast (PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT T128ReadBytesFast (PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +VOID T128EnableInterrupt (PADAPTER_INFO g); +VOID T128DisableInterrupt (PADAPTER_INFO g); +VOID T128ResetBus (PADAPTER_INFO g); diff --git a/private/ntos/miniport/trantor/include/t338.h b/private/ntos/miniport/trantor/include/t338.h new file mode 100644 index 000000000..665fada0a --- /dev/null +++ b/private/ntos/miniport/trantor/include/t338.h @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------- +// +// T338.H +// +// Trantor T338 Definitions File +// +// This file contains definitions specific to the logic used on the T338 +// parallel to scsi adapter. +// +// Revisions: +// 02-01-92 KJB First. +// 03-12-93 KJB Now supports polling thru CardInterrupt and +// StartCommandInterrupt/FinishCommandInterrupt. +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-25-93 JAP Fixed up prototype typedef inconsistencies +// 05-14-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both a PINIT and a PWORKSPACE parameters. +// +//------------------------------------------------------------------------- + +// T338 control + +#define T338_RES 0xc0 +#define T338_MODE 0x38 +#define T338_ADRS 0x07 + +// T338 Modes + +#define T338_MR 0x20 +#define T338_IOW 0x10 +#define T338_IOR 0x08 + +// +// Public Functions +// + +// for the 5380 that is in the T338 + +void N5380PortGet(PADAPTER_INFO g,UCHAR reg,PUCHAR byte); +void N5380PortPut(PADAPTER_INFO g,UCHAR reg,UCHAR byte); + +// for the parallel port the T338 uses + +#define ParallelPortGet(baseIoAddress, reg, byte) \ + PortIOGet((PUCHAR)baseIoAddress+reg,byte) +#define ParallelPortPut(baseIoAddress,reg,byte) \ + PortIOPut((PUCHAR)baseIoAddress+reg,byte) + +// exported T338 functions + +BOOLEAN T338CheckAdapter (PADAPTER_INFO g); +VOID T338ResetBus (PADAPTER_INFO g); +USHORT T338DoCommand (PTSRB t); +USHORT T338StartCommandInterrupt (PTSRB t); +USHORT T338FinishCommandInterrupt (PTSRB t); +BOOLEAN T338Interrupt (PADAPTER_INFO g); +USHORT T338WriteBytesFast (PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT T338ReadBytesFast (PADAPTER_INFO g, PUCHAR pbytes, + ULONG len, PULONG pActualLen, UCHAR phase); +USHORT T338DoIo (PTSRB t); + diff --git a/private/ntos/miniport/trantor/include/trantor.h b/private/ntos/miniport/trantor/include/trantor.h new file mode 100644 index 000000000..ce1054ca5 --- /dev/null +++ b/private/ntos/miniport/trantor/include/trantor.h @@ -0,0 +1,28 @@ +// +// FILE: TRANTOR.H +// +// Trantor General Definitions File +// +// Revisions: +// 09-01-92 KJB First. +// 01-12-93 KJB Added AddressRange structure to determine resources used. +// 03-22-93 KJB Reorged for stub function library. +// 04-05-93 KJB Removed unused HOST_ID define. +// + +// wait upto 1 sec for request to come back from target +#define TIMEOUT_REQUEST 1000000 + +// wait timeout for a request loop during a fast read +// this is # of times to loop 0x10000 times +#define TIMEOUT_READWRITE_LOOP 0x40 + +// wait upto 1 sec for busy to disappear from scsi bus +#define TIMEOUT_BUSY 1000000 + +// wait upto 250 msec for target to be selected +#define TIMEOUT_SELECT 250000 + +// wait in a for loop up to TIMEOUT_QUICK times +#define TIMEOUT_QUICK 10000 + diff --git a/private/ntos/miniport/trantor/include/typedefs.h b/private/ntos/miniport/trantor/include/typedefs.h new file mode 100644 index 000000000..4599a4588 --- /dev/null +++ b/private/ntos/miniport/trantor/include/typedefs.h @@ -0,0 +1,274 @@ +//----------------------------------------------------------------------- +// +// typedefs.h +// +// Contains general useful typedefs and defines. +// +// History: +// 03-09-93 KJB First. +// 03-17-93 JAP Added #ifndef _TYPEDEFS_H to prevent re-definitions +// 03-19-93 JAP Implemented condition build FAR and NEAR pointers +// 03-22-93 KJB Reorged for stub function library. +// 03-24-93 KJB Added support for Scatter Gather Lists. This idea +// Scatter gather has not been added yet, time is +// not available now. +// 03-25-93 JAP Added TSRB_DIR_NONE for those SCSI cmds without data +// 04-06-93 KJB Define HOST_ID here for used outside library. +// 04-09-93 KJB Added FARP and NEARP defs for WINNT. +// 05-13-93 KJB Added CardParseCommandString for card specific +// standard string parsing across platforms. +// Changed CardCheckAdapter to accept an +// Initialization info from command line, ie +// force bi-directional ports, etc. +// All functions that used to take an PBASE_REGISTER +// parameter now take PWORKSPACE. CardCheckAdapter +// takes the both the PBASE_REGISTER and the +// PWORKSPACE parameters. Auto Request Sense is +// now supported. TSRB Structure changed. +// 05-13-93 KJB Added RequestSenseValid field to TSRB. +// 05-14-93 KJB Added BaseIoAddress entry to PINIT structure. +// 05-17-93 KJB Added ifndef WINNT around some typedefs to +// prevent multiple definitions for WINNT. +// 05-17-93 KJB Added ErrorLogging capabilities (used by WINNT). +// +//----------------------------------------------------------------------- + +#ifndef _TYPEDEFS_H +#define _TYPEDEFS_H + + #ifndef CONST +#define CONST const + #endif + + #ifdef NOVELL +#define FARP * +#define NEARP * + #else + #ifdef WINNT +#define FARP * +#define NEARP * + #else +#define FARP far * +#define NEARP near * + #endif + #endif + +#ifndef WINNT +// +// Void +// + +typedef void FARP PVOID; + +// +// Basics +// + +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +#endif + +// +// ANSI +// + +typedef CHAR FARP PCHAR; + +// +// Pointer to Basics +// + +typedef SHORT FARP PSHORT; +typedef LONG FARP PLONG; + +// +// Unsigned Basics +// + +typedef unsigned char UCHAR; +typedef unsigned short USHORT; +typedef unsigned long ULONG; + +// +// Pointer to Unsigned Basics +// + +typedef UCHAR FARP PUCHAR; +typedef UCHAR NEARP NPUCHAR; +typedef USHORT FARP PUSHORT; +typedef ULONG FARP PULONG; + +// +// Signed characters +// + +typedef signed char SCHAR; +typedef SCHAR FARP PSCHAR; + +// +// Cardinal Data Types [0 - 2**N-2) +// + +typedef char CCHAR; +typedef short CSHORT; +typedef ULONG CLONG; + +typedef CCHAR FARP PCCHAR; +typedef CSHORT FARP PCSHORT; +typedef CLONG FARP PCLONG; + +// +// Boolean +// + +typedef CCHAR BOOLEAN; // winnt +typedef BOOLEAN FARP PBOOLEAN; // winnt + +#define FALSE 0 +#define TRUE 1 +#ifndef NULL +#define NULL ((PVOID)0) +#endif // NULL + +#endif // WINNT + +//--------------------------------------------------------------------- +// TSRB and related... +//--------------------------------------------------------------------- + +// +// Scatter Gather Emulation Array +// + +typedef struct tagSCATGATENTRY { + PUCHAR buffer; + ULONG len; +} SCATTERGATHERENTRY, FARP PSCATTERGATHERENTRY; + +// +// Flags for the TSRB +// + +typedef struct tagTSRBFLAGS { + USHORT DoRequestSense : 1; + USHORT RequestSenseValid : 1; +// USHORT UseScatterGather : 1; +} TSRBFLAGS; + +// +// The TSRB STRUCTURE +// + +typedef struct tagTSRB { + PVOID pWorkspace; // private per-adapter workspace + UCHAR Target; // SCSI target id + UCHAR Lun; // Logical Unit + PUCHAR pCommand; // pointer to SCSI command + UCHAR CommandLen; // length of SCSI command + UCHAR Dir; // TSRB_READ, TSRB_WRITE, or TSRB_UNKNOWN + PUCHAR pData; // pointer to data + ULONG DataLen; // length of data transfer + ULONG ActualDataLen; // actual amt of data transferred + UCHAR Status; // SCSI status byte + PUCHAR pSenseData; // location to store sense data + UCHAR SenseDataLen; // len of sense data + TSRBFLAGS Flags; // boolean values + USHORT ReturnCode; // such as RET_STATUS_PENDING, like the func returns +// UCHAR NumScatGatEntry; // number of entries in scat gat list +// PSCATTERGATHERENTRY pScatGatEntry; // pointer to scatter gather list +} TSRB, FARP PTSRB; + + +// defines for direction + +#define TSRB_DIR_IN 0 +#define TSRB_DIR_OUT 1 +#define TSRB_DIR_UNKNOWN 2 +#define TSRB_DIR_NONE TSRB_DIR_IN + +// host id for the card + +#define HOST_ID 0x07 + +//--------------------------------------------------------------------- +// a generic pointer for card registers +//--------------------------------------------------------------------- + +typedef PVOID PBASE_REGISTER; +typedef PVOID PWORKSPACE; + +//--------------------------------------------------------------------- +// CARD SPECIFIC INITIALIZATION DEFINITIONS +//--------------------------------------------------------------------- + +// definitions for Parallel Port Type, used by parallel adapters + +#define PT_UNKNOWN 0 +#define PT_UNI 1 +#define PT_BI 2 +#define PT_EPP 3 + +// +// Initialization information for all cards. +// +typedef struct tagInit { + + // the baseIoAddress, used by all cards. + + PBASE_REGISTER BaseIoAddress; + + // used only for media-vision cards + + UCHAR InterruptLevel; + + // used only for parallel cards: T358, T348 + + UCHAR ParallelPortType; // the type of parallel port being used + + // used only for T358 + + UCHAR Delay; // amount of delay for t358 + +} INIT, FARP PINIT; + +//--------------------------------------------------------------------- +// Used only by WINNT... +//--------------------------------------------------------------------- + +#ifdef WINNT + +// +// The following is used along with the constant structure in card.c +// to define the precise i/o address a card will use +// +typedef struct tagCardAddressRange { + ULONG offset; // offset from base address + ULONG length; // length in memory + BOOLEAN memory; // is this address range in memory?? +} CardAddressRange; +extern const CardAddressRange cardAddressRange[]; + +// +// DEBUG LOGGING UTILITY +// +VOID TrantorLogError(PBASE_REGISTER IoAddress,USHORT TrantorErrorCode, + ULONG UniqueId); + +#else + +// do nothing for the other operating systems + +// +// DEBUG LOGGING UTILITY +// +#define TrantorLogError(IoAddress,TrantorErrorCode,UniqueId) + +#endif + +//--------------------------------------------------------------------- + +#endif //_TYPEDEFS_H + |