/***************************************************************************** * * COPYRIGHT 1993 - COLORADO MEMORY SYSTEMS, INC. * ALL RIGHTS RESERVED. * ****************************************************************************** * * FILE: \SE\DRIVER\INCLUDE\PUBLIC\ASPI_API.H * * PURPOSE: Coantains all the data types required to access a SCSI Device via ASPI * * HISTORY: * $Log: J:\se.vcs\driver\include\public\aspi_api.h $ * * Rev 1.15 02 Sep 1994 09:45:44 RONSUTTO * Added SCSI_COMMAND_ABORTED_ERROR. * * Rev 1.14 08 Apr 1994 16:23:04 RONSUTTO * Added Additional Sense Codes 03, 3b, 33, 51, 82, and 53. * * Rev 1.13 28 Mar 1994 17:43:10 DALEHILL * Added the Additional Sense Qualifier Code SCSI_3M_MEDIA_FORMAT_CORRUPT. * * Rev 1.12 28 Mar 1994 16:00:00 DALEHILL * Added the Additional Sense Code SCSI_MEDIA_FORMAT_CORRUPT constant. * * Rev 1.11 10 Mar 1994 13:39:32 DALEHILL * Removed the errors: ERR_SCSI_BAD_BLOCK, ERR_SCSI_DEVICE_TIMEOUT, * ERR_SCSI_READ_RETRIES_FAILED, ERR_SCSI_WRITE_APPEND_FAILURE, & * ERR_SCSI_PHYSICAL_END_TAPE * * Rev 1.10 23 Feb 1994 17:50:40 DALEHILL * Added constants for SCSI_READ_FAILURE, SCSI_WRITE_FAILURE, * ERR_SCSI_READ_FAILURE, & ERR_SCSI_WRITE_FAILURE. * * Rev 1.9 19 Jan 1994 15:34:32 SCOTTMAK * Added ASPI manager id string to ASPIHAInquiry structure. * * Rev 1.8 12 Nov 1993 13:41:06 DALEHILL * Added the error ERR_SCSI_WAIT_FOR_POST * * Rev 1.7 15 Oct 1993 15:10:34 SCOTTMAK * Added structures for SCSI sense info * * Rev 1.6 15 Oct 1993 11:17:48 DALEHILL * Added some new error messages. * * Rev 1.5 30 Sep 1993 18:43:22 DALEHILL * In struct S_SCSIReq the type of data_buffer_ptr was changed to dUBytePtr * form dUDWord. * * Rev 1.4 29 Sep 1993 16:22:58 SCOTTMAK * Renumbered/renamed SCSI/ASPI error defines to fit new reporting scheme. * * Rev 1.3 27 Sep 1993 21:07:00 DALEHILL * Added some error codes * * Rev 1.2 27 Sep 1993 16:50:00 STEWARTK * Added structure definitions to support ASPI host adapter inquiry and BACK DOOR * * Rev 1.1 23 Sep 1993 15:31:26 SCOTTMAK * Commented out conflicting error defines. * * Rev 1.0 22 Sep 1993 19:19:06 DALEHILL * Initial Revision. * *****************************************************************************/ /* COMMENTS: ***************************************************************** * * DEFINITIONS: *************************************************************/ #define MAX_CDB_SIZE (dUByte)10 /* Max size of a SCSI CDB */ #define ASPI_HA_ID_LEN 16 /* host adapter inquiry command, HA_Identifier string length */ /* ASPI SERVICES: ***********************************************************/ #define HA_INQUIRY (dUByte)0 /* Host Adapter Inquiry */ #define GET_DEV_TYPE (dUByte)1 /* Get SCSI Device Type */ #define EXECUTE_REQ (dUByte)2 /* Execute the specified SCSI Command */ #define ABORT_IO_REQ (dUByte)3 /* Abort the currently executing command */ #define RESET_DEVICE (dUByte)4 /* Resets the SCSI Device */ #define GET_HA_SPEC_INFO (dUByte)0x7f /* Return Host Adapter spec info (IRQ & IO Channel) */ /* PSUEDO ASPI SERVICE: *****************************************************/ #define RETURN_SENSE_INFO (dUDWord)0x42 /* Tell ADI to return full sense info */ /* DATA TYPES: **************************************************************/ typedef struct S_SCSIReq { dUByte host_adapter_id; /* I: Host adapter ID */ dUByte scsi_id; /* I: SCSI target ID */ dUByte cdb_size; /* I: Size of CDB to pass to SCSI */ dUByte scsi_cdb[MAX_CDB_SIZE]; /* I: Actual CDB data */ dUWord data_buffer_size; /* I: Size of associated data buffer */ dUBytePtr data_buffer_ptr; /* I: Logical ptr to locked data buffer */ } SCSIReq, *SCSIReqPtr; typedef struct S_SCSIADIReq { ADIRequestHdr adi_header; /* ADI Request Header info */ SCSIReq scsi_req; /* SCSI specific cmd info */ } SCSIADIReq, *SCSIADIReqPtr; typedef struct S_ASPIHAInquiry { /* Filled in by HA_INQUIRY service */ dUByte scsi_id; /* O: SCSI ID of the host adapter */ dString ha_identifier[ASPI_HA_ID_LEN]; /* O: String describing the host adapter */ dString ha_manager_id[ASPI_HA_ID_LEN]; /* O: String describing the ASPI manager */ /* Filled in by GET_SPEC_INFO service */ dUWord ha_base_address; /* O: Base address of the host adapter */ dUByte ha_irq; /* O: IRQ used by the host adapter */ dUByte ha_slot; /* O: Physical slot in system the host adapter occupies */ } ASPIHAInquiry, *ASPIHAInquiryPtr; /* SPECIAL HEADER INFO STRUCTURE: *******************************************/ struct S_SRBHeader { dUByte SRB_Cmd; dUByte SRB_Status; dUByte SRB_HaId; dUByte SRB_Flags; }; typedef struct S_SRBHeader SRBHeader, *SRBHeaderPtr; /* SPECIAL SENSE INFO STRUCTURE: ********************************************/ struct S_SenseParms { dUByte error_code_plus; dUByte segment_number; dUByte sense_key_plus; dUByte info_bytes[4]; dUByte add_sense_length; dUByte source_sense_ptr; dUByte dest_sense_ptr; dUByte reserved[2]; dUByte add_sense_code; dUByte add_code_qualifier; dUByte reserved2; dUByte bit_ptr_plus; dUWord sense_specific2; }; typedef struct S_SenseParms SenseParms, *SenseParmsPtr; /* MASKS FOR SENSE INFO: ****************************************************/ #define VALID_ADDR_MASK (dUByte)0x80 /* error_code_plus */ #define ERROR_CODE_MASK (dUByte)0x7f #define SENSE_KEY_MASK (dUByte)0x0f /* sense_key_plus */ #define ILI_MASK (dUByte)0x20 #define EOM_MASK (dUByte)0x40 #define FMK_MASK (dUByte)0x80 #define BIT_PTR_MASK (dUByte)0x07 /* bit_ptr_plus */ #define BPV_MASK (dUByte)0x08 #define CD_MASK (dUByte)0x40 #define SKSV_MASK (dUByte)0x80 /* ASPI ERROR CODES: *************** Range: 0x1200 - 0x12ff *****************/ #define ERR_CSD (dUWord)(GROUPID_CSD<