source: trunk/src/wnaspi32/aspilib.h@ 3541

Last change on this file since 3541 was 3541, checked in by sandervl, 25 years ago

PD:Implemented working ASPI

File size: 2.6 KB
Line 
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#ifndef _ASPILIB_H_
15#define _ASPILIB_H_
16
17//#include <os2wrap.h>
18#include "srbos2.h"
19
20class scsiObj
21{
22 private:
23 ULONG postSema; // Event Semaphore for posting SRB completion
24 ULONG driver_handle; // file handle for device driver
25 BOOL initSemaphore();
26 BOOL closeSemaphore();
27 BOOL openDriver();
28 BOOL closeDriver();
29 BOOL initBuffer();
30
31 public:
32 scsiObj();
33 ~scsiObj();
34 BOOL init(ULONG bufsize);
35 BOOL close();
36 ULONG rewind(UCHAR id, UCHAR lun);
37 ULONG read(UCHAR id, UCHAR lun, ULONG transfer);
38 ULONG locate(UCHAR id, UCHAR lun, ULONG block);
39 ULONG unload(UCHAR id, UCHAR lun);
40 ULONG write(UCHAR id, UCHAR lun, ULONG transfer);
41 ULONG write_filemarks(UCHAR id, UCHAR lun, BOOL setmark, ULONG count);
42 ULONG space(UCHAR id, UCHAR lun, UCHAR code, ULONG count);
43 ULONG read_position(UCHAR id, UCHAR lun, ULONG* pos, ULONG* partition, BOOL* BOP, BOOL* EOP);
44 ULONG HA_inquiry(UCHAR ha);
45 ULONG getDeviceType(UCHAR id, UCHAR lun);
46 ULONG testUnitReady(UCHAR id, UCHAR lun);
47 ULONG resetDevice(UCHAR id, UCHAR lun);
48 ULONG abort();
49 BOOL waitPost();
50 ULONG SendSRBlock(VOID);
51 ULONG getNumHosts();
52
53 SRBOS2 SRBlock; // SCSI Request Block
54 SRBOS2 AbortSRB; // Abort SRB
55 PVOID buffer; // Our data buffer
56};
57
58
59extern "C"
60{
61 BOOL fGainDrvAccess( BOOL fWait, ULONG *phSem);
62 BOOL fReleaseDrvAccess(ULONG hSem);
63}
64
65
66#endif // _ASPILIB_H_
Note: See TracBrowser for help on using the repository browser.