home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / CONTRIB / ASPI.ZIP / aspi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-25  |  945 b   |  30 lines

  1. #ifndef __ASPI_H__
  2. #define __ASPI_H__
  3.  
  4. #define ASPI_MKID(hostad,target,lun)    (((hostad)<<6)|(((target)&7)<<3)|((lun)&7))
  5. #define ASPI_ID2LUN(id)            ((id)&0x07)
  6. #define ASPI_ID2TARGET(id)        (((id)>>3)&0x07)
  7. #define ASPI_ID2HOSTAD(id)        (((id)>>6)&0x07)
  8.  
  9. #define ASPI_RW_NODATA    0
  10. #define ASPI_RW_READ    1
  11. #define ASPI_RW_WRITE    2
  12. #define ASPI_RW_BOTH    3
  13.  
  14. extern long aspi_buffer_length;    /* defaults to 128K, set before aspi_init, multiple of 16 */
  15. extern char aspi_sense[];
  16.  
  17. /* You must call this before anything else.  Returns number of Host Adapters, or -1 on error. */
  18. extern int aspi_init(void);
  19.  
  20. /* You must call this before exiting.  Returns 0 on success */
  21. extern int aspi_close(void);
  22.  
  23. /* Fast query the device type */
  24. extern int aspi_device_type(int _aspi_id);
  25.  
  26. /* General Purpose SCSI command */
  27. extern int aspi_exec(int _aspi_id, void *_buf, int _buflen, int _rw, char *_cdb, int _cdblen);
  28.  
  29. #endif /* __ASPI_H__ */
  30.