home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / Chip_2003-01_cd2.bin / others / support / aspi / aspi_v471.exe / include / srb16.h < prev    next >
C/C++ Source or Header  |  1998-07-07  |  15KB  |  264 lines

  1. /**!!SDK_16ONLY!!**/
  2. /**++SDK_EXCLUDE++**/
  3. /******************************************************************************
  4. **
  5. ** Copyright 1992-98 Adaptec, Inc.,  All Rights Reserved.
  6. **
  7. ** This software contains the valuable trade secrets of Adaptec.  The
  8. ** software is protected under copyright laws as an unpublished work of
  9. ** Adaptec.  Notice is for informational purposes only and does not imply
  10. ** publication.  The user of this software may make copies of the software
  11. ** for use with parts manufactured by Adaptec or under license from Adaptec
  12. ** and for no other use.
  13. **
  14. ******************************************************************************/
  15.  
  16. /******************************************************************************
  17. **
  18. **  Module Name:    srb16.h
  19. **
  20. **  Description:    ASPI for Win16 structure definitions.  No ASPI constants
  21. **                  are defined here.  Look in srbcmn.h for ASPI definitions
  22. **                  common to ASPI for Win16 and ASPI for Win32.
  23. **
  24. **                  This may be bad coding practice, but to keep down on the
  25. **                  chaff I have only documented those fields in the below
  26. **                  structures which aren't defined in the ASPI specification.
  27. **                  It makes the code a little easier to read, and I assume
  28. **                  only people maintaining this code will be messing with it.
  29. **                  I've also added offsets to help out when you're looking at
  30. **                  hex dumps.
  31. **
  32. **  Programmers:    Daniel Polfer (dap)
  33. **
  34. **  History:        11/09/95 (dap)  Initial creation using other headers.
  35. **                  09/03/96 (dap)  Renamed and modified to act as a shared
  36. **                                  file between KMD/VxD and the ring-3 DLLs.
  37. **                  06/24/98 (dap)  Modified to use allow auto-SDK generation.
  38. **
  39. **  Notes:          This file created using 4 spaces per tab.
  40. **
  41. **                  This file is NOT a customer deliverable to be included
  42. **                  with the ASPI SDK.  It is specific to our ASPI
  43. **                  implementation and DOES contain definitions of private
  44. **                  Adaptec structures.
  45. **
  46. ******************************************************************************/
  47.  
  48. #ifndef __SRB16_H__
  49. #define __SRB16_H__
  50.  
  51. /*
  52. ** Make sure structures are packed and undecorated.
  53. */
  54.  
  55. #ifdef __BORLANDC__
  56. #pragma option -a1
  57. #endif //__BORLANDC__
  58.  
  59. #ifdef _MSC_VER
  60. #pragma pack(1)
  61. #endif //__MSC_VER
  62.  
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif //__cplusplus
  66.  
  67. /**++SDK_PUBLIC++**/
  68. /**++SDK_16ONLY++**/
  69. //*****************************************************************************
  70. //          %%% SRB - HOST ADAPTER INQUIRY - SC_HA_INQUIRY (0) %%%
  71. //*****************************************************************************
  72.  
  73. typedef struct                                  // Offset
  74. {                                               // HX/DEC
  75.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_HA_INQUIRY
  76.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  77.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  78.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  79.     WORD        SRB_55AASignature;              // 04/004 Signature to signal extended inquiry
  80.     WORD        SRB_ExtBufferSize;              // 06/006 Size of extended buffer, if any
  81.     BYTE        HA_Count;                       // 08/008 Number of host adapters present
  82.     BYTE        HA_SCSI_ID;                     // 09/009 SCSI ID of host adapter
  83.     BYTE        HA_ManagerId[16];               // 0A/010 String describing the manager
  84.     BYTE        HA_Identifier[16];              // 1A/026 String describing the host adapter
  85.     BYTE        HA_Unique[16];                  // 2A/042 Host Adapter Unique parameters
  86.     BYTE        HA_ExtBuffer[8];                // 3A/058 Extended inquiry data
  87. }
  88. SRB16_HAInquiry, *PSRB16_HAInquiry, FAR *LPSRB16_HAInquiry;
  89.  
  90. //*****************************************************************************
  91. //          %%% SRB - GET DEVICE TYPE - SC_GET_DEV_TYPE (1) %%%
  92. //*****************************************************************************
  93.  
  94. typedef struct                                  // Offset
  95. {                                               // HX/DEC
  96.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_GET_DEV_TYPE
  97.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  98.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  99.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  100.     DWORD       SRB_Hdr_Rsvd;                   // 04/004 Reserved, MUST = 0
  101.     BYTE        SRB_Target;                     // 08/008 Target's SCSI ID
  102.     BYTE        SRB_Lun;                        // 09/009 Target's LUN number
  103.     BYTE        SRB_DeviceType;                 // 0A/010 Target's peripheral device type
  104. }
  105. SRB16_GDEVBlock, *PSRB16_GDEVBlock, FAR *LPSRB16_GDEVBlock;
  106.  
  107. //*****************************************************************************
  108. //          %%% SRB - EXECUTE SCSI COMMAND - SC_EXEC_SCSI_CMD (2) %%%
  109. //*****************************************************************************
  110.  
  111. /**++SDK_EXCLUDE++**/
  112. typedef struct                                  // Offset
  113. {                                               // HX/DEC
  114.     BYTE        SRB_Cmd;                        // 00/000
  115.     BYTE        SRB_Status;                     // 01/001
  116.     BYTE        SRB_HaId;                       // 02/002
  117.     BYTE        SRB_Flags;                      // 03/003
  118.     DWORD       SRB_Hdr_Rsvd;                   // 04/004
  119.     BYTE        SRB_Target;                     // 08/008
  120.     BYTE        SRB_Lun;                        // 09/009
  121.     DWORD       SRB_BufLen;                     // 0A/010
  122.     BYTE        SRB_SenseLen;                   // 0E/014
  123.     BYTE        FAR *SRB_BufPointer;            // 0F/015
  124.     BYTE        FAR *SRB_LinBufPointer;         // 13/019 SRB_Rsvd1 - 32 bit linear buf addr for WOW
  125.     BYTE        SRB_CDBLen;                     // 17/023
  126.     BYTE        SRB_HaStat;                     // 18/024
  127.     BYTE        SRB_TargStat;                   // 19/025
  128.     VOID        FAR *SRB_PostProc;              // 1A/026
  129.     BYTE        SRB_Rsvd2[29];                  // 1E/030
  130.     BYTE        SRB_PortStat;                   // 3B/059 SRB_Rsvd2 - Copy of port status byte
  131.     VOID        FAR *SRB_SRB16SOPointer;        // 3C/060 SRB_Rsvd2 - SEG/OFF pointer used by WOW
  132.     BYTE        CDBByte[];                      // 40/064
  133. }
  134. SRB16_ExecSCSICmd, *PSRB16_ExecSCSICmd, FAR *LPSRB16_ExecSCSICmd;
  135.  
  136. /**++SDK_16ONLY++**/
  137. typedef struct                                  // Offset Structure for 6-byte CDBs
  138. {                                               // HX/DEC
  139.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_EXEC_SCSI_CMD
  140.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  141.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  142.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  143.     DWORD       SRB_Hdr_Rsvd;                   // 04/004 Reserved, MUST = 0
  144.     BYTE        SRB_Target;                     // 08/008 Target's SCSI ID
  145.     BYTE        SRB_Lun;                        // 09/009 Target's LUN number
  146.     DWORD       SRB_BufLen;                     // 0A/010 Data Allocation Length
  147.     BYTE        SRB_SenseLen;                   // 0E/014 Sense Allocation Length
  148.     BYTE        FAR *SRB_BufPointer;            // 0F/015 Data Buffer Pointer
  149.     DWORD       SRB_Rsvd1;                      // 13/019 Reserved, MUST = 0
  150.     BYTE        SRB_CDBLen;                     // 17/023 CDB Length = 6
  151.     BYTE        SRB_HaStat;                     // 18/024 Host Adapter Status
  152.     BYTE        SRB_TargStat;                   // 19/025 Target Status
  153.     VOID        FAR *SRB_PostProc;              // 1A/026 Post routine
  154.     BYTE        SRB_Rsvd2[34];                  // 1E/030 Reserved, MUST = 0
  155.     BYTE        CDBByte[6];                     // 40/064 SCSI CDB
  156.     BYTE        SenseArea6[SENSE_LEN];          // 46/070 Request Sense buffer
  157. }
  158. SRB_ExecSCSICmd6, *PSRB_ExecSCSICmd6, FAR *LPSRB_ExecSCSICmd6;
  159.  
  160. typedef struct                                  // Offset Structure for 10-byte CDBs
  161. {                                               // HX/DEC
  162.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_EXEC_SCSI_CMD
  163.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  164.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  165.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  166.     DWORD       SRB_Hdr_Rsvd;                   // 04/004 Reserved, MUST = 0
  167.     BYTE        SRB_Target;                     // 08/008 Target's SCSI ID
  168.     BYTE        SRB_Lun;                        // 09/009 Target's LUN number
  169.     DWORD       SRB_BufLen;                     // 0A/010 Data Allocation Length
  170.     BYTE        SRB_SenseLen;                   // 0E/014 Sense Allocation Length
  171.     BYTE        FAR *SRB_BufPointer;            // 0F/015 Data Buffer Pointer
  172.     DWORD       SRB_Rsvd1;                      // 13/019 Reserved, MUST = 0
  173.     BYTE        SRB_CDBLen;                     // 17/023 CDB Length = 10
  174.     BYTE        SRB_HaStat;                     // 18/024 Host Adapter Status
  175.     BYTE        SRB_TargStat;                   // 19/025 Target Status
  176.     VOID        FAR *SRB_PostProc;              // 1A/026 Post routine
  177.     BYTE        SRB_Rsvd2[34];                  // 1E/030 Reserved, MUST = 0
  178.     BYTE        CDBByte[6];                     // 40/064 SCSI CDB
  179.     BYTE        SenseArea10[SENSE_LEN];         // 50/070 Request Sense buffer
  180. }
  181. SRB_ExecSCSICmd10, *PSRB_ExecSCSICmd10, FAR *LPSRB_ExecSCSICmd10;
  182.  
  183. typedef struct                                  // Offset Structure for 12-byte CDBs
  184. {                                               // HX/DEC
  185.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_EXEC_SCSI_CMD
  186.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  187.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  188.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  189.     DWORD       SRB_Hdr_Rsvd;                   // 04/004 Reserved, MUST = 0
  190.     BYTE        SRB_Target;                     // 08/008 Target's SCSI ID
  191.     BYTE        SRB_Lun;                        // 09/009 Target's LUN number
  192.     DWORD       SRB_BufLen;                     // 0A/010 Data Allocation Length
  193.     BYTE        SRB_SenseLen;                   // 0E/014 Sense Allocation Length
  194.     BYTE        FAR *SRB_BufPointer;            // 0F/015 Data Buffer Pointer
  195.     DWORD       SRB_Rsvd1;                      // 13/019 Reserved, MUST = 0
  196.     BYTE        SRB_CDBLen;                     // 17/023 CDB Length = 12
  197.     BYTE        SRB_HaStat;                     // 18/024 Host Adapter Status
  198.     BYTE        SRB_TargStat;                   // 19/025 Target Status
  199.     VOID        FAR *SRB_PostProc;              // 1A/026 Post routine
  200.     BYTE        SRB_Rsvd2[34];                  // 1E/030 Reserved, MUST = 0
  201.     BYTE        CDBByte[12];                    // 40/064 SCSI CDB
  202.     BYTE        SenseArea12[SENSE_LEN];         // 4C/076 Request Sense buffer
  203. }
  204. SRB_ExecSCSICmd12, *PSRB_ExecSCSICmd12, FAR *LPSRB_ExecSCSICmd12;
  205.  
  206. //*****************************************************************************
  207. //          %%% SRB - ABORT AN SRB - SC_ABORT_SRB (3) %%%
  208. //*****************************************************************************
  209.  
  210. typedef struct                                  // Offset
  211. {                                               // HX/DEC
  212.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_ABORT_SRB
  213.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  214.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  215.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  216.     DWORD       SRB_Hdr_Rsvd;                   // 04/004 Reserved, MUST = 0
  217.     VOID        FAR *SRB_ToAbort;               // 08/008 Pointer to SRB to abort
  218. }
  219. SRB16_Abort, *PSRB16_Abort, FAR *LPSRB16_Abort;
  220.  
  221. //*****************************************************************************
  222. //          %%% SRB - BUS DEVICE RESET - SC_RESET_DEV (4) %%%
  223. //*****************************************************************************
  224.  
  225. typedef struct                                  // Offset
  226. {                                               // HX/DEC
  227.     BYTE        SRB_Cmd;                        // 00/000 ASPI command code = SC_RESET_DEV
  228.     BYTE        SRB_Status;                     // 01/001 ASPI command status byte
  229.     BYTE        SRB_HaId;                       // 02/002 ASPI host adapter number
  230.     BYTE        SRB_Flags;                      // 03/003 ASPI request flags
  231.     DWORD       SRB_Hdr_Rsvd;                   // 04/004 Reserved, MUST = 0
  232.     BYTE        SRB_Target;                     // 08/008 Target's SCSI ID
  233.     BYTE        SRB_Lun;                        // 09/009 Target's LUN number
  234.     BYTE        SRB_ResetRsvd1[14];             // 0A/010 Reserved, MUST = 0
  235.     BYTE        SRB_HaStat;                     // 18/024 Host Adapter Status
  236.     BYTE        SRB_TargStat;                   // 19/025 Target Status
  237.     VOID        FAR *SRB_PostProc;              // 1A/026 Post routine
  238.     BYTE        SRB_ResetRsvd2[34];             // 1E/030 Reserved, MUST = 0
  239. }
  240. SRB16_BusDeviceReset, *PSRB16_BusDeviceReset, FAR *LPSRB16_BusDeviceReset;
  241.  
  242. /**++SDK_16ONLY://*****************************************************************************++**/
  243. /**++SDK_16ONLY://          %%% PROTOTYPES - User Callable ASPI for Win16 Functions %%%++**/
  244. /**++SDK_16ONLY://*****************************************************************************++**/
  245. /**++SDK_16ONLY:++**/
  246. /**++SDK_16ONLY:typedef BYTE far *LPSRB;++**/
  247. /**++SDK_16ONLY:++**/
  248. /**++SDK_16ONLY:WORD FAR PASCAL SendASPICommand( LPSRB );++**/
  249. /**++SDK_16ONLY:WORD FAR PASCAL GetASPISupportInfo( VOID );++**/
  250.  
  251. /*
  252. ** Restore compiler default packing and close off the C declarations.
  253. */
  254.  
  255. #ifdef _MSC_VER
  256. #pragma pack()
  257. #endif //_MSC_VER
  258.  
  259. #ifdef __cplusplus
  260. }
  261. #endif //__cplusplus
  262.  
  263. #endif //__WINASPI_H__
  264.