home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
pascal
/
vdl020d.zip
/
VASPI.DOC
< prev
next >
Wrap
Text File
|
1993-04-14
|
9KB
|
431 lines
{
════════════════════════════════════════════════════════════════════════════
Visionix SCSI Programming Interface Library (VASPI)
Copyright 1991,92,93 Visionix
ALL RIGHTS RESERVED
────────────────────────────────────────────────────────────────────────────
Revision history in reverse chronological order:
Initials Date Comment
──────── ──────── ────────────────────────────────────────────────────────
lpg 03/15/93 Added Source Documentation
mep 02/11/93 Cleaned up code for beta release
mep 02/08/93 Sync with beta 0.12 release
jrt 02/08/93 Sync with beta 0.12
jrt 01/26/92 Work on Windows/ASPI support
jrt 01/25/92 Reintegrated with mainline VDL version
jrt 11/15/92 Completed SIRS/Window version
jrt 09/10/92 First SIRS working version
════════════════════════════════════════════════════════════════════════════
}
Unit VASPI;
Uses
DOS;
{────────────────────────────────────────────────────────────────────────────}
Const
asReqInProc = $00;
asReqDone = $01;
asReqAborted = $02;
asReqDoneErr = $03;
asReqInvalid = $04;
asReqBadHost = $05;
asReqBadDev = $06;
Type
TError = WORD;
{---------------------------}
{ Ascii ID for Host Inquiry }
{---------------------------}
TAspiAsciiID = ARray[1..16] of CHAR;
PAspiAsciiID = ^TAspiAsciiId;
{--------------------------}
{ Host Inquiry Unique data }
{--------------------------}
TAspiHostInqUnique = Array[1..16] of BYTE;
PAspiHostInqUnique = ^TAspiHostInqUnique;
{---------------------}
{ ASPI Caps structure }
{---------------------}
TAspiCaps = RECORD
Reserved : BYTE;
END;
PAspiCaps = ^TAspiCaps;
{---------------------}
{ Host Inquiry Packet }
{---------------------}
TAspiHostInqPacket = RECORD
Command : BYTE;
Status : BYTE;
HostNum : BYTE;
SCSIReqFlags : BYTE;
Reserved : LONGINT;
NumHosts : BYTE;
HostSCSIid : BYTE;
SCSIManagerID : TAspiAsciiID;
HostAdapterID : TAspiAsciiID;
HostUniqueParams : TAspiHostInqUnique;
END;
PAsipHostInqPacket = ^TAspiHostInqPacket;
{---------------------}
{ Get Dev Type Packet }
{---------------------}
TAspiGetDevTypePacket = RECORD
Command : BYTE;
Status : BYTE;
HostNum : BYTE;
SCSIReqFlags : BYTE;
Reserved : LONGINT;
Target : BYTE;
LUN : BYTE;
DevType : BYTE;
END;
PAspiGetDevTypePacket = ^TAspiGetDevTypePacket;
{-----------------}
{ Exec SCI Packet }
{-----------------}
TAspiExecSCSIPacket = RECORD
Command : BYTE;
Status : BYTE;
HostNum : BYTE;
SCSIReqFlags : BYTE;
Reserved : LONGINT;
Target : BYTE;
LUN : BYTE;
DataSize : LONGINT;
SenseSize : BYTE;
DataBuff : POINTER;
SRBLink : POINTER;
CDBSize : BYTE;
HostStatus : BYTE;
DevStatus : BYTE;
PostRoutine : POINTER;
ASPIWorkSpace : Array[1..34] of BYTE;
CDB : Array[1..16+64] of BYTE;
END;
PAspiExecSCSIPacket = ^TAspiExecSCSIPacket;
{-----------------------------}
{ ASPI Get Int 13 info packet }
{-----------------------------}
TAspiGetInt13InfoPacket = RECORD
Command : BYTE;
Status : BYTE;
HostNum : BYTE;
SCSIReqFlags : BYTE;
Reserved : LONGINT;
Target : BYTE;
LUN : BYTE;
Int13Flags : BYTE;
Int13Drive : BYTE;
PrefHeadTrans : BYTE;
PrefSecTrans : BYTE;
Reserved2 : Array[1..10] of BYTE;
END;
PAspiGetInt13InfoPacket = ^TAspiGetInt13InfoPacket;
{-----------------------------}
{ ASPI Host Inquiry structure }
{-----------------------------}
TAspiHostInq = RECORD
HostSCSIid : BYTE;
HostAdapterID : TAspiAsciiID;
SCSIManagerID : TAspiAsciiID;
HostUniqueParams : TAspiHostInqUnique;
END;
PAspiHostInq = ^TAspiHostInq;
{-----------------------------------}
{ ASPI Int13 (Drive) Info structure }
{-----------------------------------}
TAspiInt13Info = RECORD
Int13Flags : BYTE;
Int13Drive : BYTE;
PrefHeadTrans : BYTE;
PrefSecTrans : BYTE;
END;
PAspiInt13Info = ^TAspiInt13Info;
{────────────────────────────────────────────────────────────────────────────}
Procedure ASPI_GetCaps( AspiCaps : PAspiCaps );
Function ASPI_LibInit : WORD;
Procedure ASPI_ExecPacket( ASPIPacket : POINTER );
Function ASPI_GetNumHosts : BYTE;
Function ASPI_HostInquiry( HostNum : BYTE;
HostInq : PAspiHostInq ) : TError;
Function ASPI_GetDevType( HostNum : BYTE;
Target : BYTE;
Lun : BYTE ) : BYTE;
Function ASPI_GetINT13Info( HostNum : BYTE;
Target : BYTE;
Lun : BYTE;
Int13Info : PAspiInt13Info ) : TError;
Var
ASPIEntry : POINTER;
{────────────────────────────────────────────────────────────────────────────}
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Procedure ASPI_GetCaps( AspiCaps : PAspiCaps );
[PARAMETERS]
AspiCaps ?
[RETURNS]
(None)
[DESCRIPTION]
Gets the capabilities of VASPI in the current environment.
[SEE-ALSO]
[EXAMPLE]
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Function ASPI_LibInit : WORD;
[PARAMETERS]
(None)
[RETURNS]
[DESCRIPTION]
Intializes the library; returns 0 if ASPI is present otherwise non-zero.
[SEE-ALSO]
[EXAMPLE]
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Procedure ASPI_ExecPacket( ASPIPacket : POINTER );
[PARAMETERS]
ASPIPacket Pointer to ASPI Packet
[RETURNS]
(None)
[DESCRIPTION]
Executes any ASPI request packet.
[SEE-ALSO]
[EXAMPLE]
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Function ASPI_GetNumHosts : BYTE;
[PARAMETERS]
(None)
[RETURNS]
Number of Attached Host Adapters
[DESCRIPTION]
Returns number of ASPI managers in the system.
[SEE-ALSO]
[EXAMPLE]
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Function ASPI_HostInquiry( HostNum : BYTE;
HostInq : PAspiHostInq ) : TError;
[PARAMETERS]
HostNum Host Adapter Number
HostInq Pointer to ASPI Host Adapter Inquiry Data
[RETURNS]
[DESCRIPTION]
Performs a ASPI Host Inquiry request.
[SEE-ALSO]
[EXAMPLE]
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Function ASPI_GetDevType( HostNum : BYTE;
Target : BYTE;
Lun : BYTE ) : BYTE;
[PARAMETERS]
HostNum Host Adapter Number
Target Device Target ID Number
Lun Device Logical Unit Number
[RETURNS]
Device Type Number
[DESCRIPTION]
Performs an ASPI get device type request.
[SEE-ALSO]
[EXAMPLE]
──────────────────────────────────────────────────────────────────────────────
[FUNCTION]
Function ASPI_GetINT13Info( HostNum : BYTE;
Target : BYTE;
Lun : BYTE;
Int13Info : PAspiInt13Info ) : TError;
[PARAMETERS]
HostNum Host Adapter Number
Target Device Target ID Number
Lun Device Logical Unit Number
Int13Info Pointer to ASPI INT13h Information Request Packet
[RETURNS]
[DESCRIPTION]
Performs an ASPI get int 13 info request.
[SEE-ALSO]
[EXAMPLE]