home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma26.dms / ma26.adf / SCDPlayer / SCSISrc / scsi_priv.h < prev    next >
Text File  |  1993-12-23  |  4KB  |  146 lines

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