home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / aspir101.zip / aspilib.h < prev    next >
C/C++ Source or Header  |  1997-06-08  |  3KB  |  61 lines

  1. //***************************************************************************
  2. //*                                                                         *
  3. //*  ASPI Router Library                                                    *
  4. //*                                                                         *
  5. //*  This is a sample library which shows how to send SRB's to the          *
  6. //*  ASPI Router device driver. USE AT YOUR OWN RISK!!                      *
  7. //*                                                                         *
  8. //*  Version 1.01 - June 1997                                               *
  9. //*                                                                         *
  10. //*  Changes since 1.00:                                                    *
  11. //*  abort(), AbortSRB added                                                *
  12. //*                                                                         *
  13. //***************************************************************************
  14.  
  15. #define      INCL_DOSFILEMGR
  16. #define      INCL_DOS
  17. #define      INCL_DOSDEVICES
  18. #define      INCL_DOSDEVIOCTL
  19. #define      INCL_DOSSEMAPHORES
  20. #define      INCL_DOSMEMMGR
  21. #include     <os2.h>
  22. #include     "srb.h"
  23. #include     <string.h>
  24. #include     <stdio.h>
  25.  
  26. class scsiObj
  27. {
  28.   private:
  29.     HEV         postSema;               // Event Semaphore for posting SRB completion
  30.     HFILE       driver_handle;          // file handle for device driver
  31.     BOOL        initSemaphore();
  32.     BOOL        closeSemaphore();
  33.     BOOL        openDriver();
  34.     BOOL        closeDriver();
  35.     BOOL        waitPost();
  36.     BOOL        initBuffer();
  37.  
  38.   public:
  39.     scsiObj();
  40.     ~scsiObj();
  41.     BOOL        init(ULONG bufsize);
  42.     BOOL        close();
  43.     ULONG       rewind(UCHAR id, UCHAR lun);
  44.     ULONG       read(UCHAR id, UCHAR lun, ULONG transfer);
  45.     ULONG       locate(UCHAR id, UCHAR lun, ULONG block);
  46.     ULONG       unload(UCHAR id, UCHAR lun);
  47.     ULONG       write(UCHAR id, UCHAR lun, ULONG transfer);
  48.     ULONG       write_filemarks(UCHAR id, UCHAR lun, BOOL setmark, ULONG count);
  49.     ULONG       space(UCHAR id, UCHAR lun, UCHAR code, ULONG count);
  50.     ULONG       read_position(UCHAR id, UCHAR lun, ULONG* pos, ULONG* partition, BOOL* BOP, BOOL* EOP);
  51.     ULONG       HA_inquiry(UCHAR ha);
  52.     ULONG       getDeviceType(UCHAR id, UCHAR lun);
  53.     ULONG       testUnitReady(UCHAR id, UCHAR lun);
  54.     ULONG       resetDevice(UCHAR id, UCHAR lun);
  55.     ULONG       abort();
  56.  
  57.     SRB         SRBlock;                // SCSI Request Block
  58.     SRB         AbortSRB;               // Abort SRB
  59.     PVOID       buffer;                 // Our data buffer
  60. };
  61.