home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / aspio02.zip / aspio.h < prev    next >
C/C++ Source or Header  |  1999-08-17  |  3KB  |  108 lines

  1. /*
  2.  * $Source: r:/source/aspi/RCS/aspio.h,v $
  3.  * $Revision: 1.7 $
  4.  * $Date: 1999/08/18 02:10:24 $
  5.  * $Locker:  $
  6.  *
  7.  *    Describes complete ASPI Interface Library.
  8.  *
  9.  * $Log: aspio.h,v $
  10.  * Revision 1.7  1999/08/18 02:10:24  vitus
  11.  * - AspiDefectData()
  12.  *
  13.  * Revision 1.6  1999/08/18 00:21:52  vitus
  14.  * - added AspiInquiry()
  15.  *
  16.  * Revision 1.5  1998/11/07 19:46:08  vitus
  17.  * - added AspiPlxFlash* routines
  18.  *
  19.  * Revision 1.4  1997/09/22 02:30:58  vitus
  20.  * commented
  21.  * removed ASPI Router depend values
  22.  *
  23.  * Revision 1.3  1997/09/21 03:57:02  vitus
  24.  * added mode select
  25.  * added routines from ascii.c
  26.  *
  27.  * Revision 1.2  1997/09/17 01:34:17  vitus
  28.  * added 'strLastSense'
  29.  * added more 'Aspi*' routines
  30.  *
  31.  * Revision 1.1  1997/09/08 02:01:50  vitus
  32.  * Initial revision
  33.  * ----------------------------------------
  34.  * Sample code to demonstrate use of ASPI Interface.
  35.  */
  36.  
  37.  
  38.  
  39. extern SCSI_REQSENSE_DATA    strLastSense;
  40.  
  41.  
  42. /*
  43.  * Open/Close ASPI interface.  Use parameter to AspiOpen()
  44.  * to select interface (currently only 0: aspirout.sys).
  45.  */
  46. extern APIRET _System    AspiOpen(ULONG reserved);
  47. extern APIRET _System    AspiClose(void);
  48.  
  49. /*
  50.  * Lowest level, see ASPI spec.
  51.  */
  52. extern APIRET _System    AspiSendSRB(PASPI_SRB_HEADER srb,ULONG srbsize);
  53.  
  54. extern APIRET _System    AspiHAInq(UCHAR ha,PASPI_SRB_INQUIRY srb);
  55. extern APIRET _System    AspiGetType(UCHAR ha,UCHAR target,UCHAR lun,PUCHAR type);
  56.  
  57.  
  58. /*
  59.  * higher level: SCSI related stuff.
  60.  * Return value will be
  61.  * APIRET        if lower than 0x10000 (OS/2 errors codes are
  62.  *            really 16bit to keep them compatible with OS/2 1.x).
  63.  *            Please keep in mind that device driver errors are
  64.  *            returned as negative numbers (16bit).
  65.  * ASPI Error        if MSB == 0xF0, see ASPI spec.
  66.  * Host Adapter    Error    if MSB == 0xF1, see ASPI spec.
  67.  * Target Status    if MSB == 0xF2, see SCSI spec.  'hsLastSense' will
  68.  *            probably be valid.
  69.  */
  70. extern APIRET _System    AspiInquiry(UCHAR ha,UCHAR target,UCHAR lun,
  71.                     PVOID buf,ULONG bufsiz);
  72. extern APIRET _System    AspiModeSense(UCHAR ha,UCHAR target,UCHAR lun,
  73.                       UCHAR page,UCHAR pcontrol,
  74.                       PVOID buf,ULONG bufsiz);
  75. extern APIRET _System    AspiModeSelect(UCHAR ha,UCHAR target,UCHAR lun,
  76.                        UCHAR save,PVOID buf,ULONG bufsiz);
  77.  
  78. extern APIRET _System    AspiMount(UCHAR ha,UCHAR target,UCHAR lun,UCHAR mount);
  79. extern APIRET _System    AspiRewind(UCHAR ha,UCHAR target,UCHAR lun);
  80. extern APIRET _System    AspiReadSeq(UCHAR ha,UCHAR target,UCHAR lun,
  81.                     UCHAR fixed,ULONG count,
  82.                     PVOID buf,ULONG bufsiz);
  83. extern APIRET _System    AspiDefectData(UCHAR ha,UCHAR target,UCHAR lun,
  84.                        UCHAR pg,UCHAR format,
  85.                        PVOID buf,ULONG bufsiz);
  86.  
  87.  
  88. /* Restricted code from aspio.lib --> */
  89.  
  90. extern APIRET _System    AspiPlxFlashCheck(UCHAR ha,UCHAR target,UCHAR lun,
  91.                       PVOID buf,ULONG bufsiz);
  92. extern APIRET _System    AspiPlxFlashErase(UCHAR ha,UCHAR target,UCHAR lun,
  93.                       UCHAR mode,UCHAR sector);
  94. extern APIRET _System    AspiPlxFlashWrite(UCHAR ha,UCHAR target,UCHAR lun,
  95.                       UCHAR mode,ULONG offset,
  96.                       PVOID buf,ULONG bufsiz);
  97.  
  98. /* <-- */
  99.  
  100.  
  101. /*
  102.  * Small helpers
  103.  */
  104. extern char const *    AHInquiryType(UCHAR type);
  105. extern char const *    AHInquiryQual(UCHAR qual);
  106. extern void        AHSense(char * const buf,PSCSI_REQSENSE_DATA const sense);
  107.  
  108.