home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / cdrom / scsidevs / scsi_priv.h < prev    next >
C/C++ Source or Header  |  1981-07-07  |  4KB  |  144 lines

  1. /*
  2.  *    scsi_priv.h
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <ctype.h>
  8. #include <exec/types.h>
  9. #include <exec/io.h>
  10. #include <exec/execbase.h>
  11. #include <exec/nodes.h>
  12. #include <exec/memory.h>
  13. #include <devices/trackdisk.h>
  14. #include <devices/scsidisk.h>
  15. #include <libraries/dos.h>
  16. #ifdef __SASC
  17. #include <proto/all.h>
  18. #endif
  19.  
  20. #define BYTES_PER_LINE    16
  21. #define SENSE_LEN 252
  22. #define MAX_DATA_LEN 252
  23. #define MAX_TOC_LEN 804        /* max TOC size = 100 TOC track descriptors */
  24. #define PAD 0
  25. #define    LINE_BUF    (128)
  26. #define NUM_OF_CDDAFRAMES 75    /* 75 frames per second audio */
  27. /*#define CDDALEN 2352    */    /* 1 frame has 2352 bytes */
  28. #define CDDALEN 2448        /* 1 frame has max. 2448 bytes (subcode 2) */
  29. #define MAX_CDDALEN CDDALEN * NUM_OF_CDDAFRAMES
  30.  
  31. #define OFFS_KEY 2
  32. #define OFFS_CODE 12
  33.  
  34. #define NDBLBUF 8
  35.  
  36.  
  37. typedef struct
  38.  {
  39.    BYTE   code;
  40.    UBYTE  *ptr;
  41.  } IDTOSTRING;
  42.  
  43. typedef enum
  44. {
  45.   UNKNOWN      = -1,
  46.   APPLECD300   =  0,
  47.   APPLECD150   =  1,
  48.   TOSHIBA3401  =  2
  49. } DRIVETYPE;
  50.  
  51. /* type used for a 6 byte SCSI command */
  52. typedef struct
  53.  {
  54.    UBYTE  opcode;
  55.    UBYTE  b1;
  56.    UBYTE  b2;
  57.    UBYTE  b3;
  58.    UBYTE  b4;
  59.    UBYTE  control;
  60.  } SCSICMD6;
  61.  
  62. /* type used for a 10 byte SCSI command */
  63. typedef struct
  64.  {
  65.    UBYTE  opcode;
  66.    UBYTE  b1;
  67.    UBYTE  b2;
  68.    UBYTE  b3;
  69.    UBYTE  b4;
  70.    UBYTE  b5;
  71.    UBYTE  b6;
  72.    UBYTE  b7;
  73.    UBYTE  b8;
  74.    UBYTE  control;
  75.  } SCSICMD10;
  76.  
  77. /* type used for a 12 byte SCSI command */
  78. typedef struct
  79.  {
  80.    UBYTE  opcode;
  81.    UBYTE  b1;
  82.    UBYTE  b2;
  83.    UBYTE  b3;
  84.    UBYTE  b4;
  85.    UBYTE  b5;
  86.    UBYTE  b6;
  87.    UBYTE  b7;
  88.    UBYTE  b8;
  89.    UBYTE  b9;
  90.    UBYTE  b10;
  91.    UBYTE  control;
  92.  } SCSICMD12;
  93.  
  94.  
  95. /* SCSI commands */
  96.  
  97. #define    SCSI_CMD_TUR    0x00    /* Test Unit Ready    */
  98. #define    SCSI_CMD_RZU    0x01    /* Rezero Unit        */
  99. #define    SCSI_CMD_RQS    0x03    /* Request Sense    */
  100. #define    SCSI_CMD_FMU    0x04    /* Format unit        */
  101. #define    SCSI_CMD_RAB    0x07    /* Reassign Block    */
  102. #define    SCSI_CMD_RD    0x08    /* Read            */
  103. #define    SCSI_CMD_WR    0x0A    /* Write        */
  104. #define    SCSI_CMD_SK    0x0B    /* Seek            */
  105. #define    SCSI_CMD_INQ    0x12    /*  6B: Inquiry        */
  106. #define    SCSI_CMD_MSL    0x15    /* Mode Select        */
  107. #define    SCSI_CMD_RU    0x16    /* Reserve Unit        */
  108. #define    SCSI_CMD_RLU    0x17    /* Release Unit        */
  109. #define    SCSI_CMD_MSE    0x1A    /*  6B: Mode Sense    */
  110. #define    SCSI_CMD_SSU    0x1B    /*  6B: Start/Stop Unit    */
  111. #define    SCSI_CMD_RDI    0x1C    /* Receive Diagnostic    */
  112. #define    SCSI_CMD_SDI    0x1D    /* Send Diagnostic    */
  113. #define SCSI_CMD_PAMR    0x1E    /*  6B: Prevent Allow Medium Removal */
  114. #define    SCSI_CMD_RCP    0x25    /* Read Capacity    */
  115. #define    SCSI_CMD_RXT    0x28    /* Read Extended    */
  116. #define    SCSI_CMD_WXT    0x2A    /* Write Extended    */
  117. #define    SCSI_CMD_SKX    0x2B    /* Seek Extended    */
  118. #define    SCSI_CMD_WVF    0x2E    /* Write & Verify    */
  119. #define    SCSI_CMD_VF    0x2F    /* Verify        */
  120. #define    SCSI_CMD_RDD    0x37    /* Read Defect Data    */
  121. #define    SCSI_CMD_WDB    0x3B    /* Write Data Buffer    */
  122. #define    SCSI_CMD_RDB    0x3C    /* Read Data Buffer    */
  123.  
  124. #define SCSI_CMD_COPY        0x18    /*  6B: Copy */
  125. #define SCSI_CMD_COMPARE    0x39    /* 10B: Compare */
  126. #define SCSI_CMD_COPYANDVERIFY    0x3A    /* 10B: Copy and Verify */
  127. #define SCSI_CMD_CHGEDEF    0x40    /* 10B: Change Definition */
  128. #define SCSI_CMD_READSUBCHANNEL    0x42    /* 10B: Read Sub-Channel */
  129. #define SCSI_CMD_READTOC    0x43    /* Read TOC from CD Audio */
  130. #define SCSI_CMD_READHEADER    0x44    /* 10B: Read data block address header */
  131. #define SCSI_CMD_PLAYAUDIO10    0x45    /* Play CD Audio */
  132. #define SCSI_CMD_PLAYAUDIOTRACKINDEX    0x48    /* Play CD Audio Track */
  133.  
  134. /* Toshiba XM3x0x specific commands */
  135.  
  136. #define SCSI_CMD_READ12        0xA8    /* 12B: Read */
  137.  
  138. /* Sony CDU 561 / Sony CDU 8003 = Apple CD 300 specific commands */
  139.  
  140. #define SCSI_CMD_READCDDA    0xD8    /* 12B: read digital audio */
  141. #define SCSI_CMD_READCDDAMSF    0xD9    /* 12B: read digital audio */
  142.  
  143.  
  144.